Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Dm control Soccer Walker Team Setup

From Leeroopedia
Metadata
Knowledge Sources dm_control
Domains Multi-Agent Reinforcement Learning, Robotics Simulation
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete tool for constructing teams of walker agents in the dm_control multi-agent soccer environment, mapping walker morphology types and team assignments into a flat list of Player namedtuples.

Description

The soccer walker team setup is implemented through three components:

  • WalkerType enum -- An enumeration with three members (BOXHEAD=0, ANT=1, HUMANOID=2) that selects the physical morphology of each agent.
  • _make_walker factory -- A function that instantiates a single walker entity of the chosen type, configuring its name, numeric identifier, and team-coloured marker.
  • _make_players builder -- A function that constructs two teams of equal size, assigning blue (RGBA_BLUE = [.1, .1, .8, 1.]) markers to the home team and red (RGBA_RED = [.8, .1, .1, 1.]) markers to the away team.

The returned list always has 2 * team_size elements, with home players first followed by away players. Each element is a Player namedtuple containing a Team enum value and a walker entity.

Usage

These functions are called internally by soccer.load() but can also be used directly when assembling a custom soccer environment with non-standard pitch or task settings.

Code Reference

Attribute Value
Source Location dm_control/locomotion/soccer/__init__.py, lines 47--84
Signature (WalkerType) class WalkerType(enum.Enum): BOXHEAD = 0; ANT = 1; HUMANOID = 2
Signature (_make_walker) def _make_walker(name, walker_id, marker_rgba, walker_type=WalkerType.BOXHEAD)
Signature (_make_players) def _make_players(team_size, walker_type)
Import from dm_control.locomotion.soccer import WalkerType

I/O Contract

Inputs (_make_walker):

Parameter Type Description
name str Unique name for the walker entity (e.g. "home0").
walker_id int Numeric identifier used by BoxHead and Humanoid walkers for jersey textures.
marker_rgba list[float] RGBA colour array with four elements in [0, 1].
walker_type WalkerType Morphology selector; defaults to WalkerType.BOXHEAD.

Inputs (_make_players):

Parameter Type Description
team_size int Number of players per team (1 to 11).
walker_type WalkerType Morphology selector applied uniformly to all players.

Outputs:

Return Type Description
_make_walker return BoxHead, Ant, or Humanoid A composer walker entity with the given name, id, and colour.
_make_players return list[Player] List of length 2 * team_size. Home players appear first, then away players.

Usage Examples

from dm_control.locomotion import soccer

# Build a 2v2 team of boxhead walkers.
players = soccer._make_players(team_size=2, walker_type=soccer.WalkerType.BOXHEAD)
print(len(players))  # 4

# Inspect team assignments.
for p in players:
    print(p.team, p.walker.name)
# Team.HOME home0
# Team.HOME home1
# Team.AWAY away0
# Team.AWAY away1

# Build a single humanoid walker directly.
walker = soccer._make_walker(
    name="striker",
    walker_id=0,
    marker_rgba=[0.1, 0.1, 0.8, 1.0],
    walker_type=soccer.WalkerType.HUMANOID,
)
print(type(walker))  # <class '...Humanoid'>

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment