C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
34 stars 9 forks source link

Rider + Godot 4 Debugging - Get to Equal Godot 3.5 Quality #438

Closed QuintillusCFC closed 5 months ago

QuintillusCFC commented 5 months ago

I decided to try debug the Godot 4 branch to see if it could be made equivalent to Godot 3.5 in short order. Instead, I debugged the debugger.

For some reason, while you can set up the ability to launch Godot 4.x (tried 4.1.1 and 4.2.1) from Rider, it does not attach the debugger. You can attach it post-launch with Run -> Attach to Process, and selecting the Godot/C7 process, but it's a bit tedious. Still arguably faster than VSCode's debugging was last time I tried it, but not nearly as seamless as Godot 3.5 (half the time is the human responding to the UI, half is loading the list of processes).

In addition to trying two Godot 4.x versions, I tried both Rider 2023.1.6 (with its most-recent-available Godot plugin), and the latest Rider 2024.1 with the latest Godot plugin. I also tried removing the .idea folder and re-generating it, and rebuild the project after each change. Neither IDE could attach to Godot 4.x automatically.

Output from both 3.5 and 4.2.1, with Rider 2023.1.6 (newlines added for readability):

Godot 3.5 (Working)

"C:\Program Files\JetBrains\JetBrains Rider 2023.1.6\bin\runnerw.exe" 
"C:\Program Files\JetBrains\JetBrains Rider 2023.1.6\lib\ReSharperHost\windows-x64\dotnet\dotnet.exe" 
exec 
"C:\Program Files\JetBrains\JetBrains Rider 2023.1.6\lib\ReSharperHost\JetBrains.Debugger.Worker.exe" 
--mode=client --frontend-port=53736 "--plugins=C:\Users\QuintillusCFC\AppData\Roaming\JetBrains\Rider2023.1\plugins\rider-godot\dotnetDebuggerWorker;
C:\Program Files\JetBrains\JetBrains Rider 2023.1.6\plugins\rider-unity\dotnetDebuggerWorker"

"C:/Programming/Godot_v3.5.2-stable_mono_win64/Godot 3.5.2 x64.exe" --path "C:/Development/Civ Related Projects/Prototype/C7"
Process ""C:/Programming/Godot_v3.5.2-stable_mono_win64/Godot 3.5.2 x64.exe" --path "C:/Development/Civ Related Projects/Prototype/C7"" started.

Godot Engine v3.5.2.stable.mono.official.170ba337a - https://godotengine.org
OpenGL ES 3.0 Renderer: AMD Radeon RX 6600M
Async. shader compilation: OFF

Mono: Log file is: 'C:/Users/QuintillusCFC/AppData/Roaming/Godot/mono/mono_logs/2024-04
-12_00.25.46_24572.log'
Hello logger!

The only differences are the frontend-port, which seems to increment, and that 3.5 uses OpenGL ES rather than Vulkan. Rider 2024.1 has a slightly different sequence, but seeing the same output when the Rider version is the same makes me think it's something odd about Godot.

Link to the Godot plugin issues list: https://github.com/JetBrains/godot-support/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc Found a few that seemed sort-of related but no silver bullets. It seems like it's theoretically supporting Godot 4 at this point although support was added incrementally so how complete that is, I'm not sure. It may also make sense to try the maintainer's Dodge the Creeps game (https://github.com/van800/godot-demo-projects/tree/net6/mono/dodge_the_creeps) which now runs on Godot 4.2 to see if that debugs automagically or not.

QuintillusCFC commented 5 months ago

Confirmed that the same thing happens with "Dodge the Creeps" with the Rider 2023.1.6. Will it happen with the latest as well? If so, that implies it's time to report an issue and not keep debugging C7 debugging.

QuintillusCFC commented 5 months ago

Confirmed it occurs the same way with the latest Rider/Godot plugin and "Dodge the Creeps". Set a new personal high score of 22 seconds.

QuintillusCFC commented 5 months ago

Got a quick answer from the support ticket I filed; it needs to be a .NET Executable configuration type in Godot 4, not the Godot-icon "Start and Debug" type. I have updated our Wiki instructions to note that (while still leaving the Godot 3.5 instructions as well).