Repository navigation
Players come from agentenv-game-env's lobby, and its match grades them - #19
Merged
Merged
Conversation
OpenCiv3's env is an agentenv-game-env game env (AgentEnvGameEnv), to see how game-env generalizes beyond Warcraft III: - The lobby (urn:game:lobby/v1) takes the game's settings (seed, size, difficulty, barbarians, landform, ocean, turn_limit, human_turn_seconds, min_turn_seconds and the broadcast) and a player slot per civilization: an agent's, a person's or the game's AI, each agent or person with its civ (the next free one when it names none; the engine picks the AI's). Closing it creates the game. - An agent plays at its player slot's address, /players/<player_id>/mcp, which add_player_slot gives it: no more X-OpenCiv3-Seat header, in the env or the player agents. A person's slot gets its play token as the slot's secret headers (@player_slot_headers), which add_player_slot puts in the page link's fragment, and the play page reads. - The match (urn:game:match/v1) reports the turns, each player's outcome by the game's own rules (a defeated civ has lost; a conquest, domination, culture or score victory is its civ's, every other player's a loss, an AI civ's included; a tie on top at the turn limit is no one's), scores (score, cities, population, techs) and moves (turns a player ended itself, and those the env ended for it). finish_match plays a match out, ending every player's turn. - The match's files are its recording by kind (map_video, html_replay, last_turn, client_video); its spectator view is /live. - The broadcast stays OpenCiv3's own, now a lobby setting; the env fetches banner logos (https URLs or data: URIs) as the lobby closes. The ten multi-agent tasks and human-vs-ai use open_lobby, add_player_slot, close_lobby, finish_match (await_match for a person's game), grade_match with max_missed 0.1 (the victor verifier's sat-out rule) and save_match_files. The victor verifier, and the openciv3_match and openciv3_await_game steps, are gone. new-game keeps the default game, one civilization at the env's own address, for smoke, play and full-game, which keep their baseline verifiers and save_env_recording. The env image installs game-env from the archive pyproject.toml pins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lane README, docs (play, tools, protocol, recording, viewer), the bundle's README and the playtest README describe the lobby, player slots, the match and grade_match in place of openciv3_match, the seat header and the victor verifier. playtest/bots.py starts its matches through the lobby and plays each seat at its player slot's address. data/reset and data/add start a default game after a lobby game, without the lobby's keys, as new-game does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
force-pushed
the
feat/game-env
branch
from
October 12, 2026 01:30
f99d0a1 to
41eaa25
Compare
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.
Stacked on #18: merge that first.
OpenCiv3's env becomes an agentenv-game-env game env. This tests how well game-env generalizes beyond Warcraft III: OpenCiv3 is turn-based, has many players and has human players.
What changes
The lobby says who plays.
urn:game:lobby/v1takes:seed,size,difficulty,barbarians,landform,ocean,turn_limit,human_turn_seconds,min_turn_secondsandbroadcast;An agent's or person's slot takes a
civ, and the next free one is used when it names none. The engine picks the AI's civs. Closing the lobby creates the game.Routing by address, not header. An agent plays at
/players/<player_id>/mcp, whichadd_player_slotregisters with it.X-OpenCiv3-Seatis gone from the env and from the player agents. In a lobby game, the env's own/mcpplays no one.A person's token is the slot's secret. It is passed through game-env 0.6.0's new
@player_slot_headershook.add_player_slotputs it in the page link's fragment, and the play page reads it from there.The match (
urn:game:match/v1) reports:Outcome rules:
Finishing and files.
finish_matchplays a match out by ending every remaining player's turn. The match keeps its recording as files, by kind:map_video,html_replay,last_turnandclient_video. Its spectator view is/live.Tasks.
human-vs-aiuseopen_lobby,add_player_slot,close_lobby,finish_match(withawait_matchfirst in a person's game),grade_matchandsave_match_files.grade_matchusesmax_missed: 0.1, the victor verifier's rule for an agent that sat out.human-vs-agentsgrades the person in a second step, without the gate.Removed: the
openciv3_matchandopenciv3_await_gamesteps and the victor verifier.Kept on the default game:
new-gamekeeps the single-civilization default game.smoke,playandfull-gamestay on it, with their baseline verifiers andsave_env_recording.Broadcast. It stays OpenCiv3's own, now set through the lobby, and
agent-env openciv3 streamis unchanged. Banner logos must now behttps://URLs ordata:URIs, which the env fetches as the lobby closes.Image. The env image installs game-env from the archive that
pyproject.tomlpins;setuppasses it in.Behaviour changes to know about
sol-vs-opus, which has three AI civs.Verification
openciv3-port, Claude Haiku 4.5 players). In every run each agent played at its own slot address and the match files were kept.three-agents-quick, 10 turns: each agent ended 10 of 10 turns itself, and both gates passed. At turn 10, two players tied on top, so no one won, and each agent got 0.5.human-vs-ai, 4 turns: a scripted person played through the play page's API.add_player_slotserved the page.await_matchreturned at the end, and the full-game verifier graded it 0.42.showmatch-quick, 6 turns: played withagent-env openciv3 stream --record --offline. The casters commented over the whole game, and the recording is a 32 MB video. Each agent got 0.5 for a three-way tie.playtest/bots.py, 3 seats, 5 turns: 84 tool calls, none failed.Not in this pass
Casters in game-env's broadcast, so Warcraft III gets casters back.
🤖 Generated with Claude Code