Skip to content

[codex] optimization master pass - #15

Draft
QemmHD wants to merge 4 commits into
mainfrom
codex/optimization-master-pass
Draft

[codex] optimization master pass#15
QemmHD wants to merge 4 commits into
mainfrom
codex/optimization-master-pass

Conversation

@QemmHD

@QemmHD QemmHD commented Jun 18, 2026

Copy link
Copy Markdown
Owner

First optimization patch — game-feel focused, not just FPS. All current systems preserved (save/load, movement/pathfinding, economy/factions, gangs, chaos, schedules, doors, AI). No framework switch, no iOS packaging, no gore/unsafe content, no heavy assets or post-processing.

Base note: this branch is cut from the Stage 3.9 manual-combat branch (claude/lockdown-life-3d-game-4ere1s), which isn't on main yet — so this PR's diff vs main includes both the manual combat overhaul and this optimization layer. That's intentional (it brings the playable combat to main and avoids re-doing it).

What changed

Combat (stop the auto-fight / menu feel):

  • Player is no longer auto-driven — a fighter only acts on input; idle does not auto-win, but the NPC AI keeps fighting.
  • Dedicated combat control cluster appears during a fight: Quick Hit / Heavy Hit / Shove / Block / Dodge / Back Off / Call It Off, with cooldown grey-out + active-window highlight.
  • Distance & facing matter: out-of-range swings whiff; lock-on aim; tap-to-move works mid-fight.
  • Clearer feedback: hit numbers, "Shoved!" cue, block/dodge/miss floats, knockdown, guard break-up, impact shake.
  • NPC auto-combat AI preserved; combat stays non-lethal/stylized.

HUD (less debug/prototype look):

  • Alert feed trimmed to 3 lines, wider dedupe (6s), shorter lifetime — fewer, better alerts.
  • Combat HUD is distinct from the normal selected panel (separate cluster; side panel hidden during a fight).
  • Mobile-landscape pass: combat buttons collapse to one reachable row, compact bottom bar, repositioned panel/alerts.

Graphics/theme (safe value tweaks):

  • More directional lighting (lower fill, stronger key) → reads less flat/grey.
  • Cooler, more saturated concrete + brighter wall cap → walls pop off the floor; darker/cooler floor for contrast.

Debug telemetry (?debug sim.metrics): added shoves, combatUIOpens, combatUICloses (alongside existing hits/misses/blocks/dodges/knockdowns/guardInterrupts/playerCombatChoices).

Files changed

  • src/sim/Simulation.ts — manual combat (advancePlayerCombat, range/facing in doStrike, requestCombatAction inputs, combatSnapshot) + shove feedback + metrics.
  • src/core/Game.ts — combat HUD wiring, camera framing/shake, combat UI open/close telemetry.
  • src/ui/HUD.ts — combat cluster (show/update/hide) + alert-feed trim.
  • src/render/IsoCamera.ts — fixed-angle character camera, shake, device-aware fit (from 3.9 base).
  • src/render/VisualTheme.ts — lighting/wall/floor contrast.
  • src/style.css — combat cluster styling + mobile-landscape media query.
  • src/ecs/components.tsdodgeT/farT combat fields.

Checks run

  • npm run typecheck
  • npm run build
  • npm run check
  • Headless smoke (?debug): telemetry increments (shoves, combatUIOpens/Closes), combat HUD renders, 0 runtime errors.

Known limitations

  • Theme pass is a conservative value tweak, not a full art overhaul (intentionally deferred).
  • General (non-combat) HUD panel structure is only lightly cleaned; a full HUD redesign is still pending.
  • Character camera in very tight cell corners can still have minor wall overlap (not gameplay-breaking).
  • No grapples/combos; combat is intentionally simple and non-lethal.

What's next

  • Full world / graphics / layout overhaul (the next major stage).
  • General HUD redesign (top bar, side panel, bottom bar) beyond combat.
  • Optional: audio/ambience pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BxvvEoWQuPRZo3zw2ih5VM


Generated by Claude Code

claude added 4 commits June 17, 2026 20:59
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BxvvEoWQuPRZo3zw2ih5VM
Replace "tap Fight and watch the sim auto-resolve it" with interactive combat.

- Manual combat: the player fighter is no longer driven by the auto phase
  machine (advancePlayerCombat never auto-initiates a swing and never auto-moves).
  Attacks happen only on button press; idle does not auto-win. NPC fighters keep
  the existing AI phase machine.
- Movement: tap-to-move works during combat and no longer ends the fight; the
  foe closes distance via AI. Player swings only land in range (out-of-range
  whiffs, checked in doStrike); knockback/backstep stay path-safe.
- Inputs (requestCombatAction): Quick/Heavy/Shove windups (stamina-gated),
  Block (guard window), Dodge (backstep + i-frames), Back Off (disengage +
  de-escalate), Call It Off (exit combat). Player Block/Dodge windows now
  actually defend in doStrike.
- Dedicated combat HUD cluster (HUD.showCombat/updateCombat/hideCombat): large
  thumb buttons with cooldown/active states + player/foe health+energy bars,
  opponent name/gang/relationship, and a live state read; side panel hidden
  during a fight. combatActive()/combatSnapshot() feed it.
- Camera: frames the midpoint of both fighters in character mode; small impact
  shake on hits (IsoCamera.shake). Brain gains dodgeT/farT.

Verified headless: initiate fight, controls appear, move during fight, in-range
lands / out-of-range misses, block/dodge/backstep/shove work, idle never
auto-swings, NPC still attacks, call-off ends it, save/load mid-fight ok, iso +
character cameras ok, 0 runtime errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BxvvEoWQuPRZo3zw2ih5VM
…ntrast, telemetry

First optimization patch (layered on the Stage 3.9 manual-combat branch; not just FPS —
game-feel focused). All existing systems preserved; save/load, movement/pathfinding,
economy/factions untouched.

Combat (manual mode is in place from 3.9; this patch sharpens feedback + telemetry):
- Shoves now read as a clear "Shoved!" cue instead of a tiny damage number.
- Combat already: player not auto-driven, dedicated control cluster (Quick/Heavy/Shove/
  Block/Dodge/Back Off/Call It Off) with cooldown + active states, distance + facing gating,
  NPC auto-combat preserved, non-lethal/stylized.

HUD:
- Alert feed trimmed to 3 lines, wider dedupe (6s), shorter lifetime — less debug-feed spam.
- Combat HUD stays distinct from the normal selected panel (separate cluster, panel hidden in a fight).
- Mobile-landscape pass: combat buttons collapse to a single reachable row, compact bottom bar,
  repositioned panel/alerts (orientation+max-height media query).

Theme (safe value tweaks, no heavy assets / no post-processing):
- More directional lighting (lower fill, stronger key) so it reads less flat/grey.
- Cooler, slightly more saturated concrete + brighter wall cap → walls pop off the floor.
- Darker/cooler floor base for contrast.

Telemetry (?debug sim.metrics): added shoves, combatUIOpens, combatUICloses (joining existing
hits/misses/blocks/dodges/knockdowns/guardInterrupts/playerCombatChoices).

Checks: npm run typecheck, npm run build, npm run check — all pass. Headless smoke: telemetry
increments, combat HUD renders, 0 runtime errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BxvvEoWQuPRZo3zw2ih5VM
…g, cells, HUD polish

Second patch on the optimization PR. Visual-first; no sim changes beyond render.
All systems verified intact (selfTest: noEntityInWall/roomsReachable/anchorsReachable/
diningClearsCounter all true; manual combat unaffected). 0 runtime errors.

Materials/textures:
- Concrete: mottled pour tone, form-board panel seams + tie-rod holes, vertical water
  streaking, anisotropy — reads as cast concrete, not flat fill.
- New createMetalTexture (brushed steel + scratches + rust freckles); applied to the
  shared metal/steel/bars/locker materials.

World readability / grounding:
- Walls gain a dark scuffed baseboard kick-plate + a chamfered top cap (intentional, not
  a white strip), plus a soft fake-AO plane under every wall tile so rooms stop looking
  like floating gray boxes.
- Per-room floors keep their distinct tints/tiling.

Cells:
- Heavier 3-rail prison bars (PropRenderer barRun + Game cell-gate leaf); stencilled
  cell-number plates above each door gap so each cell reads individually. Green/red door
  lamps already present.

Lighting/atmosphere:
- Cool rim/back light + faint warm bounce in ThreeApp for character/background separation
  and depth; lower fill + stronger key in VisualTheme (less flat grey). No post-processing.

HUD polish (not a rewrite):
- Premium card styling for panel/topbar/combat cluster (gradients, borders, shadows, blur),
  nicer bottom buttons with press states, cleaner chips/alerts.

Checks: npm run typecheck, npm run build, npm run check — all pass. Browser smoke: 6
screenshots captured, selfTest green, 0 runtime errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BxvvEoWQuPRZo3zw2ih5VM

QemmHD commented Jun 18, 2026

Copy link
Copy Markdown
Owner Author

Patch 2 — visual / art overhaul pass (commit 3c85307)

Stacked on top of the combat/HUD optimization. Visual-first; no sim logic changes beyond rendering. All systems verified intact and 0 runtime errors.

Materials/textures

  • Concrete reworked: mottled pour tone, form-board panel seams + tie-rod holes, vertical water streaking, anisotropy — reads as cast concrete, not flat fill.
  • New createMetalTexture (brushed steel + scratches + rust freckles) applied to shared metal/steel/bars/locker materials.

World grounding / readability

  • Walls gain a dark scuffed baseboard kick-plate + chamfered top cap, plus a soft fake-AO plane under every wall tile — rooms no longer look like floating gray boxes.

Cells

  • Heavier 3-rail prison bars (static fronts + the swinging gate leaf) and stencilled cell-number plates above each door so each cell reads individually (green/red door lamps already present).

Lighting/atmosphere

  • Cool rim/back light + faint warm bounce for character/background separation and depth; lower fill + stronger key (less flat grey). No post-processing.

HUD polish (not a rewrite)

  • Premium card styling for panel / top bar / combat cluster (gradients, borders, shadows, blur), nicer bottom buttons with press states, cleaner chips/alerts.

Files: render/textures/createConcreteTexture.ts, render/textures/createMetalTexture.ts (new), render/WorldRenderer.ts, render/ThreeApp.ts, render/PropRenderer.ts, render/VisualTheme.ts, core/Game.ts, style.css.

Checks: typecheck ✅ · build ✅ · check ✅ · browser smoke: selfTest green (noEntityInWall/roomsReachable/anchorsReachable/diningClearsCounter all true), 0 runtime errors.

Known limitations / next: still a value/detail pass, not the full world/layout rebuild (that remains the next major stage); character meshes largely unchanged (already had outlines/contact shadows). Still a draft — not merging yet.


Generated by Claude Code

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.

2 participants