facebookresearch / ELF

An End-To-End, Lightweight and Flexible Platform for Game Research
Other
2.09k stars 285 forks source link

Minimum working example for the RTS game with an RL lifecycle? #138

Open douglasrizzo opened 4 years ago

douglasrizzo commented 4 years ago

I am having quite a bit of trouble trying to create a minimum working example for the RTS game, in which I can get a single state, visualize its variables and pass an action back to the environment.

I took a look at the Basic Usage section of the README.md, but it looks like the code is not supposed to be used, just interpreted as pseudocode. For example, I don't know where functions such as Init() come from, or what is the type and attributes of the context variable.

I then took a look at train.py and eval.py, which use the RTS, but the code is highly abstracted and everything is passed as dictionaries, whose values don't seem to have an explicit documentation. Also, these scripts don't show how a user can get a state and return an action to the environment (or how to work with batches).

The closest I came to an answer was the documentation of the Python wrapper. The page explicitly mentions variables with names such as ["s", "pi", "r", "a"], which I believe are states, rewards, actions and policies, but there is not a full example depicting how to get to these values, only code excerpts which must be pieced together and make no sense on their own.

I believe the project could benefit greatly from a documented minimum working example guiding users on creating their own agent. Maybe create a random agent for the RTS game, which others can then replace for their own agents.

I would like to add that I was able to compile the project and run the train and eval examples both on CPU and GPU, on Python 3.7 under Linux. My frustration comes from being unable to customize anything.

douglasrizzo commented 4 years ago

I see that someone already mentioned the same troubles I am having in #16 and https://github.com/facebookresearch/ELF/issues/18#issuecomment-315546549. Since they were able to execute the RTS using the Python wrapper, I will try and take a look at their code for now.