[codex] optimization master pass - #15
Conversation
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
Patch 2 — visual / art overhaul pass (commit
|
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.
What changed
Combat (stop the auto-fight / menu feel):
HUD (less debug/prototype look):
Graphics/theme (safe value tweaks):
Debug telemetry (
?debugsim.metrics): addedshoves,combatUIOpens,combatUICloses(alongside existinghits/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.ts—dodgeT/farTcombat fields.Checks run
npm run typecheck✅npm run build✅npm run check✅?debug): telemetry increments (shoves,combatUIOpens/Closes), combat HUD renders, 0 runtime errors.Known limitations
What's next
🤖 Generated with Claude Code
https://claude.ai/code/session_01BxvvEoWQuPRZo3zw2ih5VM
Generated by Claude Code