Repository navigation
Game over is the game's: a seat knocked out no longer ends it for the casters, the viewer and the play page - #15
Merged
Conversation
… casters, the viewer and the play page The bridge's per-seat game_over includes that seat's own defeat, and the env took any seat's as the game's: the live data, the play page's status and data/get's summary said game over at the first elimination. In the sol-vs-opus broadcast the casters signed off a turn before the conquest and called it a win on score; with three or more agents the outro would come mid-game, and openciv3_await_game would stop waiting if the first seat fell. One _game_over now serves all three: over at a victory or the turn limit (which a seat still in the game reports), or once every seat is defeated. Co-Authored-By: Claude Opus 5.5 <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.
The bug
A seat's state has its own
game_over, which the bridge sets once that seat is defeated (GameOver => human.defeated || turn >= turnLimit || victory != null, per seat). The env took any seat'sgame_overas the whole game's, in three places:/live/data.json,live.game_over): the casters and the viewer's director read it./play/api/statusand the play view.game_over: it was the first seat's, andopenciv3_await_gamereads it.What it did:
sol-vs-opusbroadcast, Sol lost its last city, and the casters signed off at turn 155 calling it "a win on score". The conquest victory was only recorded at turn 156.openciv3_await_gamewould stop waiting if the first seat fell.The fix
One
_game_over()serves all three places. The game is over:A defeated seat's own
defeatedand its tool replies are unchanged: the game is still over for that agent.docs/tools.mdsays data/get'sgame_overandvictoryare the game's, not the first seat's, anddocs/viewer.mdnotes thatlive.game_overmeans over for every seat.Tests
tests/env/test_seats.py): with three seats, Egypt disbands its units and is defeated, while Rome and Greece play on. The live data,_game_over()and data/get say the game goes on, and Rome's brief moves to T1.mainthe live data says it is over (assert (True, None, 1) == (False, None, 1)).🤖 Generated with Claude Code