|
|
||
|---|---|---|
| .. | ||
| custom_01_2048 | ||
| custom_02_sokoban | ||
| custom_03_candy_crush | ||
| custom_04_tetris | ||
| custom_05_doom | ||
| custom_06_pokemon_red | ||
| retro_01_super_mario_bros | ||
| retro_02_ace_attorney | ||
| retro_03_1942 | ||
| zoo_01_tictactoe | ||
| zoo_02_texasholdem | ||
| README.md | ||
| __init__.py | ||
| env_utils.py | ||
| gym_env_adapter.py | ||
README.md
Gaming Envrionments
Build Your Own Envrionments
Gym and Retro Interface
Gymnasium Envrionments
Overview
Currently we support the following envrionments using gym:
- Sokoban
- Tetris
- 2048
- Candy Crush
Step-by-Step Instructions
- Follow instructions from Gymnasium to implement functions and methods for your own game.
- Create a directory following the naming convention
custom_{index}_{game_name}. - Implement
{GameName}Env.pyas a wrapper that (1) initialize and reset envrionments; (2) process action strings from agents and execute them in the environment; (3) generate new observations and output to agents (with images, rgb/ascii strings, textual descriptions and/or symbolic textual representations). - Implement
game_env_config.jsonto pass: a. key env configuration argumentsenv_init_kwargs. b.action_mappingto map action strings generated by agents to executable action index. c.render_mode: eitherhumanfor graphic display or likergborasciistrings. d. other key arguments to determine termination conditions or game settings. - Add your agent configuration to configs so that a gaming agent can interface properly the envrionment.
Retro Envrionments
Overview
Gym Retro is a library that enables classic video game emulation through a wide range of supported systems, providing a standardized interface via Gymnasium.
Currently we support the following envrionments using gym:
- Super Mario Bros 1985
- Ace Attorney: Phoenix Wright
Step-by-Step Instructions (Add Existing games from Retro)
- You need to legally obtain the games files and import them with this instruction:
python3 -m retro.import /path/to/your/ROMs/directory/. - Create a directory following the naming convention
retro_{index}_{game_name}. - Implement
{GameName}Env.pyas a wrapper that (1) initialize and reset envrionments; (2) process action strings from agents and execute them in the environment; (3) generate new observations and output to agents (with images, rgb/ascii strings, textual descriptions and/or symbolic textual representations). - Implement
game_env_config.jsonto pass: a. key env configuration argumentsenv_init_kwargs. b.action_mappingto map action strings generated by agents to executable action representation in Retro. c.render_mode/render_mode_gym_adapter: eitherhumanfor graphic display or likergborasciistrings. d. other key arguments to determine termination conditions or game settings. - Add your agent configuration to configs so that a gaming agent can interface properly the envrionment.
Step-by-Step Instructions (Add new games to Retro)
To integrate additional Retro environments that are not included in stable-retro, follow instructions in Gym Retro. For such games no retro.import is required. Check our ace_attorney implementation as an example.
UI-only Interface
Coming Soon!