Migrate babysnake to retro_gamer's observation_function

BabySnake's tabular Q-learning exercise needs a small discrete state,
not the flattened board encoding retro_gamer normally produces. Define
get_state(game) in babysnake_env.py, returning a plain
(agent_x, agent_y, food_x, food_y) tuple, and point babysnake's
observation_function at it instead of declaring a character_set.
Disable the on-screen state overlay so it doesn't clutter the
terminal watch view.
This commit is contained in:
Chris Proctor
2026-06-24 07:50:20 -04:00
parent 3d42de7b12
commit 7788e34ebd
3 changed files with 15 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
[tool.retro-gamer]
actions = ["KEY_RIGHT", "KEY_UP", "KEY_LEFT", "KEY_DOWN"]
reward = "reward"
character_set = ["@", "*"]
observation_function = "babysnake_env:get_state"