Commit Graph

20 Commits

Author SHA1 Message Date
Brian Fertig 2d1265d592 Add SFX, dossier toggle/auto-fold, and tether HUD repositioning
- Add sound effects (construct, deconstruct, discovery) with config in data/sfx.json; play on dossier arrival/fold and new-object discovery; silently no-op when disabled or asset missing
- Rework the system dossier into a full lifecycle: open-by-default on arrival, one-shot auto-fold at 10 s, click-to-toggle (name + caret), reverse deconstruction order, state caret that swings with the open/closed state
- Add ScrambleDecode `reverse` mode so lines can deconstruct (value → static → '') for the fold animation
- Reposition the tether readout to bottom-right above the deck's MENU button, right-aligned and bottom-anchored; fall back to left column when the deck is disabled
- Expand decode and system-hud tests to cover reverse decode, the full dossier lifecycle (toggle, auto-fold cancellation, mid-animation guard), tether HUD layout, and SFX wiring
2026-09-04 10:25:37 -06:00
Brian Fertig fbd0e56f1f Extract shared decode scramble and apply it to the system dossier HUD
- New `js/utils/Decode.js` with a pure `ScrambleDecode` class plus
  `DECODE_CHARS`, `DECODE_DURATION`, and a per-line `decodeDur()` helper,
  so one effect serves both scenes.
- MenuScene now delegates its seed scramble to the shared utility instead
  of inlining the reveal math and alphabet.
- GameScene's system dossier types itself in on arrival: each line starts
  empty and decodes left-to-right, staggered top-to-bottom, with the
  timeline anchored on the first update frame; state self-clears once all
  lines settle so `update()` pays nothing afterward.
- Add Node dev tests for the shared effect contract (`dev/decode.test.mjs`)
  and for the real GameScene dossier decode against actual galaxy/report
  data with a stubbed scene (`dev/system-hud.test.mjs`).
- Document both new test commands in the README and update the planets
  PSD asset.
2026-09-04 09:52:05 -06:00
Brian Fertig 2b37be7494 Fix asteroid rock overlap and add distinct compass color for clusters
- Replace the old per-rock placement retry loop with a deterministic pairwise relaxation pass (relaxRockGaps) that enforces a gapFactor x (r1+r2) separation between every pair, so rocks keep a subtle visible gap instead of interpenetrating
- Add cluster.gapFactor (default 1.12) and asteroids.compassColor (#c8d2e0) config keys, with updated comments in data/asteroids.json and SystemGenerator.js
- Tint the DiscoveryCompass arrow per target: bake the arrow texture white and tint it to the target's color (worlds keep theme neon cyan, clusters use their light gray)
- Extend dev/asteroids.test.mjs to assert every rock pair respects the gapFactor separation
2026-09-04 08:45:28 -06:00
Brian Fertig ec7671d0cb Add asteroid clusters as discoverable, solid objects in each star system
- Generate 4–8 rock groups per system with seeded placement, spacing, and slow tumble/drift motion driven by data/asteroids.json
- Add AsteroidCluster entity (Phaser container) with halo, dust motes, per-rock spins, and ship keep-out collision reusing Planet.resolve
- Integrate clusters into GameScene: load spritesheet, constrain ship post-physics, include in click-to-fly/autopilot/discovery/compass
- Synthesise unique cluster names via NameGenerator.asteroid (syllables + field suffix)
- Add dev test suite and ?seed= param for deterministic galaxy generation
2026-09-04 08:34:55 -06:00
Brian Fertig 48dfc7cd8f Rework solar system layout to orbit rings with minSpacing/maxNeighbor ru
- Replace the annular-band scatter (minOrbit/maxOrbit/minEdgeGap) with a ring-based placement: objects sit on one or two orbits around the home world, governed by center-to-center `minSpacing` and `maxNeighbor`
- Free-space stations (deep-space stations, waypoints) are now layout objects alongside planets; planet-bound settlements stay features of their planet
- Handle the N=11 case (9 planets + 2 stations) with an inner 3-ring + outer 8-ring; chain outward defensively for any larger N
- Update tests to verify the new spacing invariants, the two-orbit case, and determinism including station positions
- Refresh PROJECT_NOTES and the data-file comment to describe the orbit model
2026-09-03 23:01:47 -06:00
Brian Fertig a1db1cc672 Give the home world a real name from the bank, and show object names on the compass
Two small naming/labeling fixes:

1. The home planet was always the generic "Terra". It now takes the first
   name off the STARTING system's planet-name deck (SystemGenerator), so it
   reads as a real place and can never clash with one of that system's
   planets. Stored as content.homeName (only the starting system has one);
   the old planets.homeName stays as a fallback. Used for the compass
   home chip and the tether anchor label.

2. Confirmed/sharpened the compass name tag: each discovered off-screen
   object's arrow chip already renders TYPE + NAME — now the home world
   shows its bank name too (e.g. "HOME WORLD · ESHKAELURA").

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-03 22:41:06 -06:00
Brian Fertig d355fd50e4 Name worlds & stations from curated banks (colonial/alien, official/smuggler)
Planets and space stations were previously made by stitching a root word to
a kind noun ("Kest Skyspire", "New Natick IV"), which read like labels, not
names. They now draw from deep, hand-picked name BANKS in data/naming.json:

- banks.planet  — colonial "New Denver"/"Port Tucson" worlds mixed with
                  alien "Klaxoria"/"Vexithunhal" worlds (269 names).
- banks.station — official designations ("Deep Space SC-145", "Nav Relay
                  V-77") mixed with smuggler hangouts ("Hell's Hideout",
                  "The Rusty Anchor") (165 names).

Assignment is a seeded shuffle of the whole bank (NameGenerator.planetDeck /
stationDeck), dealt out per-system in order, so a system never repeats a
name until the pool is exhausted (impossible at these sizes). The decks come
from dedicated Rng.derive(...) streams, keeping generation order-independent
(lazy === eager). Stars and the galaxy still synthesize from syllable pools
(unbounded), and the home world keeps its configured name.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-03 22:29:31 -06:00
Brian Fertig 30af365c68 Add the tether: the player's range, a level-1 zone (5120 px) with a glitchy barrier rim
The player starts with a level-1 tether anchored on the home world:
a circular zone 5120 px from the planet's center. The ship may fly
anywhere in the UNION of its tethers' zones — where zones overlap there
is no line and no wall — and the union's boundary is a hard barrier,
rendered as a thick cyberpunk glitch dotted line (marching dashes,
additive glow + RGB fringe, ambient glitch bursts with dash flicker,
radial displacement and data drops, contact shudder + camera kick +
throttled console toast where the ship bumps it).

- data/tether.json: level radii (5120 x 1.25^lv), the starting tether,
  barrier line/look, glitch and contact tuning (manifest-registered)
- js/tether/Tether.js: pure range math (union membership, clamp to the
  nearest union boundary point + normal, visibleArcs = each tether's
  share of the union boundary) — Node-tested
- js/tether/TetherField.js: scene-facing field — add/remove/setLevel
  seam for future builds/upgrades, per-frame ship constraint, and the
  barrier renderer (on-screen dot culling only)
- js/scenes/GameScene.js: home tether at the system origin, HUD
  readout (level / range / anchor per tether), click-to-fly and
  autopilot targets clamped to the union boundary, contact feedback,
  destruction on shutdown
- dev/tether.test.mjs: 29 checks incl. the two-direction boundary
  property (no line in overlaps, no gaps in the line) and a numeric
  nearest-boundary cross-check (worst 0.79 px)
- dev/smoke-game.mjs: ?tethers / ?homeLevel / ?report dev hooks for
  manual and headless verification
- README + PROJECT_NOTES: the system, its rules and its layering

Verified in headless Chromium: clean boot (menu + game), barrier
rendering (calm and glitch-burst frames), union boundary with two
tethers (arcs meet at the rim crossings, lens is line-free), ship
clamped exactly onto the rim from outside, contact toast fired.
2026-09-03 22:03:29 -06:00
Brian Fertig 23fcbe7176 Replace procedural ship sprite with spritesheet art and facing offset
- Load `assets/images/ships-player.png` as a Phaser spritesheet via
  `data/ship.json` (`texture`, `frameWidth`, `frameHeight`, `frame`)
- Add `artFacing` config; Ship applies a constant `artOffset` so heading
  math is unchanged while the frame art (facing north) renders correctly
- Scale sprite as `(size * scale) / frameWidth` to preserve the 46 px world
  hull size and collision radius regardless of frame dimensions
- Fall back to the built-in procedural dart when the sheet is missing or
  fails to load, with a console warning in GameScene.create()
- Update ship-behavior tests to account for `artOffset` in heading checks
- Add source art (`ships-player.psd`, landed-ship reference) and a demo
  video; document the new pattern in README and PROJECT_NOTES
2026-09-03 21:40:33 -06:00
Brian Fertig 2cbd8e8962 Add compass autopilot: clicking a name tag sends the ship to that world
- DiscoveryCompass name tags are now interactive buttons with hover/press feedback; firing onSelect hands the target id to the scene, which retargets the ship via GameScene.autopilotTo (aim at the keep-out rim on the approach side).
- Compass layout reserves the command-deck strip (reserveBottom) so chips/arrows are never buried under the deck.
- Click-to-fly now ignores clicks that land on a compass chip (DiscoveryCompass.contains), keeping autopilot and fly-here from colliding.
- Tests cover the chip hit test, onSelect seam, and reserveBottom clamping; docs updated to describe the new autopilot behavior.
2026-09-03 20:59:43 -06:00
Brian Fertig 9299859003 Add CRT scanlines and RGB pull-apart to the command deck
- Port the menu's GlitchText chromatic fringe to ActionBar: additive
  magenta/cyan icon ghosts, label ghosts with per-slot phase, and a panel
  outline ghost that activates during glitch bursts.
- Add a tiled-scanline overlay (1 dark row per pitch) matching CyberOverlay,
  configurable via actionbar.scanline with theme.overlay.scanline defaults.
- Replace idleGhost with animation.rgb (idleOffset/burstOffset/idleAlpha/
  burstAlpha); level now decays ~90 ms after triggerBurst for the fast-snap
  GlitchText feel while slice bars linger.
- Update README, PROJECT_NOTES, and research-builds tests to cover the new
  scanline and rgb config keys.
2026-09-03 20:42:33 -06:00
Brian Fertig 2253251768 Add command deck UI and research/build data layer
- New ActionBar component (js/ui/ActionBar.js) renders a procedural cyberpunk
  bottom bar with six slots (Research, Build, Ship, two reserved, Menu),
  boot flicker, rail comet, glitch bursts, and RGB shimmer; fully driven by
  data/actionbar.json
- Data contracts for the player's progression loop: research.json (time-based,
  one project at a time, gates builds/research) and builds.json (credits +
  minerals, ship/planet/station categories), both with _template docs and
  empty maps; registered in manifest.json
- GameScene wires the deck in, routes clicks over it away from fly-to, pins
  the hint above the bar, and drives per-frame update/shutdown
- New dev/research-builds.test.mjs pins the data contract (manifest entries,
  rule knobs, template fields, six-slot order)
- cdpshot.mjs: cross-platform temp dir + --no-sandbox for container/CI
- README and PROJECT_NOTES updated with the new loop, deck docs, and a Phaser
  v4 scrollFactor-on-screen-fixed-container quirk
2026-09-03 20:33:04 -06:00
Brian Fertig 8c52105412 Add discovery system with off-screen compass and in-world planet layout
- Discovery rule: ship within `discovery.distance` (540 px) of a world's edge discovers it once per system; state is pure, save-ready (`Discovery.toJSON/fromJSON`)
- Off-screen compass (`DiscoveryCompass`): themed screen-edge arrows with type/name chips point back at discovered worlds; geometry helpers (`edgeAnchor`, `circleInView`, `lerpAngle`) exported for Node tests
- Solar-system layout: `layoutSystemPlanets` places generated worlds in a deterministic annular band around the home world, enforcing edge-to-edge separation and per-class scale/tint from `data/planets.json`
- All system planets are solid to the ship (collision + click-clamp), not just home
- Rim ping + HUD toast on discovery (`celebrateDiscovery`)
- New planet class pools (rocky/gas/ice/lava) with frames, `classScale`, `classTint`, and `typeLabels`
- Smoke-game dev hooks: `?ship=x,y` and `?near=px` for screenshotting discovery/compass states
- Node test suite (`dev/discovery.test.mjs`) covering rule boundaries, per-system state, JSON round-trip, layout bounds/determinism, compass geometry, and class pools
2026-09-03 19:45:21 -06:00
Brian Fertig 6ba71620b4 Main menu: cyberpunk UI overhaul + shared theme layer
Shared visual language (data/theme.json): Ethnocentric headers,
   Centauri body, neon cyan/magenta, cut-corner panels, and a shared
   CRT/glitch overlay (scanlines, grid, vignette, scan sweep, RGB-split
   bursts) used by both scenes.

   - Menu: glitch title with RGB pull-apart, neon bloom, console frame +
     status chrome, staggered boot, seed decode scramble, reroll/New
     Game glitch feedback
   - GameScene: theme fonts, fainter overlay, arrival burst
   - Color.toCss() for canvas text (v4 writes fillStyle raw)

   Phaser v4 (Giedi) fixes: manual TimeClock/TweenManager stepping in
   scene update(); scene.add.existing() for constructed GameObjects;
   input.hitTestPointer() instead of Pointer.over(). Documented in
   PROJECT_NOTES.

   Dev: cdpshot/cdp-eval CDP drivers (headless virtual-time kills rAF).

   Verified: menu→game transition, click-to-fly, seed flows, all
   dev/*.test.mjs suites, no console errors.
2026-09-03 16:27:25 -06:00
Brian Fertig 02d689e1bb Add seed-deterministic planet frame pools
- Allow planet kinds to specify multiple sheet frames and pick one with a seed-derived Rng so the same galaxy always gets the same home world.
- Add Ethnocentric and Centauri font assets.
2026-09-03 15:10:24 -06:00
Brian Fertig e7b52cc33d Add the home planet: a solid world the ship can approach but not enter
Adds the player's home planet to the starting system, rendered from the new
planets.png spritesheet. The planet is a solid disc: the ship may come within
shipClearance of its rim but can never cross it, and clicks on the planet
clamp to the keep-out rim so the ship always has a reachable destination.

- js/entities/Planet.js: solid-disc entity with a circle keep-out constraint
  (constrainShip/resolve, pure and scene-free) plus edgePoint/aimPoint helpers
- data/planets.json (+ manifest entry): texture, frame size, scale, homePlanet,
  shipClearance, spawnDistanceFromEdge
- Ship.js: exposes a radius (half the hull width) for the keep-out math
- GameScene.js: loads the spritesheet, spawns the home world at the origin,
  starts the ship ~150 px off its rim in a seed-derived direction, and applies
  the constraint each frame after the ship moves
- dev/planet.test.mjs: Node tests of the constraint against real config;
  dev/test-game.html gains a <base href> so asset paths resolve from /dev
2026-09-03 14:44:01 -06:00
Brian Fertig 9d40103cce Add a lived-in layer: settlements in generated systems
The galaxy was settled long before the player arrives. Systems now
host colonies on habitable worlds, mining stations over resource
worlds, cloud bases riding gas giants, stations adrift in open
space, and beacons — or report "charted · unclaimed" when empty.

- data/settlements.json: the shared kind vocabulary (label, theme,
  population range, anchor type); add a kind = JSON + naming pool.
- Per-archetype rates in data/systems.json (chance + required
  planet class) and a core→rim density gradient in data/galaxy.json
  (falloff/floor), keyed off each record's new rNorm.
- Draws stay in a stable order on the system's own Rng stream, so
  lazy and eager generation still produce identical content.
- Every settlement keeps owner: null, a reserved seam for the
  factions/pirates that will claim them later.
- NameGenerator.station() names from anchor + kind ("Kest Skyspire").
- SystemReport.js is a pure, testable formatter (dossier lines,
  "charted · unclaimed" for empty); GameScene's HUD renders it and
  Node tests cover structure, mix, gradient, naming, lazy === eager.
2026-09-03 11:25:03 -06:00
Brian Fertig eafc3c4314 Add v0.2: seedable galaxy, system archetypes, and two-level procedural generation
- Main menu Galaxy Seed panel: displayed, editable, rerollable; the menu
  previews what the seed builds (galaxy name, scale, archetypes) before
  committing. Same seed always generates the same galaxy.
- js/galaxy/Galaxy.js: seeded roster of 40k systems (disk + core + spiral
  arms, type weights, radial bands) with spatial hash for neighbor queries;
  contents generated lazily on arrival — identical to eager generateAll()
  because each system draws from Rng.derive(seed, 'system', id).
- js/galaxy/SystemGenerator.js + data/systems.json: six themed archetypes
  whose attributes (star classes, planet count spread, class weights,
  moons, belts, habitability, hazard) steer content generation.
- data/galaxy.json layout/distribution knobs, incl. distribution.rules[]
  hook for future proximity/clustering rules; data/naming.json name pools.
- GameScene: current system name/identity HUD (lazy content generation
  on arrival); dev boot without a menu falls back to a dev galaxy.
- dev/galaxy.test.mjs: determinism, distribution, bands, lazy==eager,
  neighbor brute-force checks (40k roster in ~70ms).
- Docs: world model, determinism rules, roadmap update.
2026-09-03 10:49:22 -06:00
Brian Fertig 7cf96bb237 Ship Travel and Orientation Updates 2026-09-03 10:25:54 -06:00
Brian Fertig eddbedbf1c Add v0.1 foundation: menu, click-to-fly ship, and JSON config system
- Boot the game from a static server with no build step (Phaser 4 vendored in lib/)
- Main menu (New Game button) and GameScene where clicking makes the ship fly there
- All tunables live in data/*.json (game/menu/ship), loaded via manifest + Config singleton
- Ship behavior driven by arcade physics (thrust, drag, maxSpeed, arrival) with a Node test harness (dev/ship-behavior.test.mjs) and a dev smoke page that boots straight into GameScene
- Project conventions documented in docs/PROJECT_NOTES.md; README rewritten to describe layout, run instructions, and dev tools
2026-09-02 22:31:34 -06:00