soccer-rl
AI model for 6v6 soccer with first-person vision
2 min read
A research reinforcement learning (RL) model for a soccer simulator where each virtual player relies solely on a first-person camera feed. The agents have no access to field coordinates and no voice communication channel: to locate the ball and teammates, the model turns the character's head on its own. All 12 players (5 outfield players and a goalkeeper per team) use the same compact 5.1M-parameter minGRU recurrent network created by author tonychenxyz. Ideal for multi-agent reinforcement learning (MARL) researchers and game bot developers working with limited perception.
Key features
- Pure pixel vision: The player's camera features four nested fields of view, ranging from a wide 120-degree angle to a narrow 4-degree central zone (fovea).
- Complete autonomy: During matches in the MuJoCo-Warp environment, players do not exchange data and cannot see the simulator's hidden state.
- Two-stage training: The network first learned to imitate a "teacher" model with full field visibility, then underwent fine-tuning via PPO in matches against itself and a league of 24 previous versions.
- Compact size: The PyTorch checkpoint weighs just 72 MB and contains actor weights, critic weights, and observation statistics.
What you can do
- Study emergent team play: Analyze how bots independently learn to pass (averaging 3.45 accurate passes per match) even though rewards are based solely on goal differential.
- Test visual RL algorithms: Use the checkpoint and repository code as a baseline environment for experiments with attention, memory, and multi-agent interaction in MuJoCo-Warp.
Example
from huggingface_hub import hf_hub_download
import torch
path = hf_hub_download("tonychenxyz/soccer-rl", "vision111p25a/ckpt.pt")
ckpt = torch.load(path, weights_only=False)
Read more
DetailsBenchmarks (5-minute 6v6 matches): +3.70 goals per game against the built-in scripted bot (256 games) and +0.67 goals against the previous best checkpoint (69 wins, 22 draws, 37 losses).
Architecture: minGRU recurrent actor (2 layers, width 512, 5.1M parameters).
Limitations: The checkpoint is custom-built specifically for the MuJoCo-Warp simulator (50.4 x 32.6 m field) and is not designed for transfer to other environments; in self-play matches, the ball still frequently changes possession between teams.










Comments