dm_control soccer 2v2 self-play with opponent league (EnvPool) - #354
Open
Denys88 wants to merge 1 commit into
Open
dm_control soccer 2v2 self-play with opponent league (EnvPool)#354Denys88 wants to merge 1 commit into
Denys88 wants to merge 1 commit into
Conversation
Adds a multi-agent self-play training setup for EnvPool's dm_control locomotion soccer envs: - rl_games/envs/dmc_soccer_selfplay.py: vecenv adapter exposing each controlled player as an independent actor sharing one policy (egocentric, team-relative obs + within-team one-hot player id), with shaped rewards (asymmetric goal, one-sided ball progress, team-level chase, dense-anneal). - rl_games/envs/dmc_soccer_opponents.py: opponent league for the away team — scripted anchors (chaser/keeper/random/zero) plus frozen past checkpoints of the training policy (lagged self-play), auto-refreshed from the run dir. - rl_games/envs/dmc_soccer_tools.py: match video rendering and a checkpoint round-robin tournament (goal-diff/episode cross table). - config + docs: the validated recipe and the seven failure modes each reward/algo choice prevents (cowardice, dribble-farming, learned helplessness, ball-crowding, single-opponent collapse, proxy plateau, entropy-driven sigma explosion). Validated at 1.64B frames / 50k epochs on laptop CPU (~64k fps end-to-end, zero collapses); final checkpoint beats all scripted anchors and its own mid-training self both home and away. Requires EnvPool soccer envs (Denys88/envpool#1). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Multi-agent self-play training for EnvPool's dm_control locomotion soccer envs (
BoxheadSoccer2v2-v1, from Denys88/envpool#1): one shared PPO policy controls the home team across 256 parallel matches while an 8-type opponent league plays the away team — scripted anchors (chaser, keeper, random, zero) plus frozen past checkpoints of the training policy (lagged self-play), auto-refreshed from the run dir.What's included
rl_games/envs/dmc_soccer_selfplay.py— vecenv adapter: players-as-actors batching (egocentric, team-relative obs + within-team one-hot player id), shaped rewards with dense-annealingrl_games/envs/dmc_soccer_opponents.py— opponent league + a minimalFrozenPolicy(rebuilds the actor from a checkpoint for cheap CPU inference; handles_orig_mod.torch.compile prefixes)rl_games/envs/dmc_soccer_tools.py— match video rendering + checkpoint round-robin tournament (goal-diff/ep cross table)docs/DMC_SOCCER_SELFPLAY.md— the validated recipe, documented as the seven failure modes each choice prevents (each observed and reproduced during tuning):fixed_sigma→ unbounded σ growth melts the policy into noise (fix:entropy_coef: 0)_create_envpool-style lazy import invecenv.py,env_configurations.pyentry)Validation
runner.py --train(3 epochs), tournament, and video render all passDependencies
opencv-pythononly for the video tool (lazy import)🤖 Generated with Claude Code