Coding without running the game
Often I go in a loop of
- Change code
- Run compiler
- Run unit test
- Repeat
During that time KSP2 will run happily in the background, burn 200 W of power for no reason and heat up my room. It would be even more without a third party tool to cap the FPS. Sometimes I manually suspend the KSP process, but that is cumbersome.
I would appreciate a solution, maybe a standalone test runner. Or maybe there is a third-party solution to automatically suspend KSP2 when in the background? I have not found anything.
I have to admit it's one of my wet dreams, but I didn't dare to ask for since I assume it implies to have a sideparty executable which could be frown upon the mod community. So I stack numerous hours on KSP² not for flying or building, but doing same loop as you :)
As for running unit-tests without the game:
There is this Xunit test that runs all the unit-tests of the std:: modules:
https://github.com/untoldwind/KontrolSystem2/blob/master/KSP2Runtime-Test/TO2StdTestSuite.cs
This could be easily converted into a standalone executable ... or, if one wants to go nuts: Converted into a standalone WASM lib to be integrated into the VSCode extension (mostly because I am somewhat interested in the state of the dotnet->WASM/WASI stack ...)
But: This would be rather limited. The bulk of the code depends on the underlying Unity-GameObjects, which most likely will not behave properly without the actual game. For the orbit calculations I kind of "solved" this by providing my own mock-implementation of a Kepler-orbit + taking the orbital parameters of the Kerbol system from the KSP1 wiki.
I am not sure if the same could be done for ... let's say the Vessel.
As for "pausing" the game:
I am not sure the pssuspend command will work on the game. But at least it should be possible to lower the process priority via the task manager or with some PowerShell magic
This issue is stale because it has been open for 60 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.