Repository navigation
Conversation
GodotEnv.reset accepted a seed and dropped it, so gymnasium style reseeding was a silent no-op, and StableBaselinesGodotEnv.seed raised NotImplementedError, which crashes any sb3 algorithm constructed with a seed (PPO(seed=0) calls env.seed()). reset now puts the seed in the reset message, and the wrapper latches one seed per parallel game using the same seed + p offsets as the constructor, applied on the next reset like sb3's own vec envs do. The wire change is additive, older plugin versions ignore the extra key, so nothing breaks. Reading it on the Godot side is a small companion change in godot_rl_agents_plugin (the reset handler in sync.gd), happy to open that too.
The rllib CI jobs uninstall stable_baselines3 before running the suite, so a module level import of the sb3 wrapper turns into a pytest collection error and takes the whole run down. Import the wrapper inside the helper that needs it and skip the vec env tests when ray is present, as the other sb3 tests already do. The GodotEnv reset tests need no sb3 and keep running everywhere.
The seeds were initialised right after self.results, which the step_async PR removes, so the two PRs touched adjacent lines and whichever landed second would no longer merge cleanly. Initialise them where n_parallel is stored instead. No behaviour change.
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.
Two related gaps in seeding.
GodotEnv.resetaccepts a seed and drops it. The reset message is built without it, so gymnasium style reseeding on reset is silently a no op:StableBaselinesGodotEnv.seedraisesNotImplementedError. sb3 callsenv.seed()when an algorithm is built with a seed, soPPO(..., seed=0)on a godot env crashes rather than training.resetnow sends the seed with the reset message, and the wrapper latches one seed per parallel game using the sameseed + poffsets the constructor already uses, applied on the next reset and cleared afterwards, which is how sb3's own vec envs behave.The wire change is additive. The current plugin reads only
message["type"]in its reset handler and ignores extra keys, so this is safe against existing games. For the seed to actually take effect in game, that handler insync.gdneeds to read it, which is a three line change in godot_rl_agents_plugin. I am happy to open that PR as well if you want to take this.Related to #124, which covered the same area on the Godot side.