Google Research Football
EnvPool supports the Google Research Football scenarios listed below under
EnvPool-native IDs of the form gfootball/<scenario>-v1. The runtime path is
pure C++: EnvPool builds and calls the upstream engine directly, and only uses
the upstream Python scenario files at build time to generate a static C++
scenario table. There is no Python-environment bridge in the runtime hot path.
Options
task_id (str): any task listed in Available Tasks;num_envs (int): how many environments to create;batch_size (int): the expected batch size for returned results, default tonum_envs;num_threads (int): the maximum worker count used forenv.step, default tobatch_size;seed (int | Sequence[int]): the environment seed. When a sequence is provided, it must contain exactly one seed per environment. Default to42;max_episode_steps (int): the episode horizon. Each task defaults to the upstream scenario duration, but callers can override it;physics_steps_per_frame (int): physics updates per policy step, default to10.
Rendering is intentionally unsupported for gfootball. The upstream headless
renderer does not produce reliable output across EnvPool’s supported CI
platforms, so render_mode, render_width, and render_height are not
part of the public contract for this environment, and env.render() raises
RuntimeError.
Observation Space
The Gymnasium wrapper exposes a uint8 minimap tensor obs with shape
(72, 96, 4):
channel
0marks left-team players;channel
1marks right-team players;channel
2marks the ball position;channel
3marks the currently controlled left-team player.
The info dict contains:
score:int32[2]with[left_goals, right_goals];game_mode: current upstream game-mode enum value;ball_owned_teamandball_owned_player;steps_leftandelapsed_step;engine_seedandepisode_number.
Rewards follow upstream score-delta semantics: each step returns the change in
left_goals - right_goals since the previous observation.
Action Space
The action space is discrete with 19 actions matching EnvPool’s default Google Research Football action set:
0:idle1:left2:top_left3:top4:top_right5:right6:bottom_right7:bottom8:bottom_left9:long_pass10:high_pass11:short_pass12:shot13:sprint14:release_direction15:release_sprint16:sliding17:dribble18:release_dribble
Available Tasks
gfootball/11_vs_11_competition-v1gfootball/11_vs_11_easy_stochastic-v1gfootball/11_vs_11_hard_stochastic-v1gfootball/11_vs_11_kaggle-v1gfootball/11_vs_11_stochastic-v1gfootball/1_vs_1_easy-v1gfootball/5_vs_5-v1gfootball/academy_3_vs_1_with_keeper-v1gfootball/academy_corner-v1gfootball/academy_counterattack_easy-v1gfootball/academy_counterattack_hard-v1gfootball/academy_empty_goal-v1gfootball/academy_empty_goal_close-v1gfootball/academy_pass_and_shoot_with_keeper-v1gfootball/academy_run_pass_and_shoot_with_keeper-v1gfootball/academy_run_to_score-v1gfootball/academy_run_to_score_with_keeper-v1gfootball/academy_single_goal_versus_lazy-v1
Correctness Tests
The gfootball integration is held to the same no-skip, all-platform standard as the rest of EnvPool’s core environments:
Full registry coverage: every registered
gfootball/*-v1ID is created through the public Gymnasium API, reset, stepped, and closed in CI;Bitwise rollout alignment:
envpool/gfootball/gfootball_align_test.pyruns each registered task to episode completion and checks observations, rewards,terminated/truncated, and the publicinfofields bitwise against an independent oracle that uses the same C++ engine with upstream scenario semantics;Render rejection:
envpool/gfootball/gfootball_render_test.pychecks every registered task rejects bothrender_mode="rgb_array"andrender_mode="human"with a runtime error instead of exposing a known-bad renderer;Determinism:
envpool/gfootball/gfootball_deterministic_test.pyrequires identical seeds and action streams to produce identical rollouts, while a different seed must change the rollout;Cross-platform coverage: the build, render-rejection, alignment, and determinism paths are validated in CI on Linux, macOS, and Windows rather than being skipped on any platform.