Simulate equipped visibility sources

This commit is contained in:
Meta Vens 2026-07-17 02:05:43 +01:00
commit d2926cc782
5 changed files with 36 additions and 17 deletions

View file

@ -397,7 +397,12 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
AetheriaRuntimeBehaviorKinds.Reflector,
0,
[new AetheriaRuntimeBehaviorField(1, PerformanceStat(2))]);
var controller = CatalogItem("reflector-controller", reflector);
var constantVisibility = new AetheriaRuntimeBehaviorPayload(
1,
AetheriaRuntimeBehaviorKinds.Visibility,
0,
[new AetheriaRuntimeBehaviorField(1, PerformanceStat(5))]);
var controller = CatalogItem("reflector-controller", reflector, constantVisibility);
var catalog = new AetheriaRuntimeCatalogSnapshot([controller], [], []);
var ship = Entity(0, 250, "player");
ship.Visibility = 3;
@ -446,8 +451,11 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
AetheriaRuntimeVisibilitySimulation.StepZone(zone, [ship], catalog, settings);
AetheriaRuntimeVisibilitySimulation.StepZone(zone, [ship], catalog, settings);
RequireNear(3 + expectedReflection, ship.Visibility, 0.000001,
"Reflector must use the fossil stellar PowerPulse at the shared resolved sun orbit without accumulating per tick");
RequireNear(3 + 5 + expectedReflection, ship.Visibility, 0.000001,
"Visibility and Reflector must publish their fossil sources without accumulating per tick");
var equipmentSource = ship.StatGrids.Single(grid => grid.Name == "equipment-visibility");
RequireNear(5, equipmentSource.Values.Single(), 0.000001,
"Operational Visibility equipment must publish its evaluated signature as an inspectable source");
var source = ship.StatGrids.Single(grid => grid.Name == "reflector-visibility");
RequireNear(expectedReflection, source.Values.Single(), 0.000001,
"Reflector visibility must remain an inspectable daemon-owned source for Eve and reconnect");

View file

