Skip to content

Game loop v2: fog of war, war endings, product polish - #1

Open
CarlBarl wants to merge 3 commits into
mainfrom
feature/game-loop-v2
Open

Game loop v2: fog of war, war endings, product polish#1
CarlBarl wants to merge 3 commits into
mainfrom
feature/game-loop-v2

Conversation

@CarlBarl

Copy link
Copy Markdown
Owner

What

  • Fog of war: enemy units only exist for you as contacts your sensors have produced (radar with terrain line-of-sight, satellite passes, HUMINT, ELINT scaled by the SIGINT budget, missile launch plumes, mine strikes). Contacts age into stale last-known fixes; fixed sites stay found. Map, tooltips, unit panel and SITREP only show what the contact quality grants.
  • Wars now end: each nation has war support that drains with losses, war length and economic pain (oil shock for USA, a blocked Hormuz for Iran). The AI sues for peace when support collapses and capitulates at zero. You can offer or accept ceasefire, or resign. Top bar shows war-support meters and an objectives chip; a full debrief screen with stats closes the game and returns to the menu.
  • Iran's AI now retasks its closest Shahed batteries to choke the strait during war.
  • Polish: ASHFALL COMMAND branding, click-an-event-to-fly-there in the feed, auto-pause options, proper lane names.

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

  • 426 unit tests green (85 new), typecheck clean.
  • New Playwright smoke test (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.
  • Preview deploy: https://ashfall-command-1b6pw76t3-calles-projects-77431d99.vercel.app (needs your Vercel login; or npm run build && npx vite preview).

CarlBarl and others added 3 commits June 10, 2026 21:40
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>
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ashfall-command Ready Ready Preview, Comment Jun 10, 2026 8:15pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant