Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 has no way to seed the env #63

Open
benjamincburns opened this issue Sep 13, 2023 · 2 comments
Open

V2 has no way to seed the env #63

benjamincburns opened this issue Sep 13, 2023 · 2 comments

Comments

@benjamincburns
Copy link

In v2 there's no mention of seed in the RLGym class. FWIW, PettingZoo passes it as an optional arg to the reset function.

I'm also seeing two sources of randomness in the code so far. IIRC RocketSim also supports seeding its prng, so you'll likely want to support that.

Current use of PRNG in this code:

@lucas-emery
Copy link
Owner

I'm not sure if it makes sense to add a seed to the api if rlgym itself doesn't use anything random. I'm more inclined towards these compatibility things being handled by the specific wrapper if necessary (PettingZoo in this particular case) since the randomness would come from the state mutator or the transition engine.

I don't think PettingZoo has the best api, it inherited a lot of stuff from Gym that is not that good. For instance, a seed value may not be enough to deterministically set an environment, in rlgym v2 we're aiming more towards snapshots for that which also can contain config object metadata. This approach is more transparent to the user since you don't have to handle a seed value explicitly

@benjamincburns
Copy link
Author

Per my original comment, there are already two uses of randomness in the RLGym source code (although one does appear to be dead code), and the RocketSim Arena can be seeded as well. I believe in the case of RLGym, the RocketSim seed would only impact demo spawns, but you'd need to check with @ZealanL for that.

Regarding snapshots, I'm not sure if RocketSim exposes the internal state of the prng that it uses.

Is it your expectation that snapshotting will be the primary mechanism for ensuring determinism, or will it be the only method? Or put differently, will it still be possible to pass a prng seed through to RocketSim or other future envs that make use of seeding to ensure determinism? So long as it's possible and not super cumbersome/inefficient to do so in the context of a PettingZoo wrapper, I'm happy with whatever semantics you decide on for the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants