GamingAgent/gamingagent/envs
xiaoxue 31922be95e 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
..
custom_01_2048 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
custom_02_sokoban 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
custom_03_candy_crush 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
custom_04_tetris 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
custom_05_doom 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
custom_06_pokemon_red 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
retro_01_super_mario_bros 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
retro_02_ace_attorney 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
retro_03_1942 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
zoo_01_tictactoe 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
zoo_02_texasholdem 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
README.md 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
__init__.py 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
env_utils.py 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00
gym_env_adapter.py 同步完整源码 - 2026-05-25 2026-05-25 01:45:53 +08:00

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

  1. Follow instructions from Gymnasium to implement functions and methods for your own game.
  2. Create a directory following the naming convention custom_{index}_{game_name}.
  3. Implement {GameName}Env.py as 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).
  4. Implement game_env_config.json to pass: a. key env configuration arguments env_init_kwargs. b. action_mapping to map action strings generated by agents to executable action index. c. render_mode: either human for graphic display or like rgb or ascii strings. d. other key arguments to determine termination conditions or game settings.
  5. 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)

  1. You need to legally obtain the games files and import them with this instruction: python3 -m retro.import /path/to/your/ROMs/directory/.
  2. Create a directory following the naming convention retro_{index}_{game_name}.
  3. Implement {GameName}Env.py as 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).
  4. Implement game_env_config.json to pass: a. key env configuration arguments env_init_kwargs. b. action_mapping to map action strings generated by agents to executable action representation in Retro. c. render_mode/render_mode_gym_adapter: either human for graphic display or like rgb or ascii strings. d. other key arguments to determine termination conditions or game settings.
  5. 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!