This contains an air hockey simulation environment powered by Box2D. It is fast (C++ back-end), capable of self-play, 1v1 play, and easy goal-conditioned reinforcement learning, resulting in a rich testbed for various algorithms.
1v1 Play | Goal-Conditioned RL |
---|---|
![]() |
![]() |
pip install Box2D
pip install opencv-python
pip install stable-baselines3
(required forplay_trained_agent.py
,sb_trainer.py
,sb_eval.py
)
Most of the files use a configuration file (--cfg cmd argument), but is defaulted to one from configs/
. Please see there to tune parameters for various scripts.
airhockey2d.py
: base gym environment for air hockeyrender.py
: renders the air hockey environmentdemonstrate.py
: user plays a self-play air hockey environment using keyboardsb_trainer.py
: trains an agent using self-play via stable-baselines3 PPO.sb_eval.py
: run after training, this shows training evaluation plots and plays a live rendering of the trained agent playing via self-play.play_trained_agent
: run after training, you can play against the trained agent