Commit Graph

3 Commits

Author SHA1 Message Date
Brian Fertig 831670c8ca Add faction territory floor and ring all stars by ownership
Branch sizes are inherently skewed; previously only the cap (median quota)
applied, so a small faction could start with a one-system sliver.

- FLOOR (balance.minTerritory, data/factions.json): a faction below the
  floor absorbs the nearest unowned eligible overflow first, then the
  richest faction's least-core systems — territory stays contiguous; a
  tiny galaxy with too few eligible systems is best-effort.
- Territory is now tracked per faction: g.factions.factionTerritories is
  the truth, the branch view is derived; capitals are placed inside the
  faction's post-floor territory, so a faction built entirely from
  borrowed space still gets its seat in its own territory.
- The galaxy plate rings EVERY star: faction color for territory, neutral
  silver for wild space (home included) — the ring color is the
  ownership read at a glance.
- dev/factions.test.mjs now checks the floor, cap, disjointness, and
  branch-view invariants; new throwaway diagnostics
  dev/faction-balance.diag.mjs / dev/faction-sweep.diag.mjs sweep seeds
  for the invariants + determinism.
2026-09-11 13:34:35 -06:00
Brian Fertig 42bf6c17e0 Add balance quota to cap faction territory sizes
- Branch sizes are inherently skewed and a branch IS its faction's
  territory, so without a cap one faction would dominate the start.
- Each branch now keeps only min(eligible, quota) of its eligible
  middle systems, closest to the middle band (|d−0.5|, index tiebreak);
  quota = the median of the three branches' eligible sizes. The big
  branch's overflow stays neutral wild space; a small branch keeps all.
- Expose g.factions.quota and g.factions.territories for the map's
  territory-region fill.
- Add tests verifying the quota, kept-set membership, near-equal
  faction sizes, and no-faction-outruns-typical-branch invariants.
- Fix landing.json: entry 4 now references ice assets (was mislabeled
  lava land with ice clips); entry 5 uses lava-land-02 + lava surface/
  takeoff clips.
- Add original art asset lava-shop-02.png and update docs to describe
  the balance rule.
2026-09-10 22:18:07 -06:00
Brian Fertig e2878da59c Add faction worldgen layer: territories, capitals, bridges, and arid pla
- Assign each jump-tree branch a faction (apex/mindweave/zenith) with seeded
  shuffle; territory = depth 2..maxDepth-1 per branch, ring + tips stay neutral
- Designate four capital worlds (neutral + one per faction) as the outermost
  planet of their system, with fixed frames 18-21 and faction-owned settlements
- Add cross-branch bridge gates in the middle belt so factions can reach each
  other without routing through the trunk; Dijkstra picks the shorter route
- Introduce arid planet class (always habitable, settles as colony) across all
  system types with rebalanced class weights
- Wire Trestle's last brief to auto-set destination to the neutral capital on
  acknowledgment (CommsHub onEnd → GameScene._commEnded)
- Render faction ring layer + capital seat marks on the galaxy plate; style
  bridge lanes distinctly from trunk edges
- Populate settlement owner from system faction (reputation seam now live);
  SystemReport reads faction label/color
- Add dev/factions.test.mjs covering config, branches, capitals, territory,
  arid, bridges, determinism; update existing tests for new invariants
2026-09-10 21:45:33 -06:00