@ -18,6 +18,7 @@ namespace GameCult.Aetheria.State.Verse
public const string VelocityConversion = "VelocityConversion";
public const string VelocityLimit = "VelocityLimit";
public const string Reflector = "Reflector";
public const string Visibility = "Visibility";
private static readonly ISet<string> WeaponKinds = new HashSet<string>(StringComparer.Ordinal)
{

View file

@ -9,6 +9,7 @@ namespace GameCult.Aetheria.State.Verse
public static class AetheriaRuntimeVisibilitySimulation
{
private const string ReflectorVisibilityGrid = "reflector-visibility";
private const string EquipmentVisibilityGrid = "equipment-visibility";
public static void StepZone(
AetheriaRuntimeZoneSnapshotCommit? zone,
@ -39,6 +40,11 @@ namespace GameCult.Aetheria.State.Verse
if (entity == null || !entity.IsActive)
continue;
var equipmentVisibility = AetheriaRuntimeEquippedBehaviorQueries.FindOperational(
entity, catalog, AetheriaRuntimeBehaviorKinds.Visibility)
.Sum(behavior => Math.Max(0, behavior.EvaluateStat(
1, ThermalPerformance(entity, behavior.EquipmentIndex))));
SetVisibilitySource(entity, EquipmentVisibilityGrid, equipmentVisibility);
var light = suns.Sum(sun => StellarLight(
entity.PositionX - sun.position.x,
entity.PositionZ - sun.position.z,
@ -47,7 +53,7 @@ namespace GameCult.Aetheria.State.Verse
entity, catalog, AetheriaRuntimeBehaviorKinds.Reflector)
.Sum(behavior => Math.Max(0, behavior.EvaluateStat(
1, ThermalPerformance(entity, behavior.EquipmentIndex))) * light);
SetVisibilitySource(entity, reflected);
SetVisibilitySource(entity, ReflectorVisibilityGrid, reflected);
}
}
@ -61,18 +67,21 @@ namespace GameCult.Aetheria.State.Verse
return Math.Pow((x + 1) * (1 - x), 8);
}
private static void SetVisibilitySource(AetheriaRuntimeEntitySnapshotCommit entity, double value)
private static void SetVisibilitySource(
AetheriaRuntimeEntitySnapshotCommit entity,
string sourceName,
double value)
{
var grids = (entity.StatGrids ?? Array.Empty<AetheriaRuntimeEntityStatGridCommit>()).ToList();
var grid = grids.FirstOrDefault(candidate =>
string.Equals(candidate.Name, ReflectorVisibilityGrid, StringComparison.Ordinal));
string.Equals(candidate.Name, sourceName, StringComparison.Ordinal));
var previous = grid?.Values.FirstOrDefault() ?? 0;
entity.Visibility = Math.Max(0, entity.Visibility - previous) + value;
if (grid == null)
{
grid = new AetheriaRuntimeEntityStatGridCommit
{
Name = ReflectorVisibilityGrid,
Name = sourceName,
Width = 1,
Height = 1
};

View file

@ -1071,15 +1071,15 @@ projectile lead, hardpoint gating, progressive lock, and target destruction.
### Authoritative Reflected Visibility Contract
- Owner: the Aetheria daemon owns each entity's reflected stellar signature.
It evaluates operational `Reflector` cross-section after energy and thermal
state settle and before contact refresh. Eve and Unity only present the
resulting visibility and its named source.
- Owner: the Aetheria daemon owns each entity's equipment and reflected stellar
signature. It evaluates operational `Visibility` and `Reflector` behaviors
after energy and thermal state settle and before contact refresh. Eve and
Unity only present the resulting visibility and named sources.
- Inputs: entity position, equipped reflector performance and thermal state,
daemon-owned sun mass, sun light-radius multiplier, the provider render
settings light-radius curve, and resolved orbit positions.
- Outputs: aggregate entity visibility plus an inspectable, reconnectable
`reflector-visibility` source grid.
- Outputs: aggregate entity visibility plus inspectable, reconnectable
`equipment-visibility` and `reflector-visibility` source grids.
- Shared-field invariant: daemon visibility and environment rendering resolve
body positions through `AetheriaRuntimeOrbitQueries`; gravity-center overrides
and nested authored orbits cannot silently put the visible sun and its
@ -1091,9 +1091,10 @@ projectile lead, hardpoint gating, progressive lock, and target destruction.
reflector.
- Forbidden writers: contact refresh cannot overwrite emitted signature, and
clients cannot submit visibility, stellar light, or reflector results.
- Verification: daemon smoke proves a displaced authored sun orbit, the fossil
pulse equation, evaluated reflector cross-section, named source publication,
and a second tick with no visibility accumulation.
- Verification: daemon smoke proves evaluated constant equipment visibility, a
displaced authored sun orbit, the fossil pulse equation, evaluated reflector
cross-section, named source publication, and a second tick with no visibility
accumulation.
- Open parity: active consumable reflector effects and complete visibility-
source cardinality remain to be migrated.

View file

@ -44,7 +44,7 @@ validation proves contract shape, not wiring, exclusivity, lowering, or parity.
| Terminus loop | original game composition | daemon/Ymir/Eve | pilot surface | Aetheria.Unity | live minimum-loop proof: generic Unity discovers the provider, lowers the pilot world/assets, single-steps dock and undock while paused, buys daemon-priced station stock, single-steps Ymir salvage collection, resumes, moves, targets, fires, and presents authoritative receipts/shot outcome; the released full-session profile starts with no pickup, destroys a deterministic target, observes its canonical cargo drop, tractors it into a Ymir Begin contact, and proves exactly one `ymir-fact:` collection receipt plus cargo `0` to `1` | richer trade content, docking transitions, and sustained combat encounters |
| Starbridge | original/shared architecture intent | one daemon session | pilot + commander surfaces | Unity + Electron | commander task board and autonomous explore execution wired; Electron Eve lowering and split-target proof missing | commander orders plus four pilots and autonomous workers |
| Behavior engine | `ServerShared/Behaviors` composition | daemon | executable action/status projection | action bar and feedback | tick reconciles equipped catalog payloads into persistent behavior state; shared evaluated-stat query proven; execution families remain partial | every behavior family, ordering, resource transaction and modifier lifecycle |
| Sensors/visibility | installed sensor sensitivity, `Reflector`, decaying signature sources, stellar light, and observer information thresholds | daemon | contacts, named visibility sources, and ping events | indicators/maps and provider environment lowering | passive reach derives from enabled installed Sensor behaviors with diminishing-return array composition regardless of entity kind; station-scale arrays are ordinary gear installed into larger hull-authored sensor hardpoints, with smaller same-type arrays remaining valid fallbacks; generation prefers the largest fitting footprint and contains no station/ship sensor-count branch. Operational reflectors now multiply evaluated cross-section by the fossil exponent-8 stellar `PowerPulse` after thermal settlement; the named source is reconnectable and does not accumulate. Gameplay light and environment projection share resolved authored orbit/body centers and provider-owned sun radius inputs. Contact refresh no longer overwrites emitted visibility; docked craft consume one daemon-derived union of craft and dock-parent contacts through both Eve rows and SoA bodies, with sensor-source provenance; the old station range survives only as obsolete snapshot compatibility | active consumable reflector effects, source cardinality, shutdown, threshold decay, ping, classification timelines, and canonical catalog station-array data |
| Sensors/visibility | installed sensor sensitivity, `Visibility`, `Reflector`, decaying signature sources, stellar light, and observer information thresholds | daemon | contacts, named visibility sources, and ping events | indicators/maps and provider environment lowering | passive reach derives from enabled installed Sensor behaviors with diminishing-return array composition regardless of entity kind; station-scale arrays are ordinary gear installed into larger hull-authored sensor hardpoints, with smaller same-type arrays remaining valid fallbacks; generation prefers the largest fitting footprint and contains no station/ship sensor-count branch. Operational `Visibility` equipment publishes evaluated constant signature; reflectors multiply evaluated cross-section by the fossil exponent-8 stellar `PowerPulse` after thermal settlement. Both named sources are reconnectable and do not accumulate. Gameplay light and environment projection share resolved authored orbit/body centers and provider-owned sun radius inputs. Contact refresh no longer overwrites emitted visibility; docked craft consume one daemon-derived union of craft and dock-parent contacts through both Eve rows and SoA bodies, with sensor-source provenance; the old station range survives only as obsolete snapshot compatibility | active consumable visibility/reflector effects, source cardinality, transient decay, ping, classification timelines, and canonical catalog station-array data |
| AI/tasks | corporation task scheduler plus agent state machines | daemon | commander task board, corporation survey ledger, and shared semantic controls | Eve commander/pilot clients | point exploration, loadout-driven attack, haul, mining/offload, resource surveying, physical station towing, persistent orbit patrol, route-aware assignment, and autonomous return home are wired through shared commands. Combat samples the fossil DPS/range policy, selects live weapon groups, leads projectiles, strafes relative to target attitude, and gates fire on catalog placement rotation. Cross-zone task and home routes now survive the full daemon-owned wormhole timeline instead of instant transfer; attack admission rejects missing/friendly targets and unavailable weapon groups before durable queueing | cancellation, reconnect, multi-client command transfer, and model-local barrel-direction metadata |
| Consumables | cargo-backed timed behavior containers | daemon | dynamic actions, active effects, and lifecycle facts | action bar/schematic | daemon atomically resolves typed metadata and concrete cargo, preserves consumed-instance quality, enforces authored stacking, evaluates effectiveness/quality, and executes ordered `EnergyDraw`, fossil-compatible no-op `Heat`, `ItemUsage`, and stateful `Cooldown` payloads after energy tick initialization; every effect and payload state has stable authored identity; cooldowns update before the ordered chain, require state strictly below zero, reset to one on success, and continue aging behind earlier failures; false and unsupported payloads stop later execution with a typed fact; timers retain the fossil's exact-zero final tick; Unity reconciles presentation by effect identity and cannot restore active behavior state by list index | catalog revision pinning, stat modifiers, remaining behavior families, and reconnect presentation proof |