Repository navigation
Conversation
Match telemetry: the game record now carries every human player's team for all team games, not only matchmade ones. Teams in public and private Duos/Trios/Quads, numbered-team and Humans vs Nations games are decided inside the simulation, so the record never knew them. createPartialGameRecord now runs the simulation's own team assignment on its exact inputs (players in start order, the clan tags and friends the clients simulated with, the nation count the game creates) and stores the result in a new optional PlayerRecord.team (the in-game team name). It is record-only: teamIndex stays the matchmade pin that replays feed back into the simulation, and nothing new goes on the binary start message. nationCountForGame (engine-lib) predicts createNationsForGame's count so the server can size teams like the game does; getCompactMapNationCount moves to engine-lib with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe change adds shared nation-selection and human-team assignment helpers. Nation creation uses the shared selection rules. Partial game records can include assigned player teams, derived from game setup and simulated player values. ChangesNation Assignment Recording
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant createPartialGameRecord
participant withRecordedTeams
participant simulatedPlayers
participant nationCountForGame
participant humanTeams
createPartialGameRecord->>withRecordedTeams: player records and game start information
withRecordedTeams->>simulatedPlayers: simulate player values
simulatedPlayers-->>withRecordedTeams: players in start order
withRecordedTeams->>nationCountForGame: game configuration and manifest nation count
nationCountForGame-->>withRecordedTeams: nation count
withRecordedTeams->>humanTeams: humans, team configuration, and nation count
humanTeams-->>withRecordedTeams: assigned teams
withRecordedTeams-->>createPartialGameRecord: player records with assigned teams
Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
🤖 Claude Code ReviewVerdict: No issues found. Findings: 0 critical, 0 high, 0 medium, 0 low. I checked for bugs and CLAUDE.md compliance, including:
|
|
Looks good overall. The inputs match what the simulation gets (start-info players in order, with the same clan tag/friend blanking), `teamIndex` stays untouched so replays are safe, and the RecordedTeams test checks against real games' `player.team()`, which is the right check. Two things before merging:
|
createNationsForGame now picks its nations through nationPickForGame (engine-lib), and nationCountForGame reads its count from the same pick, so the rules live in one place and the test that kept two copies in step goes. The pick is none, every manifest nation in order, or a random draw of a count. The compact-map case was already the same draw as a random pick of a count within the manifest, so every config still gets the same nations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 Claude Code ReviewReviewed range: Verdict: No issues found. Findings: 0 critical, 0 high, 0 medium, 0 low. I checked for bugs and CLAUDE.md compliance, including:
|
🤖 Claude Code ReviewReviewed range: Verdict: No issues found. Findings: 0 high, 0 medium, 0 low. The only new commit, Checked for bugs and CLAUDE.md compliance. |
|
(Merged main to get CI green [apart from Milestone]. After the stack of #6074 landed.) |
What
Game records now say which team every human player was on, in every team game. Before, only matchmade games had this, through
teamIndex. This is match telemetry: the record now shows who played with whom.Why the record didn't have it
Public and private Duos/Trios/Quads, numbered-team and Humans vs Nations games get their teams inside the simulation (
assignTeams, called fromGameImpl.addPlayers). The server never ran that step, so the record never learned the result.How
createPartialGameRecordnow runs the simulation's own team assignment on the same inputs the game uses:toWireGameStartInfo)PlayerRecord.team, holding the in-game team name ("Red","Team 12","Humans"…). The same naming is used inwinner: ["team", …].teamIndexis left alone on purpose. It is a simulation input: replays read it back and pin players to that slot. Setting it for every player would change the order players are added in clan games, so replays would desync.teamexists only in the record and is never fed back in.nationPickForGame).createNationsForGamebuilds the nations from that pick, and the record counts them withnationCountForGame, so there is one copy of the rules. Every config still gets the same nations: the compact-map case was already the same draw as a random pick.Can the recorded team differ from the in-game one?
No. Every input is fixed once the start info is built: who plays, their order, clan tags, friends and the config. Late joins, leaves and kicks after that point don't change the start info. Clan overflow players that the server turns into spectators before the start aren't in the player list at all. The simulation can still kick an overflow player itself. That player gets no
team, just as they get no in-game team.teamis left out:Example record (Private Duos on World, a clan pair and a friend pair)
Before:
After:
(This output comes from
createPartialGameRecord. World has 72 nations, so Duos gives 38 numbered teams.)Wire / storage
teamis a plain optional string onPlayerRecordSchema, soGameRecordSchemaandArchivedAnalyticsRecordSchemaread old and new records alike.WirePlayerSchema, so the binary (zbin) start message is byte-for-byte unchanged.team. Until then the field is dropped quietly, with no error.Tests
tests/RecordedTeams.test.tsbuilds real games the way clients do (createGameRunner: start info → blanking →createNationsForGamewith the real World manifest →createGameviatests/util/Setup.ts). For each player it comparesplayer.team()with the recordedteam. Cases covered:TeamAssignment.test.tsgains unit tests forhumanTeams.npm run typecheckandnpm run lintare clean. Innpm test, everything passes excepttests/UpdateRegister.test.ts, which can't run on my machine becausejqisn't installed. That test coversupdate.sh, which this PR doesn't touch.No UI change, so no screenshots.
🤖 Generated with Claude Code