Commit Graph

17 Commits

Author SHA1 Message Date
Brian Fertig 6b00371bdf feat(masterofvega): add ship commander videos, detail pop-over, and turn report
Introduce looping commander videos (256×256) alongside ship thumbnails in
the side panel and colony catalogue. Each species×hull combination loads
its officer clip from shipVideos, falling back to portrait video → still →
procedural sheet. A scene-lifetime pool (VegaShipMedia.js) prevents decoder
thrash on every panel rebuild.

Add VegaShipDetail — a full-resolution pop-over (D.detail depth 76) showing
the commander at 256px, hull at 192px, derived stat block, and knapsack
loadout. Opens from both the side panel and colony screen without stacking
through openModal.

Add a "New Turn" popup (VegaTurnReportScreen) that interrupts the player
for notable events (discovery, first contact, diplomacy, eliminations).
Events are classified and sorted by consequence in VegaTurnReport.js.
Logic now emits 'discovered' events when fleets enter unexplored systems.

Update asset manifest to load nested shipVideos, extend verification to
validate shipVideoKey conventions, bump ships sheet to 192px frames, and
document the new art contract.
2026-08-02 15:27:12 -06:00
Brian Fertig 508feea4c9 feat(mastervega): split colony management into full-screen colony view
Move colony management (sliders, build queue, catalogue) from the
system-view modal into a dedicated full-screen colony view
(VegaColonyView.js). The system view now inspects worlds read-only
with a "View Colony" button to open the management screen.

Key changes:
- Add VegaColonyView.js with colony screen, build queue flyout,
  scrolling catalogue, allocation sliders with padlocks, and
  planet-type backdrops
- Add world backdrop artwork support (1920×1080, one per planet type)
  declared in mastervega-artwork.json worldBackgrounds
- Add headless queue helpers to VegaLogic.js: collapseQueue,
  moveQueueRun, colonyBuildRate, queueEtas, enqueueMany
- Fix star map pointer blocking (drags no longer pan map through modal)
- Move ORBIT constant to VegaScreens.js, add D.colony depth layer
- Update docs (build-plan, sprites) and verification suite

The colony screen stacks over the system view without requiring a
second modal, hiding the system layer and pausing the orrery while
open.
2026-08-02 11:49:33 -06:00
Brian Fertig b0efbe3a44 feat(mastervega): add star map command panel and fleet detachment system
Introduce VegaSidePanel, a right-hand command panel with three modes:
star (system summary), fleet (ship count selectors), and order
(distance, ETA, Accept/Cancel). Replaces the inline fleet-order flow
with a callback-driven architecture where the scene owns selection
state and the panel only reads the engine and reports clicks.

Add fleet detachment logic to VegaLogic:
- splitFleet: carve a new idle fleet from an existing one
- sendDetachment: validate against actual stacks, normalize duplicates,
  probe reachability on a copy, and rollback on refusal
- etaTo: compute ETA scoped to the selected detachment (slowest hull
  in the selection, not the whole fleet)

VegaStarMap gains blockPointer (prevent pan/zoom over the panel),
onEmptyClick (dismiss panel by clicking void), and a rotating selection
reticle.

Section 4b adds ~32 verification checks covering ETA accuracy, ship
conservation, out-of-range refusals, duplicate normalization, star-base
immobility, and the idle-fleet merge rule.

Updates mastervega-build-plan.md to document the new panel and
verification section.
2026-08-02 08:38:22 -06:00
Brian Fertig 7f1cfcc982 fix(mastervega): build per-galaxy zoom ladder and eliminate pan slack
- Add VegaZoom.js with Phaser-free zoom ladder builder, verifiable headlessly
- Replace hardcoded ZOOMS array with galaxy-sized ladder anchored so the
  bottom rung exactly covers the viewport
- Remove 160 px of pan slack in clampPan so empty space can never be dragged
  into view
- Key semantic-zoom thresholds (isFarZoom / isNearZoom) to ladder index
  instead of absolute scale, keeping behaviour consistent across galaxy sizes
- Add section 3b to verifyMasterOfVega.js with 163 new checks covering
  ladder coverage, covering-zoom invariant, top-rung reach, and tiny-galaxy
  single-step collapse
2026-08-02 00:18:00 -06:00
Brian Fertig 91f63b76a2 feat: add Master of Vega (Master of Orion clone)
Introduces Master of Vega, a turn-based 4X strategy game built on MOO1 rules with MOO2 conveniences. The implementation features a fully headless, deterministic engine (VegaLogic) with zero Phaser dependencies, enabling complete Node-based verification (809 checks) and reproducible galaxy generation via mulberry32 RNG.

Key features:
- Preset ship hulls with an auto-refitting Mark system and provably monotonic knapsack loadouts.
- Tactical grid combat with banked damage resolution to eliminate first-strike bias.
- Galactic Council diplomacy, stalemate-breaking, and invasion forecasting.
- Drop-in artwork compatibility with procedural stand-ins for all spritesheets.
- Hireable leaders (admin/captain) and colony building queues.

Architecture splits cleanly into headless modules (GalaxyGen, Logic, AI, Combat, Diplomacy, Ships, Leaders) and a render tier (StarMap, SystemView, CombatView, Screens, Nebula, Art, Fx). A comprehensive build plan documents 19 architectural traps discovered and resolved during development.

Registers the game in the registry, asset manifest, preload scene, and soundtrack service. Includes tools/verifyMasterOfVega.js for automated rule validation, art verification, economy balancing, and AI self-play soaking.
2026-08-01 22:17:31 -06:00
Brian Fertig 390dadbc14 feat: add barbarian raiders system with warlord ransoms
Introduce barbarians as a non-diplomatic civ appended to state.civs,
providing escalating pressure that scales with difficulty and target
civ era. Key mechanics:

- Uprisings spawn on explored tiles, capped by a growing population
  limit to keep raids an event rather than a fourth empire
- Era-based pressure curve: raids decay as a civ advances, stopping
  entirely at hard-stop techs (industrialization/conscription/railroad)
- Killing hordes summons a Barbarian Leader with an escort; cornering
  the lone leader triggers a gold ransom scaled by era and difficulty
- Captured cities are either razed (small) or held inert (large)
- Leader expires after a set lifetime if not ransomed

Diplomacy and AI carefully exclude barbarians to prevent three traps:
shared-enemy attitude pollution, permanent war phase pinning, and
government ladder lockout. Pre-feature saves remain compatible.

New assets: optional civilization-barbarians.png sheet (8 frames).
Updated sprites.md and unit tooltips. Comprehensive verification tests
added in verifyCivilization.js.
2026-08-01 18:18:36 -06:00
Brian Fertig 793cb249f9 feat(gootower): add sleeping goo mechanic and redesign levels
feat(zuma): redesign level 7
feat(shift): add 9 new artwork pieces
chore: remove Worms game entirely

- Goo Tower: introduce `asleep` state for pile balls. Asleep balls ignore physics/wandering and cannot be picked up until they gain a clear line of sight to an attached structure. Adds zZzZz visual, editor toggle, auto-play filtering, and logic tests.
- Goo Tower Lvl 9 & Zuma Lvl 7: completely redesigned terrain, ball/pile positions, and pipe placement.
- Shift: register 9 new artwork pieces.
- Worms: remove all source files, assets, verifier, build docs, and game wiring.
2026-07-31 23:37:48 -06:00
Brian Fertig 2268c74918 **feat: add Worms game with full physics, weapons, and procedural terrain**
Add Worms (inspired by Worms Armageddon) as a new arcade game with:

- **Procedural terrain** — seeded Island and Cavern generation, full destruction via `carveCircle`, girder placement, ROCK immunity
- **Bespoke physics** — worm locomotion (walk, jump, backflip, ballistic flight, fall damage), projectile simulation with wind/bounce/homing, ninja rope with corner wrapping, explosion geometry with linear falloff
- **16 weapons** — Bazooka, Grenade, Cluster, Shotgun, Uzi, Fire Punch, Dynamite, Mine, Air Strike, Homing Missile, Holy Hand Grenade, Blowtorch, Girder, Teleport, Ninja Rope, Skip Go (+ Surrender)
- **Match rules engine** — 45s turns, retreat phase, sudden death with rising water, crates, mines, oil drums, chain reactions, deterministic hash-based state
- **8 themes** — Forest, Desert, Farm, Hell, Arctic, Jungle, Construction, Space with full procedural palettes and drop-in art hooks (`data/worms-artwork.json`)
- **Phaser scene** — mode select, quick match setup, camera, HUD, weapon panel, slingshot aim, 2-player hotseat
- **Headless verifier** (`tools/verifyWorms.js`) — 207 checks across terrain, physics, weapons, and match logic; deterministic through the sim
- **Wiring** — registry (iconFrame 92), main.js scene registration, slug dispatch, asset manifest resolver, preload

Also updates `level-008.json` with new solid/spike geometry, additional balls and strands, and repositioned pipe.
2026-07-31 16:33:37 -06:00
Brian Fertig 94e2152918 remove Angry Birds game; enhance Goo Tower visuals
Remove the entire Angry Birds implementation including physics solver,
game logic, Phaser scene, level data, verification tool, and registry
wiring. Also delete the build-plan documentation.

Meanwhile, upgrade Goo Tower rendering: spikes now have faceted steel
teeth with dynamic lighting, rust speckling, and twinkling glints;
lava features layered heat gradients, animated flow streaks, and
rising bubbles. Update gootower levels 6-7 and zuma level 6.
2026-07-31 16:29:49 -06:00
Brian Fertig c12371b654 feat(angrybirds): Waves 1-2 — playable core, 8 birds, level bank, wiring
AngryBirdsLogic.js layers the game onto the Wave 0 solver: wood/stone/ice
plus TNT with distinct density, friction and fragility; damage as a health
model with crack stages rather than instant shattering; all 8 birds with
one ability per shot; scoring, stars, win/lose, and a stepSim -> events[]
contract the scene replays as FX.

The load-bearing discovery is that damage must read approach velocity, not
the solver's accumulated normal impulse. The accumulated value carries the
static load of everything stacked above: measured 3.4e5 at the base of a
10-block stone tower, above the threshold that should shatter wood. Wiring
damage to it makes tall towers quietly crush themselves at rest, and it
reads as a level-design bug rather than a physics one. prestep now also
publishes contact.impactImpulse — the momentum needed to stop the approach,
zero at rest by construction. Resting fell to 2.4e4 against real hits of
1.9e5 to 2.7e6, and the whole material table was calibrated by measurement.

AngryBirdsGame.js maps the 2400x1080 logical level through fixed sx()/sy()
helpers at scale 0.78 rather than zooming the camera, which keeps HUD text
in plain screen coordinates. Slingshot drag, ghost trails of previous
shots, level select, star tracking and progress persistence are in. A
follow-camera is deliberately deferred to Wave 5 — it is pure presentation
and cannot be validated headlessly.

Six starter levels ship as the Poached Eggs opening. All stand unaided,
none damage themselves on load, and a greedy aim sweep clears every one.

Registered as slug angrybirds, iconFrame 92, under Video Games.

tools/verifyAngryBirds.js -> 114 checks green. Peggle (909) and Excitebike
(620) still pass; Goo Tower's 2 failures are pre-existing and unrelated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1wNRvLLtyfCDAET7oYouf
2026-07-30 19:07:16 -06:00
Brian Fertig 9ecbc9589f feat(angrybirds): Wave 0 — deterministic rigid-body solver
Angry Birds is fundamentally a rotating rigid-body stacking game, and
neither existing engine could be extended into it: PeggleLogic collides a
moving circle against static pegs with no rotation, and GooTowerLogic has
no angular state at all because its rigidity is emergent from
triangulation. Matter.js ships in the CDN Phaser build but is not
importable in bare Node and not reproducible, which would forfeit the
verifier, the generator's measured star thresholds, and the editor's
winnability gate.

AngryBirdsPhysics.js is a bespoke solver: convex polygons and circles,
uniform-grid broadphase, SAT with reference-face clipping to 2-point
manifolds, sequential impulses with warm starting keyed on stable feature
ids, Coulomb friction, split-impulse position correction, and island
sleeping.

Split impulse rather than plain Baumgarte is the load-bearing choice.
Biasing the real velocity makes penetration proportional to load, so the
bottom contact of a 10-box tower sank ~9x deeper than the top and the
stack sagged 12.85px. Correcting position through a discarded
pseudo-velocity removes a fixed fraction of the excess per substep
regardless of load; sag is now 0.46px per contact, exactly the slop band
we deliberately allow.

Gate: 10-box tower settles in 0.68s and sleeps with <1px drift and 0.35
degrees of tilt; friction holds on a 15 degree slope and slips on 40;
replay is bit-identical and frame-rate independent; 40 monkey seeds
produce no NaN, no overspeed and no sinking.

tools/verifyAngryBirds.js -> 51 checks green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1wNRvLLtyfCDAET7oYouf
2026-07-30 18:47:18 -06:00
Brian Fertig abb55d6d7b excitebike: playtest fixes and Wave 5 polish
Playtest fixes (two reports, both bugs):
- Bad ground no longer instantly crashes: holes and obstacles only
  put you down above surfaceCrashSpeed; below that you bog to a crawl
  that is capped under the crash speed, always escapable
- Steep ramps (45°) no longer crash: launch lifts the bike clear of
  the lip, pitch is clamped to pitchMax, and landing angle is clamped
  to landGroundAngleMax so straddled cliff edges don't count as
  rideable surfaces
- Harness now drives every ramp at seven speeds; no crashes allowed

Wave 5 polish:
- Scenery: infield and apron shrub rows (bush, apronBush, tuft)
  transcribed from NES track maps
- Ramps given readable silhouette (packed-earth hatch, dark stroke,
  lit crest, sheer-face cut)
- Gaps show infield through lane; lane dividers and cool-zone
  chevrons fixed for alternating-lane contrast
- Snow and night themes retinted for visibility
- iconFrame 91 already painted

Tooling:
- Map reader masks ramp columns to avoid false mud/cool-zone detection
- All 10 track qualifyMs retuned from playtest measurements

Updated build plan and sprites docs.
2026-07-29 23:06:41 -06:00
Brian Fertig 81aa6e00a8 fix(excitebike): rework throttle, heat model, and landing after playtest
Address three fidelity issues found during Brian's playtest:

- Throttle: base speed 150→175, heat now chases a target (0.5 for A, 1.0 for B)
  so holding A alone settles the meter halfway without stalling.

- Turbo: overheat window extended to 6–8 seconds (heatRiseRate 1/7s), turbo speed
  275→235 against 175 base (57% boost). AI rivals now use hysteresis (heatOff/
  heatOn) instead of feathering around a single threshold.

- Landing: tolerance is lopsided — rear-wheel-first is safe (landCleanBack 0.45 /
  landHardBack 1.20), nose-down is strict (landCleanNose 0.32 / landHardNose 0.92).
  Crash rates across banks dropped from 1.3–5.9 to 0.2–3.0 per 1000px.

Other changes:
- Qualify targets: max(human × 1.06, expert × 1.12) so a perfect ride has margin.
- Fix NaN in countdown caused by renamed heatRate constant.
- Soak bands re-based; added monotonic ordering check (expert > human > steady > naive).
- Title screen now shows controls and "LAND REAR WHEEL FIRST" hint.
- All 10 track qualifyMs values retuned to new physics.
2026-07-29 22:34:29 -06:00
Brian Fertig 4e818ad104 Excitebike 2026-07-29 22:05:21 -06:00
Brian Fertig 5b24cc3ad0 Goo Tower Levels 2026-07-26 15:23:18 -06:00
Brian Fertig 386ad3efb7 feat: add Goo Tower game with physics engine, 12 levels, and editor
Implement Waves 0-3 of Goo Tower, a World of Goo-inspired physics
puzzle game. Includes:

- GooTowerLogic.js: Verlet integration with XPBD constraints, terrain
  collision, ball-ball collision, strand breaking, crawling agents,
  and 9 goo types (common, ivy, balloon, bomb, block, pokey, bit,
  skull, anchor)
- GooTowerGame.js: Phaser scene with procedural rendering, drag-and-
  drop placement, pipe collection, and win/OCD tracking
- GooTowerEditor.js: Level editor (/?gootower-editor=1) with terrain
  drawing, ball/pile placement, settle/test/export tools
- 12 hand-tuned levels across 2 chapters (teaching + sandbox)
- verifyGooTower.js: 303-check regression harness
- genGooTower.js: Level bank writer
- GooTowerAuto.js: Greedy reference player (winnability gate)
- Wiring into gamesRegistry, main.js, GameRoomScene, and PreloadScene
2026-07-26 10:22:25 -06:00
Brian Fertig cb3c152d10 feat: pudding monsters waves 1-3, mahjong match FX, background art
Pudding Monsters:
- Rewrite level bank to 75 levels across 5 named chapters with a teach →
  drill → mix curriculum progression
- Implement 8 mechanics: sleepers, ice, slime trails, hypno goos, springs,
  tunnels, buttons+bricks, powerlifters+crates
- Split scoring into stars (target coverage) and crowns (par solves)
- Introduce planFlick/applyPlan so scene animation never disagrees with
  engine state
- Add mutable board layers (state.board) with generic cloning/hashing
- Level select: chapter rows, mechanic pips, tooltips, chapter-complete panels
- Monster type rendering: green/hypno/lifter colors, sleeper shut-eyes+Z

Mahjong Match:
- Add MahjongFx.js: shatter, burst, flash, ring, floatText, recoil,
  freed-tile chimes

Bloxorz:
- Add background images for menu and levels

Infrastructure:
- docs/puddingmonsters-mechanics-plan.md: living mechanics build-out plan
- tools/verifyPuddingMonsters.js: 1295 regression checks
- genPuddingMonsters.js: curriculum generator with load-bearing gates
- Add playSoundEx() for pitched sound cues
- Update asset manifest for all three games
2026-07-26 01:27:36 -06:00