Geometry Dash RL

11.2025

yolo perception + ppo on live gameplay

PythonPyTorchOpenCVYOLOGymnasiumStable-Baselines3
Notes

A reinforcement learning agent that plays Geometry Dash by looking at the screen. No game API, no memory reading. It captures frames, detects what is in them, and presses a key.

Perception

A YOLO model detects the player and the spikes in each raw frame. Those detections get folded into an 84-dimensional state vector that feeds both imitation learning and PPO. Going through an object detector instead of raw pixels made the state small enough to learn from on one machine.

Mid-episode. The detector has the player, a spike and the ground block, and the overlay carries step, action, reward and obstacle count.
Mid-episode. The detector has the player, a spike and the ground block, and the overlay carries step, action, reward and obstacle count.
A death, caught by template match on the end screen. Reward drops to -100 and the episode terminates.
A death, caught by template match on the end screen. Reward drops to -100 and the episode terminates.

The environment is the project

Wrapping a real game in Gymnasium means solving problems the game does not want you to solve. Live screen capture, synthetic key presses, automatic episode resets, and detecting death from a template match on the death screen. Frame-skip tuning mattered more than any hyperparameter in the policy.

← index