Docs: END-1 session log + DR-034; CLAUDE.md losable-core bullet

DR-034 records the losable-Core decisions: CoreIntegrity on the global ghost,
the soft-loss edge inside CyclePhaseSystem, the Core-as-fallback-target and
despawn-on-breach forks, the transient OverrunTick (vs END-2's latching
outcome), and SaveData v4. Session log captures the build + validation
(330/330 EditMode; Play-verified server==client drain->regen->replicate).
CLAUDE.md adds the END-1 bullet; EB-1/EB-2/inventory bullets condensed
net-neutral to stay under the size budget.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 21:52:03 -07:00
parent 037ff66490
commit f7c63b6f41
3 changed files with 132 additions and 3 deletions
+4 -3
View File
@@ -88,11 +88,12 @@ Long-form originals + the milestone each came from: `Docs/Vault/_Meta/CLAUDE_Bui
- **Build-grid math must be deterministic + integer-stable:** corner-origin, center-returning, **half-open** cell bounds, `math.floor`. Lock `CellSize`/`PlotSize` as a coordinate space once (`BaseGridMath`) — changing them invalidates placed structures.
- **`PlacedStructure{[GhostField] byte Type; int2 Cell (server-only); uint NextTick; uint LastProcessedTick}`** on an ownerless interpolated ghost. **Bake the tick fields** (offline-catch-up linchpin). Only `Type` replicates (client derives `Cell` via `BaseGridMath.WorldToCell`). **Occupancy is DERIVED** by scanning live ghosts into a Temp `NativeHashSet<int2>`, never a baked buffer. See [[DR-014_M6_Build_Structures_Automation_Foundation]].
- **Co-op placement atomicity:** commit `StorageMath.Withdraw` + cell-reservation **in-place in the RPC foreach** (only `Instantiate` via ECB) so two same-tick requests for one cell can't both pass.
- **EB-1 machines can die ★ (DR-032):** structures bake `Health`(`[GhostField]`)+a `DamageEvent` buffer+a `Destructible` tag (NO `HitRadius`/NO `EffectiveCharacterStats` → clamp-to-0-then-die); `HealthApplyDamageSystem` destroys a `Destructible` at 0 (NOT bare `PlacedStructure` — M7 machines share it; occupancy auto-frees). `EnemyAISystem` fortress-targets the weighted-nearest of players+structures (snapshot ABOVE the early-return → undefended base razed; `EnemyAIMath.PickWeightedNearest`; `StructureAggroWeight` knob <1 prefers structures, SQUARED). Loss VFX = proximity-gated `StructureFeedbackSystem` (`CombatFeedbackSystem` gated `!isStructure`). See [[DR-032_EB1_Machines_Can_Die]].
- **EB-2 felt spend ★ (DR-033):** turret ammo = shared `Charge`(`ResourceId` **4**) on the existing `[GhostField] StorageEntry` ledger (no new wire). Buildable turret = in-region hitscan (no projectile→no tunnelling); `TurretFireSystem` spends `max(1,TurretChargeCostPerShot)`/shot from the ONE `GetSingletonEntity<ResourceLedger>` (NEVER `GetSingleton<StorageEntry>`): got≥cost→fire+cooldown, else **SOFT-FAIL** (no shot/no cooldown-burn → fires the instant Charge returns; partial→refund). `Fabricator.InputFromLedger`(byte, server-only, NOT `[GhostField]`/enum)→input from the ledger read **LIVE in-loop** (no hoist → 2 machines split a finite pool), output→ledger; re-enabled prefab = Ore→Charge ×3/30t (catalog=**4**; Harvester/Conveyor null). No turret↔Fabricator order edge (≤1-tick); HUD violet Charge chip + global quiet cue. See [[DR-033_EB2_Felt_Spend_Charge_Economy]].
- **EB-1 machines can die ★ (DR-032):** structures bake `Health`(`[GhostField]`)+`DamageEvent` buffer+a `Destructible` tag; `HealthApplyDamageSystem` destroys a `Destructible` at 0 (NOT bare `PlacedStructure`; occupancy auto-frees). `EnemyAISystem` fortress-targets weighted-nearest players+structures (`EnemyAIMath.PickWeightedNearest`; snapshot ABOVE the early-return; `StructureAggroWeight`<1 prefers structures, SQUARED). Loss VFX = `StructureFeedbackSystem`. See [[DR-032_EB1_Machines_Can_Die]].
- **EB-2 felt spend ★ (DR-033):** turret ammo = shared `Charge`(`ResourceId` **4**) on the existing `[GhostField] StorageEntry` ledger (no new wire). `TurretFireSystem` spends from the ONE `GetSingletonEntity<ResourceLedger>` (NEVER `GetSingleton<StorageEntry>`): afford→fire+cooldown, else **SOFT-FAIL** (no cooldown-burn; partial→refund). `Fabricator.InputFromLedger`(byte, server-only) reads the ledger **LIVE in-loop** (no hoist → machines split a finite pool); Ore→Charge ×3/30t. HUD violet Charge chip + global quiet cue. See [[DR-033_EB2_Felt_Spend_Charge_Economy]].
- **END-1 losable Core ★ (DR-034):** `CoreIntegrity{[GhostField] int Current,Max; uint OverrunTick}` on the GLOBAL CycleDirector ghost (no new ghost). `CoreDamageSystem` (server, after `EnemyAISystem`): Husk within ~3u of `PlotCenter` drains+despawns; `CoreRestoreSystem` regens ONLY in Calm. SOFT-loss edge IN `CyclePhaseSystem` (sole Phase writer): `Current<=0` in Siege → Calm (**NO** reward)+`DrainFraction` ledger+despawn Husks+stamp `OverrunTick` (transient flash, not latching). Core = an `EnemyAISystem` **FALLBACK** target. SaveData **v4** `CoreCurrent` (0→full); 3 live knobs. See [[DR-034_END1_Losable_Core]].
- **Resource-gated ability tiers/buffs reuse `StatModifier`** (`StatRecomputeSystem``EffectiveAbilityStats` both worlds). `GoalProgress{[GhostField] int Charge,Target}` (goal meter — ≠ EB-2 `ResourceId.Charge` ammo) rides the CycleDirector ghost.
- **M7 Automation (server-only) ★:** `Harvester`/`Conveyor` TRIMMED from the palette (code intact), `Fabricator` LIVE (EB-2); on `PlacedStructure`; plain server group; catch-up `ProductionMath.CyclesDue` (**lower-bound 0**); `RuntimePlacedTag` = player-built. See [[DR-020_M7_Automation_Production_Chains]].
- **Per-player inventory + equipment + items ★:** harvest routes by node region (DR-031) — **BASE→shared `ResourceLedger`**, **Expedition/un-tagged→PERSONAL `InventorySlot`** (`[GhostField]` `OwnerSendType.All`, spill→ledger; region via OPTIONAL `ComponentLookup<RegionTag>`); `G`=`InventoryDepositRequest` personal→ledger. Items=`ItemDatabase` blob, equip=`EquipSystem`; session-only — **full detail in gotchas archive (2026-06-12)**. See [[DR-026_Inventory_Equipment_Progression_Foundation]] · [[DR-027_Equipment_Slots_Phase1]].
- **Per-player inventory + equipment + items ★:** harvest routes by node region (DR-031) — **BASE→shared `ResourceLedger`**, **Expedition/un-tagged→PERSONAL `InventorySlot`** (`[GhostField]` `OwnerSendType.All`, spill→ledger); `G`=`InventoryDepositRequest`. Items=`ItemDatabase` blob, equip=`EquipSystem`; session-only — **full detail in gotchas archive (2026-06-12)**. See [[DR-026_Inventory_Equipment_Progression_Foundation]] · [[DR-027_Equipment_Slots_Phase1]].
- **Disk persistence (`SaveData`, single-slot atomic JSON, versioned/additive) ★:** **born-correct load**`CycleDirectorSpawnSystem` stages `PendingSave` AT SPAWN; `BaseRestoreSystem` replays structures charge-free + REMAINING-tick cooldowns + **EB-1 v3** per-structure HP, SAME-ECB. `SaveService.Load` = additive floor `[MinLoadableVersion=2, Current]` (old saves load; missing field 0-defaults). See [[DR-019_Frontend_Menu_Settings_Saves_Build]] · [[DR-032_EB1_Machines_Can_Die]].
### Presentation / juice / VFX