Enforce one gravity field contract

This commit is contained in:
Meta Vens 2026-07-14 16:26:14 +01:00
commit 3829f2f04a
8 changed files with 77 additions and 307 deletions

View file

@ -193,25 +193,21 @@ Remaining debt:
## Gravity Terrain
There are now shared daemon render queries for gravity influence brushes and
terrain sampling. `ZoneRenderer` uses
`AetheriaRuntimeDaemonRenderQueries.EvaluateGravityTerrainHeight` and
`QueryGravityTerrainBand` for rendering.
Daemon zone/body state owns gravity as positive depth magnitudes. The Ymir
adapter passes `GravityWellDepth` directly into positive-strength radial fields,
which attract. Shared render queries subtract those magnitudes into negative
terrain wells, and `AetheriaRuntimeGameDocuments.RenderSplatsViewport` performs
the same derived sign conversion for `gravity.height` splats.
The old `Assets/Scripts/Gravity.cs` still exists. It samples Unity
`GravityObject` materials and shader names directly. That path is a legacy
Unity-local gravity evaluator. It should not own gameplay gravity or canonical
terrain facts. The desirable shape is:
`AetheriaRuntimeDaemonRenderQueries` owns gravity influence brushes, terrain
sampling, and terrain bands. `ZoneRenderer` consumes those queries. The main
menu embeds the typed gravity, render-splat, and object viewport documents; its
old fallback body/object world has been deleted.
- daemon zone state defines body/orbit/gravity influence data;
- shared runtime query code answers viewport/intersection questions such as
"which influence brushes intersect this XZ area?";
- Unity receives only the brushes and terrain samples needed for the current
camera/minimap/render pass;
- Ymir receives physics-relevant fields from the same daemon state.
`Aetheria.State.Verify` already checks for shared gravity influence query
symbols and pushes `ZoneRenderer` away from mirrored Unity `Zone` math.
The old `Assets/Scripts/Gravity.cs` remains a legacy Unity-local visual
evaluator. It does not own gameplay gravity or canonical terrain facts. Unity
receives provider projections for the active camera/minimap/render pass, while
`AetheriaYmirWorldPhysics` receives physics fields from the same daemon state.
## Stats And Behaviors

View file

@ -839,6 +839,32 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
are deleted. The old enum ordinal remains reserved only to avoid shifting
serialized command values and is rejected by the daemon.
### Daemon Gravity Field Contract
- Owner: typed daemon zone/body state owns positive gravity-depth magnitudes;
embedded Ymir owns radial integration and contact facts without reinterpreting
their sign.
- Inputs: body poses, influence radii, positive `GravityWellDepth`, positive
zone `GravityTerrainDepth`, exponents, waves, and fixed delta.
- Outputs: Ymir produces inward acceleration, positions, velocities, and
contacts. Daemon projections publish typed gravity viewport and render-splat
documents from the same state.
- Derived state: terrain samples and `gravity.height` splat values are negative
because presentation subtracts the positive magnitude. Bands, Eve fields,
Unity meshes, and cameras remain derived.
- Forbidden writers: negative authored depths, adapter-side sign compensators,
Unity gravity scripts, Eve lowerers, main-menu fallback fixtures, and stale
persisted Terminus rows cannot author gravity semantics.
- Shared paths: generated, restored, and imported worlds use the same magnitude
convention; physics and every render projection consume those canonical
values.
- Cut line: the dead main-menu fallback world is deleted. Built-in Terminus
state with the old sign fails the current-scenario check and is regenerated;
only presentation conversion may negate depth.
- Verification layer: daemon smoke proves inward Ymir velocity, negative sampled
height, and negative body splats. Released cold/warm witnesses exercise the
persisted daemon path.
- Owner: `Aetheria.State` owns the new typed state spine for durable state.
The embedded `GameCult.Aetheria.State.Unity` package owns Unity's runtime
typed state file path plus the boot-time state-file probe, and is the landing