-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Unable to retrieve "sticky_actions" when executing the game with built-in AIs #42
Comments
Built-in AI (who plays when you specify empty string as a player) does not get "observations" in the usual sense and does not use "actions". So you cannot extract that. |
Ok, I see. Thanks for your reply What I am trying to do is extract clips from the game, together with a log of the actions that the players are executing (those defined as sticky but also the others). For what concerns the clips generation I have successfully extracted them by taking the football/gfootball/env/football_env_core.py Line 192 in 0f09bcb
On the other hand, I have seen that by adding
I should be able to expose "non-sticky actions" via the observation struct.
What I am wondering now is whether the game played by |
Some of the possible actions are sticky, which means that they can be active for some time after execution (e.g. until cancellation) - such an action is for example What you could do to register actions, is to inject some code to FootballEnv, where is the code to gather the actions and get observations; see here: https://github.com/google-research/football/blob/master/gfootball/env/football_env.py#L122 As for the last question, the game itself is not deterministic in the standard scenarios, so you would get some variation from there; however bots (defined in bot.py) are very simple and deterministic. You can see for yourself by using play_game script with bots players as bot and watching some games. |
Actually, I should've mentioned one more thing. When you run play_game script, dumps are written after episodes (these are pickled observations, debug info etc). |
Marking this issues as closed, please reopen if some more clarification / followup is needed. |
Hi @zajaczajac
Thank you for the reply on #40 , that worked.
Now, I am trying to extract some information about the players, specifically the sticky_actions.
If I run the command you suggested above MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 python3 -m gfootball.play_game --home_players= --away_players= the game works but no information about the players actions is exposed (not even internally in the source code, from what I can see) since there is no active player in any team.
How can I specify the built-in AI in the --home_team= and --away_team= arguments when I run the game?
The text was updated successfully, but these errors were encountered: