How to set up custom states - legokor/reinforcement_learning GitHub Wiki
The retro environment comes with a GUI tool that lets you inspect and modify the game's memory, and save/load game states. This section will give you a brief overview of the latter.
Installation
You'll have to install gym retro from source. Clone/download the repository, and make sure you have cmake
installed. Run the following commands in your favorite shell:
$ sudo apt install capnproto libcapnp-dev libqt5opengl5-dev qtbase5-dev
$ cmake -DBUILD_UI=ON -UPYLIB_DIRECTORY .
$ make -j$(grep -c ^processor /proc/cpuinfo)
Starting a game
To start the integration tool, run ./gym-retro-integration
.
Hit Ctrl + O
and open the game ROM. You should see a huge SEGA logo on your screen.
To set up what keys correspond to what controls ingame, go to Window -> Control
.
Pressing the START
key on the blue-thunder-like-background-stuff should take you to the main menu. Pressing the 2nd player's START
key during character selection should allow you to control both characters in the upcoming match.
Saving the state
You can save the current state whenever you feel like. To do so just press Ctrl + S
. Tipically you'd want to do this right after the red "FIGHT" text disappears and you can actually control the character(s).
Loading the state
You can load previously saved states by passing the location of the files to retro.make
(see the example codes).