Pass --fixed-fps as two argv tokens - #263
Open
Eliasepfl wants to merge 1 commit into
Open
Conversation
--fixed-fps is a Godot engine argument and takes its value as a separate
token, but it was appended as one string ("--fixed-fps 60"). Popen passes
argv as a list, so Godot receives a single unknown parameter and aborts with
"Couldn't detect whether to run the editor, the project manager or a specific
project" instead of starting the game. Passing any framerate to GodotEnv is
therefore broken today.
The argv construction moves to GodotEnv._build_launch_cmd so it can be tested
without a game binary. Everything else keeps the --key=value form the plugin
parses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have been building a personal project on top of godot-rl-agents, a harness that generates Godot games from text and trains a policy on each one to check it is actually solvable. Getting it to run at scale surfaced a handful of small bugs and rough edges in the library. This is the first of four PRs, all independent and small, mostly fixes and throughput things I needed. Happy to rework or drop any of them.
--fixed-fpsis a Godot engine argument and expects its value as a separate token, but it is appended as one string:Popenreceives argv as a list, so Godot gets a single unknown parameter--fixed-fps 60rather than the flag and its value. On 4.7 the engine then gives up before starting the game:So passing any
frameratetoGodotEnvcurrently stops the game from launching.The fix splits it into two tokens. I also pulled the argv construction into
GodotEnv._build_launch_cmdso it can be unit tested without a game binary, and added tests for the flag forms. Everything else keeps the--key=valueshape the plugin parses.