Design a small grid game of your own — collect keys and reach the door, avoid moving guards, or push a box onto a target — as a Gymnasium environment, then train a Q-learning agent to play it and watch it improve.
Project idea · ungraded
Grid Game Agent
You will use
Milestones
Build the smallest working version first. Ticks are saved in this browser only.
Stretch goals
- Make the game stochastic (slippery moves, random guards) and compare again.
- Replace the table with a small neural network (deep Q-learning) for a larger grid.
- Record and replay an episode as an animated GIF.
Data
No data is needed: the agent learns from playing your game. See the FrozenLake documentation for a text-based environment to imitate.
Run it yourself
pip install gymnasium numpy matplotlib
python train_agent.py