This revision adds an interface for training reinforcement learning agents in 0 AD. This also includes a python wrapper for interacting with 0 AD including setting scenarios and controlling players in lock step.
The revision was originally written using gRPC but has since been updated to use mongoose (greatly simplifying the build process - thanks, @wraitii!).
An example using this to train RL agents with a variety of different state, action spaces can be found at https://github.com/brollb/simple-0ad-example.
Note: This does not contain an actual OpenAI gym environment as they require a clearly defined action/state space (which it is not obvious what the optimal representation is - or even if there is a single optimal representation). That said, it is easy to create a gym using the code in this revision and there are multiple examples in the beforementioned repository. A longer discussion about this can be found at https://github.com/0ad/0ad/pull/25#pullrequestreview-262056969