Git Product home page Git Product logo

Comments (5)

michalzajac-ml avatar michalzajac-ml commented on June 21, 2024

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.
However if you specify any other player, like "bot" (for this you need fix from #40), then you can extract that information.
Does it answer your question?

from football.

alexander3605 avatar alexander3605 commented on June 21, 2024

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 frame from here

frame = self._env.get_frame()

On the other hand, I have seen that by adding sticky=True to the definitions of the CoreActions, strating here

core_action_idle = CoreAction(e_BackendAction.idle, "idle")

I should be able to expose "non-sticky actions" via the observation struct.

What I am wondering now is whether the game played by bots is varied enough or whether it will give often similar games.

from football.

michalzajac-ml avatar michalzajac-ml commented on June 21, 2024

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 game_left. See also README. So I guess you don't want to change some actions to being or not being sticky.

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.

from football.

michalzajac-ml avatar michalzajac-ml commented on June 21, 2024

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).
When you unpickle such a file, for every timestep you have a dictionary d, and in it you can access d['debug']['action'].
By default, dumps are written to tmp/dumps.

from football.

qstanczyk avatar qstanczyk commented on June 21, 2024

Marking this issues as closed, please reopen if some more clarification / followup is needed.

from football.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.