Jump to content

Logging Game States During Replay


Recommended Posts

Especially when using machine learning in 0 AD, it is really valuable to be able to record game states as this enables things like off-policy reinforcement learning, imitation learning, and facilitates quantitative analysis of gameplay. That said, it would be great if we could "expand" a 0 AD replay into a log of state, action pairs which could then be used for the beforementioned tasks. I am imagining a command line flag for logging state, action pairs when running an existing replay.

Currently, I have implemented a primitive approach to this [here](https://github.com/brollb/0ad/pull/1) which simply prints states to stdout. Although this is not the ideal interface, it has enabled me to wrap the game with a script to reconstruct the states with the actions from the commands.txt file. If anyone is interested in trying it out, there is also a docker image for the branch on GitHub which I have used to "extract" the rich game states from a replay.

I am interested in cleaning it up and adding this capability back to 0 AD but thought I would start here to get feedback and input from the community!

Edited by irishninja
Cleared up some ambiguous phrasing and expanded on the existing primitive approach
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

5 minutes ago, irishninja said:

That said, it would be great if we could "expand" a 0 AD replay into a log of state, action pairs which could then be used for the beforementioned tasks (behind a command line flag, of course).

Using an elaborate enough data visualization, it might be possible to also give interesting data to players watching the game in replay mode ;) 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...