Game loop v2: fog of war, war endings, product polish - #1
Open
CarlBarl wants to merge 3 commits into
Open
Conversation
Design in docs/plans/game-loop-v2.md. Adds the type contracts (VisibilityLevel/Contact, WarStatus, GameOverReport/WarStats, ObjectiveStatus, ViewUnit.visibility/stale, GameViewState warSupport/gameOver/objectives, OFFER_CEASEFIRE/RESIGN commands, ceasefire and war-support events), stub systems visibility.ts and war-support.ts, and the engine wiring: tick calls, command cases, visibility-aware snapshot scrubbing in toViewUnit, save/load fields, system resets. Stubs preserve current behavior (everything identified, support stays 100): tsc clean, 341 tests green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fog of war (engine + UI): per-nation contact model (unseen/detected/ tracked/identified) fed by radar coverage with terrain LOS, satellite passes, HUMINT, ELINT scaled by the SIGINT budget, launch plumes and mine contacts; contacts decay to last-known fixes, fixed sites pin once found. Snapshots scrub enemy data by contact quality; the map renders dimmed tracks, desaturated "?" contacts and hollow contact rings; tooltips, unit panel and SITREP show only what the contact level grants (enemy inventory bars replaced with contact estimates). War termination: war support (political will) drains from losses, duration, depleted reserves, oil shock (USA) and a blocked Hormuz (Iran); capitulation at zero ends the war, low support makes the AI sue for peace and stand down; player can offer/accept ceasefire or resign. Objectives per side (Hormuz, strategic forces, fleet) shown in a TopBar chip; war support bars in the TopBar; full-screen debrief with stats (losses, missiles, interceptions, oil peak, duration) and main-menu return. Iran AI now tasks its closest Shahed batteries with shipping interdiction while at war. Product polish: ASHFALL COMMAND branding, click-to-zoom event feed, auto-pause options (war declared / own unit lost / ceasefire offered), lane display names, feed entries for the new war events. 426 tests green (85 new), tsc clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drives the production build through scenario launch, fog-of-war SITREP, war declaration, ceasefire/objectives UI, resign and debrief, main-menu return; fails on console errors. Run: npx vite preview --port 4173, then node scripts/e2e-smoke.mjs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
Why
The sim could not be won, lost or even ended, and the whole intel layer (satellites, spies, sensors) changed nothing the player saw. These two systems make it an actual game.
Verification
scripts/e2e-smoke.mjs) drives the real production build through launch, fog-of-war SITREP, war, ceasefire/objectives UI, resign, debrief and back to the menu, failing on any console error. Passes.npm run build && npx vite preview).