Delete abandoned second combat writer
This commit is contained in:
parent
e3c81ff2ec
commit
55664c377a
4 changed files with 22 additions and 521 deletions
|
|
@ -1,458 +0,0 @@
|
|||
using GameCult.Aetheria.State.Verse;
|
||||
|
||||
public sealed class AetheriaDaemonCombatKernelSettings
|
||||
{
|
||||
public static AetheriaDaemonCombatKernelSettings Default { get; } = new();
|
||||
|
||||
public double DefaultHull { get; init; } = 100.0;
|
||||
public double DefaultShield { get; init; } = 35.0;
|
||||
public double DefaultHeatCapacity { get; init; } = 120.0;
|
||||
public double DefaultSignature { get; init; } = 1.0;
|
||||
public double DefaultSensorSensitivity { get; init; } = 1.0;
|
||||
public double DefaultSignatureMasking { get; init; } = 0.0;
|
||||
public double DefaultCognition { get; init; } = 1.0;
|
||||
public double DefaultFireControl { get; init; } = 1.0;
|
||||
public double SensorFalloffDistance { get; init; } = 520.0;
|
||||
public double TrackResolutionPerSecond { get; init; } = 0.46;
|
||||
public double VisibleTrackThreshold { get; init; } = 0.62;
|
||||
public double LaunchTrackThreshold { get; init; } = 0.34;
|
||||
public double TerminalSubsystemThreshold { get; init; } = 0.82;
|
||||
public double AbstractWeaponRange { get; init; } = 650.0;
|
||||
public double DefaultWeaponDamage { get; init; } = 11.0;
|
||||
public double WeaponCooldownSeconds { get; init; } = 1.0;
|
||||
public double WeaponHeat { get; init; } = 5.5;
|
||||
public double HeatDissipationPerSecond { get; init; } = 3.5;
|
||||
public double HeatSignatureScale { get; init; } = 0.85;
|
||||
public double MovementSignatureScale { get; init; } = 0.008;
|
||||
public double CognitiveLoadDecayPerSecond { get; init; } = 0.22;
|
||||
public double CognitiveLoadPerTrack { get; init; } = 0.08;
|
||||
public double SubsystemHitDamageBonus { get; init; } = 0.28;
|
||||
}
|
||||
|
||||
public sealed class AetheriaDaemonCombatStepReport
|
||||
{
|
||||
public AetheriaDaemonCombatStepReport(
|
||||
IReadOnlyList<AetheriaDaemonCombatEngagementReport> engagements,
|
||||
int resolvedContactCount)
|
||||
{
|
||||
Engagements = engagements ?? Array.Empty<AetheriaDaemonCombatEngagementReport>();
|
||||
ResolvedContactCount = resolvedContactCount;
|
||||
}
|
||||
|
||||
public IReadOnlyList<AetheriaDaemonCombatEngagementReport> Engagements { get; }
|
||||
public int ResolvedContactCount { get; }
|
||||
public int ShotCount => Engagements.Count;
|
||||
}
|
||||
|
||||
public sealed class AetheriaDaemonCombatEngagementReport
|
||||
{
|
||||
public int AttackerEntityIndex { get; init; }
|
||||
public int TargetEntityIndex { get; init; }
|
||||
public double TrackConfidence { get; init; }
|
||||
public double HitQuality { get; init; }
|
||||
public double DamageApplied { get; init; }
|
||||
public bool SubsystemQualityHit { get; init; }
|
||||
}
|
||||
|
||||
public static class AetheriaDaemonCombatKernel
|
||||
{
|
||||
private const string Hull = "hull";
|
||||
private const string Shield = "shield";
|
||||
private const string Heat = "heat";
|
||||
private const string HeatCapacity = "heat-capacity";
|
||||
private const string Signature = "signature";
|
||||
private const string SignatureMasking = "signature-masking";
|
||||
private const string SensorSensitivity = "sensor-sensitivity";
|
||||
private const string Cognition = "cognition";
|
||||
private const string CognitiveLoad = "cognitive-load";
|
||||
private const string FireControl = "fire-control";
|
||||
private const string MunitionPressure = "munition-pressure";
|
||||
private const string KernelWeaponOwner = "daemon-combat-kernel";
|
||||
|
||||
public static AetheriaDaemonCombatStepReport Step(
|
||||
AetheriaRuntimeRunCheckpointCommit? run,
|
||||
AetheriaRuntimeDaemonIntentState? intents,
|
||||
double deltaSeconds,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog,
|
||||
AetheriaDaemonCombatKernelSettings? settings = null)
|
||||
{
|
||||
if (run == null || deltaSeconds <= 0 || !double.IsFinite(deltaSeconds))
|
||||
return new AetheriaDaemonCombatStepReport(Array.Empty<AetheriaDaemonCombatEngagementReport>(), 0);
|
||||
|
||||
settings ??= AetheriaDaemonCombatKernelSettings.Default;
|
||||
var engagements = new List<AetheriaDaemonCombatEngagementReport>();
|
||||
var resolvedContacts = 0;
|
||||
foreach (var zone in run.Zones ?? Array.Empty<AetheriaRuntimeZoneSnapshotCommit>())
|
||||
{
|
||||
if (zone == null)
|
||||
continue;
|
||||
|
||||
var entities = (zone.Entities ?? Array.Empty<AetheriaRuntimeEntitySnapshotCommit>())
|
||||
.Where(entity => entity != null)
|
||||
.OrderBy(entity => entity.EntityIndex)
|
||||
.ToArray();
|
||||
if (entities.Length <= 1)
|
||||
continue;
|
||||
|
||||
foreach (var entity in entities)
|
||||
EnsureCombatStats(entity, catalog, settings);
|
||||
|
||||
StepContactResolution(entities, deltaSeconds, settings, ref resolvedContacts);
|
||||
StepWeapons(entities, deltaSeconds, settings, engagements);
|
||||
StepThermalAndCognition(entities, deltaSeconds, settings);
|
||||
}
|
||||
|
||||
return new AetheriaDaemonCombatStepReport(engagements, resolvedContacts);
|
||||
}
|
||||
|
||||
private static void StepContactResolution(
|
||||
IReadOnlyList<AetheriaRuntimeEntitySnapshotCommit> entities,
|
||||
double deltaSeconds,
|
||||
AetheriaDaemonCombatKernelSettings settings,
|
||||
ref int resolvedContacts)
|
||||
{
|
||||
foreach (var observer in entities)
|
||||
{
|
||||
if (!IsAlive(observer))
|
||||
continue;
|
||||
|
||||
var contacts = new List<AetheriaRuntimeEntityContactCommit>();
|
||||
var existing = (observer.Contacts ?? Array.Empty<AetheriaRuntimeEntityContactCommit>())
|
||||
.Where(contact => contact != null)
|
||||
.GroupBy(contact => contact.TargetEntityIndex)
|
||||
.ToDictionary(group => group.Key, group => group.First());
|
||||
foreach (var target in entities)
|
||||
{
|
||||
if (target.EntityIndex == observer.EntityIndex || !IsAlive(target))
|
||||
continue;
|
||||
|
||||
existing.TryGetValue(target.EntityIndex, out var previous);
|
||||
var confidence = previous?.InfoGathered ?? 0.0;
|
||||
var gain = ResolveTrackGain(observer, target, deltaSeconds, settings);
|
||||
confidence = Clamp01(confidence + gain);
|
||||
var visible = confidence >= settings.VisibleTrackThreshold;
|
||||
if (visible)
|
||||
resolvedContacts++;
|
||||
|
||||
contacts.Add(new AetheriaRuntimeEntityContactCommit
|
||||
{
|
||||
TargetEntityIndex = target.EntityIndex,
|
||||
InfoGathered = confidence,
|
||||
Hostile = Hostile(observer, target),
|
||||
Visible = visible
|
||||
});
|
||||
}
|
||||
|
||||
observer.Contacts = contacts
|
||||
.OrderBy(contact => contact.TargetEntityIndex)
|
||||
.ToArray();
|
||||
observer.Visibility = contacts.Count == 0 ? 0.0 : contacts.Max(contact => contact.InfoGathered);
|
||||
observer.VisibilitySourceCount = contacts.Count(contact => contact.Visible);
|
||||
SetStat(observer, CognitiveLoad, ClampNonNegative(
|
||||
GetStat(observer, CognitiveLoad) +
|
||||
contacts.Count * settings.CognitiveLoadPerTrack * deltaSeconds));
|
||||
}
|
||||
}
|
||||
|
||||
private static void StepWeapons(
|
||||
IReadOnlyList<AetheriaRuntimeEntitySnapshotCommit> entities,
|
||||
double deltaSeconds,
|
||||
AetheriaDaemonCombatKernelSettings settings,
|
||||
List<AetheriaDaemonCombatEngagementReport> engagements)
|
||||
{
|
||||
var byIndex = entities.ToDictionary(entity => entity.EntityIndex);
|
||||
foreach (var attacker in entities)
|
||||
{
|
||||
var weaponState = EnsureKernelWeaponState(attacker, settings);
|
||||
weaponState.Firing = false;
|
||||
weaponState.CooldownProgress = Math.Max(0, weaponState.CooldownProgress - deltaSeconds);
|
||||
weaponState.CoolingDown = weaponState.CooldownProgress > 0;
|
||||
|
||||
if (!IsAlive(attacker) ||
|
||||
attacker.TargetEntityIndex < 0 ||
|
||||
!byIndex.TryGetValue(attacker.TargetEntityIndex, out var target) ||
|
||||
!IsAlive(target) ||
|
||||
!Hostile(attacker, target) ||
|
||||
Distance(attacker, target) > settings.AbstractWeaponRange)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var confidence = ContactConfidence(attacker, target.EntityIndex);
|
||||
if (confidence < settings.LaunchTrackThreshold || weaponState.CooldownProgress > 0)
|
||||
continue;
|
||||
|
||||
var hitQuality = ResolveHitQuality(attacker, target, confidence);
|
||||
var subsystemHit = confidence >= settings.TerminalSubsystemThreshold &&
|
||||
EffectiveCognition(attacker) > 1.15;
|
||||
var damage = settings.DefaultWeaponDamage * hitQuality *
|
||||
(subsystemHit ? 1.0 + settings.SubsystemHitDamageBonus : 1.0);
|
||||
|
||||
ApplyDamage(target, damage);
|
||||
SetStat(attacker, Heat, GetStat(attacker, Heat) + settings.WeaponHeat);
|
||||
SetStat(attacker, MunitionPressure, GetStat(attacker, MunitionPressure) + confidence * 0.1);
|
||||
weaponState.Firing = true;
|
||||
weaponState.CoolingDown = true;
|
||||
weaponState.CooldownProgress = settings.WeaponCooldownSeconds;
|
||||
weaponState.LockProgress = confidence;
|
||||
weaponState.LockTargetEntityIndex = target.EntityIndex;
|
||||
engagements.Add(new AetheriaDaemonCombatEngagementReport
|
||||
{
|
||||
AttackerEntityIndex = attacker.EntityIndex,
|
||||
TargetEntityIndex = target.EntityIndex,
|
||||
TrackConfidence = confidence,
|
||||
HitQuality = hitQuality,
|
||||
DamageApplied = damage,
|
||||
SubsystemQualityHit = subsystemHit
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static void StepThermalAndCognition(
|
||||
IReadOnlyList<AetheriaRuntimeEntitySnapshotCommit> entities,
|
||||
double deltaSeconds,
|
||||
AetheriaDaemonCombatKernelSettings settings)
|
||||
{
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
SetStat(entity, Heat, Math.Max(0, GetStat(entity, Heat) - settings.HeatDissipationPerSecond * deltaSeconds));
|
||||
SetStat(entity, CognitiveLoad, Math.Max(0, GetStat(entity, CognitiveLoad) - settings.CognitiveLoadDecayPerSecond * deltaSeconds));
|
||||
entity.IsActive = IsAlive(entity);
|
||||
if (!entity.IsActive)
|
||||
{
|
||||
entity.VelocityX = 0;
|
||||
entity.VelocityY = 0;
|
||||
entity.TargetEntityIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnsureCombatStats(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog,
|
||||
AetheriaDaemonCombatKernelSettings settings)
|
||||
{
|
||||
var hullItem = catalog?.FindItem(entity.HullItemKey ?? "");
|
||||
EnsureStat(entity, Hull, ResolveHull(entity, hullItem, settings));
|
||||
EnsureStat(entity, Shield, settings.DefaultShield);
|
||||
EnsureStat(entity, Heat, 0.0);
|
||||
EnsureStat(entity, HeatCapacity, ResolveHeatCapacity(entity, catalog, hullItem, settings));
|
||||
EnsureStat(entity, Signature, settings.DefaultSignature);
|
||||
EnsureStat(entity, SignatureMasking, settings.DefaultSignatureMasking);
|
||||
EnsureStat(entity, SensorSensitivity, settings.DefaultSensorSensitivity);
|
||||
EnsureStat(entity, Cognition, settings.DefaultCognition);
|
||||
EnsureStat(entity, CognitiveLoad, 0.0);
|
||||
EnsureStat(entity, FireControl, settings.DefaultFireControl);
|
||||
EnsureStat(entity, MunitionPressure, 0.0);
|
||||
if (!entity.IsActive && GetStat(entity, Hull) > 0)
|
||||
entity.IsActive = true;
|
||||
}
|
||||
|
||||
private static double ResolveTrackGain(
|
||||
AetheriaRuntimeEntitySnapshotCommit observer,
|
||||
AetheriaRuntimeEntitySnapshotCommit target,
|
||||
double deltaSeconds,
|
||||
AetheriaDaemonCombatKernelSettings settings)
|
||||
{
|
||||
var distanceFactor = 1.0 + Distance(observer, target) / Math.Max(1.0, settings.SensorFalloffDistance);
|
||||
distanceFactor *= distanceFactor;
|
||||
var masking = 1.0 + Math.Max(0.0, GetStat(target, SignatureMasking));
|
||||
var sensor = Math.Max(0.05, GetStat(observer, SensorSensitivity));
|
||||
var cognition = Math.Max(0.05, EffectiveCognition(observer));
|
||||
var signature = ResolveSignature(target, settings);
|
||||
return deltaSeconds * settings.TrackResolutionPerSecond * sensor * cognition * signature / (distanceFactor * masking);
|
||||
}
|
||||
|
||||
private static double ResolveSignature(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
AetheriaDaemonCombatKernelSettings settings)
|
||||
{
|
||||
var capacity = Math.Max(1.0, GetStat(entity, HeatCapacity));
|
||||
var heatRatio = GetStat(entity, Heat) / capacity;
|
||||
var speed = Math.Sqrt(entity.VelocityX * entity.VelocityX + entity.VelocityY * entity.VelocityY);
|
||||
return Math.Max(
|
||||
0.05,
|
||||
GetStat(entity, Signature) +
|
||||
heatRatio * settings.HeatSignatureScale +
|
||||
speed * settings.MovementSignatureScale);
|
||||
}
|
||||
|
||||
private static double ResolveHitQuality(
|
||||
AetheriaRuntimeEntitySnapshotCommit attacker,
|
||||
AetheriaRuntimeEntitySnapshotCommit target,
|
||||
double confidence)
|
||||
{
|
||||
var fireControl = Math.Max(0.05, GetStat(attacker, FireControl));
|
||||
var cognition = Math.Max(0.05, EffectiveCognition(attacker));
|
||||
var masking = Math.Max(0.0, GetStat(target, SignatureMasking));
|
||||
var speed = Math.Sqrt(target.VelocityX * target.VelocityX + target.VelocityY * target.VelocityY);
|
||||
var targetDifficulty = 1.0 + masking * 0.35 + speed * 0.003;
|
||||
var quality = (0.45 + confidence * 0.75) * fireControl * (0.75 + cognition * 0.25) / targetDifficulty;
|
||||
return Clamp(quality, 0.08, 1.75);
|
||||
}
|
||||
|
||||
private static double ResolveHull(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
AetheriaRuntimeCatalogItem? hullItem,
|
||||
AetheriaDaemonCombatKernelSettings settings)
|
||||
{
|
||||
if (hullItem?.HullArmor > 0)
|
||||
return hullItem.HullArmor;
|
||||
if (hullItem?.Durability > 0)
|
||||
return hullItem.Durability;
|
||||
return string.Equals(entity.Kind, "station", StringComparison.OrdinalIgnoreCase)
|
||||
? settings.DefaultHull * 3.0
|
||||
: settings.DefaultHull;
|
||||
}
|
||||
|
||||
private static double ResolveHeatCapacity(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog,
|
||||
AetheriaRuntimeCatalogItem? hullItem,
|
||||
AetheriaDaemonCombatKernelSettings settings)
|
||||
{
|
||||
var heatCapacity = CapacityFromItem(hullItem);
|
||||
foreach (var slot in entity.Equipment ?? Array.Empty<AetheriaRuntimeLoadoutItemSlotCommit>())
|
||||
heatCapacity += CapacityFromItem(catalog?.FindItem(slot?.Item?.ItemKey ?? ""));
|
||||
return heatCapacity > 0 ? heatCapacity : settings.DefaultHeatCapacity;
|
||||
}
|
||||
|
||||
private static double CapacityFromItem(AetheriaRuntimeCatalogItem? item)
|
||||
{
|
||||
if (item == null)
|
||||
return 0.0;
|
||||
return Math.Max(0.0, item.Mass) * Math.Max(0.0, item.SpecificHeat);
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeWeaponStateCommit EnsureKernelWeaponState(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
AetheriaDaemonCombatKernelSettings settings)
|
||||
{
|
||||
var states = (entity.WeaponStates ?? Array.Empty<AetheriaRuntimeWeaponStateCommit>()).ToList();
|
||||
var state = states.FirstOrDefault(candidate =>
|
||||
candidate != null &&
|
||||
string.Equals(candidate.OwnerKind, KernelWeaponOwner, StringComparison.Ordinal) &&
|
||||
candidate.OwnerIndex == entity.EntityIndex);
|
||||
if (state != null)
|
||||
return state;
|
||||
|
||||
state = new AetheriaRuntimeWeaponStateCommit
|
||||
{
|
||||
OwnerKind = KernelWeaponOwner,
|
||||
OwnerIndex = entity.EntityIndex,
|
||||
BehaviorIndex = 0,
|
||||
BehaviorKind = "AbstractCombatKernel",
|
||||
Ammo = -1,
|
||||
BurstInterval = settings.WeaponCooldownSeconds,
|
||||
LockTargetEntityIndex = -1
|
||||
};
|
||||
states.Add(state);
|
||||
entity.WeaponStates = states.ToArray();
|
||||
return state;
|
||||
}
|
||||
|
||||
private static double EffectiveCognition(AetheriaRuntimeEntitySnapshotCommit entity)
|
||||
{
|
||||
return GetStat(entity, Cognition) / (1.0 + Math.Max(0.0, GetStat(entity, CognitiveLoad)));
|
||||
}
|
||||
|
||||
private static double ContactConfidence(AetheriaRuntimeEntitySnapshotCommit observer, int targetEntityIndex)
|
||||
{
|
||||
return (observer.Contacts ?? Array.Empty<AetheriaRuntimeEntityContactCommit>())
|
||||
.FirstOrDefault(contact => contact.TargetEntityIndex == targetEntityIndex)
|
||||
?.InfoGathered ?? 0.0;
|
||||
}
|
||||
|
||||
private static bool Hostile(
|
||||
AetheriaRuntimeEntitySnapshotCommit left,
|
||||
AetheriaRuntimeEntitySnapshotCommit right)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(left.FactionKey) || string.IsNullOrWhiteSpace(right.FactionKey))
|
||||
return false;
|
||||
return !string.Equals(left.FactionKey, right.FactionKey, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private static bool IsAlive(AetheriaRuntimeEntitySnapshotCommit entity)
|
||||
{
|
||||
return entity.IsActive && GetStat(entity, Hull) > 0;
|
||||
}
|
||||
|
||||
private static void ApplyDamage(AetheriaRuntimeEntitySnapshotCommit target, double damage)
|
||||
{
|
||||
var shield = GetStat(target, Shield);
|
||||
var shieldDamage = Math.Min(shield, damage);
|
||||
if (shieldDamage > 0)
|
||||
{
|
||||
SetStat(target, Shield, shield - shieldDamage);
|
||||
damage -= shieldDamage;
|
||||
}
|
||||
|
||||
if (damage > 0)
|
||||
SetStat(target, Hull, Math.Max(0, GetStat(target, Hull) - damage));
|
||||
}
|
||||
|
||||
private static void EnsureStat(AetheriaRuntimeEntitySnapshotCommit entity, string name, double value)
|
||||
{
|
||||
if (!HasStat(entity, name))
|
||||
SetStat(entity, name, value);
|
||||
}
|
||||
|
||||
private static bool HasStat(AetheriaRuntimeEntitySnapshotCommit entity, string name)
|
||||
{
|
||||
return (entity.StatGrids ?? Array.Empty<AetheriaRuntimeEntityStatGridCommit>())
|
||||
.Any(grid => string.Equals(grid?.Name, name, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
private static double GetStat(AetheriaRuntimeEntitySnapshotCommit entity, string name)
|
||||
{
|
||||
var grid = (entity.StatGrids ?? Array.Empty<AetheriaRuntimeEntityStatGridCommit>())
|
||||
.FirstOrDefault(candidate => string.Equals(candidate?.Name, name, StringComparison.OrdinalIgnoreCase));
|
||||
if (grid?.Values == null || grid.Values.Count == 0)
|
||||
return 0.0;
|
||||
return grid.Values.Average();
|
||||
}
|
||||
|
||||
private static void SetStat(AetheriaRuntimeEntitySnapshotCommit entity, string name, double value)
|
||||
{
|
||||
var grids = (entity.StatGrids ?? Array.Empty<AetheriaRuntimeEntityStatGridCommit>()).ToList();
|
||||
var index = grids.FindIndex(candidate => string.Equals(candidate?.Name, name, StringComparison.OrdinalIgnoreCase));
|
||||
var grid = new AetheriaRuntimeEntityStatGridCommit
|
||||
{
|
||||
Name = name,
|
||||
Width = 1,
|
||||
Height = 1,
|
||||
Values = new[] { double.IsFinite(value) ? value : 0.0 }
|
||||
};
|
||||
if (index >= 0)
|
||||
grids[index] = grid;
|
||||
else
|
||||
grids.Add(grid);
|
||||
entity.StatGrids = grids;
|
||||
}
|
||||
|
||||
private static double Distance(AetheriaRuntimeEntitySnapshotCommit left, AetheriaRuntimeEntitySnapshotCommit right)
|
||||
{
|
||||
var dx = right.PositionX - left.PositionX;
|
||||
var dy = right.PositionZ - left.PositionZ;
|
||||
return Math.Sqrt(dx * dx + dy * dy);
|
||||
}
|
||||
|
||||
private static double Clamp01(double value)
|
||||
{
|
||||
return Clamp(value, 0.0, 1.0);
|
||||
}
|
||||
|
||||
private static double ClampNonNegative(double value)
|
||||
{
|
||||
return double.IsFinite(value) && value > 0 ? value : 0.0;
|
||||
}
|
||||
|
||||
private static double Clamp(double value, double min, double max)
|
||||
{
|
||||
if (!double.IsFinite(value))
|
||||
return min;
|
||||
if (value < min)
|
||||
return min;
|
||||
return value > max ? max : value;
|
||||
}
|
||||
}
|
||||
|
|
@ -49,17 +49,10 @@ renderer-side commit authority.
|
|||
`Aetheria.State.Daemon` owns the long-running `aetheria-daemon` heartbeat and
|
||||
publishes `starting`, `running`, and `stopping` states through `Aetheria.State`;
|
||||
legacy outbox status remains operation telemetry, not daemon-session ownership.
|
||||
The daemon also owns the first deterministic abstract combat kernel. That
|
||||
kernel consumes native runtime run/zone/entity snapshot commits directly and
|
||||
mutates those same snapshot rows: stat grids for hull, shield, heat, thermal
|
||||
capacity, signature masking, cognition, cognitive load, fire control, and
|
||||
munition pressure; contact rows for track confidence and visibility; and native
|
||||
weapon-state rows for abstract firing and lock state. It is meant for
|
||||
out-of-view combat advancement and balance simulation without creating a second
|
||||
private combat state model. The current C# host exposes it behind
|
||||
`--abstract-combat-kernel` while the older shared daemon simulation remains the
|
||||
default compatibility path. The promotion path is to move this authority into
|
||||
the Rust daemon/Ymir simulation body, not into Unity or a renderer package.
|
||||
The daemon has one combat writer in `AetheriaRuntimeDaemonSimulation`.
|
||||
Projectile movement and contact are delegated to Ymir through the projectile
|
||||
physics port. Combat state remains in the native run/zone/entity snapshot graph;
|
||||
there is no separate abstract combat save model or optional second writer.
|
||||
Unity Eve surfaces construct typed `gamecult.eve.command.v1` command documents.
|
||||
`AetheriaRuntimeVerseClient` is the shared CultMesh client boundary for
|
||||
headless, Unity, and non-Unity runtimes. Typed command clients submit directly
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ flowchart TD
|
|||
Tick["Tick runner"]
|
||||
Ops["Operations executor\nmutates run checkpoint"]
|
||||
Sim["Daemon sim\nmovement, AI, combat, contacts"]
|
||||
CombatKernel["Abstract combat kernel\nnative snapshots, pressure clocks"]
|
||||
Frame["Frame document\nrun snapshot + facts"]
|
||||
Projection["Game viewport documents\nviewport, gravity, inventory"]
|
||||
Publications["Publications\nCultNet records, .cc files, RUDP snapshots, Eve surfaces"]
|
||||
|
|
@ -44,9 +43,7 @@ flowchart TD
|
|||
Authority --> Tick
|
||||
Tick --> Ops
|
||||
Ops --> Sim
|
||||
Ops --> CombatKernel
|
||||
Sim --> Frame
|
||||
CombatKernel --> Frame
|
||||
Frame --> Projection
|
||||
Frame --> Publications
|
||||
Projection --> Publications
|
||||
|
|
@ -86,7 +83,6 @@ These files define the deprecated reference surface. They should be treated as A
|
|||
| Command application | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperations.cs` | Current meaning of every gameplay command and rejection. |
|
||||
| Tick composition | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonTickRunner.cs` | Current order of command filtering, operation execution, sim step, frame creation, publication payloads. |
|
||||
| Daemon sim | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs` | Existing movement, hostile AI, combat, heat, and contact rules. |
|
||||
| Abstract combat kernel | `Aetheria.State.Daemon/AetheriaDaemonCombatKernel.cs` | Daemon-owned deterministic combat pressure model over native run/zone/entity snapshot commits. This is the first out-of-view combat oracle shape and should be promoted into the Rust daemon simulation body, not into Unity. |
|
||||
| Game viewport documents | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeGameViewportDocuments.cs` | Existing map, object, gravity, selected object, docking, refit, sector, and inventory projections. |
|
||||
| Client facade | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaClient.cs` | C# client observation and typed operation ergonomics. |
|
||||
| Verse client | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs` | Current lower-level typed document reads/watches and command submission. |
|
||||
|
|
@ -98,40 +94,13 @@ These files define the deprecated reference surface. They should be treated as A
|
|||
| Ymir Unity bridge | `Assets/Scripts/Gameplay/Physics/AetheriaYmirPhysicsBridge.cs` | Current Unity presentation adapter that maps daemon SoA bodies into typed Ymir query worlds. |
|
||||
| Ymir query tests | `Assets/Scripts/Tests/YmirPhysicsQueryTests.cs` | Current expectations for integration, radial fields, contacts, overlap sphere/circle, and cast sphere/circle; useful semantics should survive, DTO/endpoint shape should not. |
|
||||
|
||||
## Abstract Combat Kernel
|
||||
## Combat Ownership
|
||||
|
||||
`Aetheria.State.Daemon/AetheriaDaemonCombatKernel.cs` is the first daemon-owned
|
||||
combat oracle for out-of-view simulation and balance runs. It is deliberately
|
||||
not a Unity feature and not a renderer projection. Its input is the same native
|
||||
`AetheriaRuntimeRunCheckpointCommit` graph the daemon already publishes in
|
||||
frames: zones, entities, stat grids, contacts, weapon states, target indices,
|
||||
factions, velocities, equipment, and optional runtime catalog facts. Its output
|
||||
is mutation of that same graph plus a transient step report for smoke tests and
|
||||
future balance harnesses.
|
||||
|
||||
The current kernel models pressure rather than rendered combat:
|
||||
|
||||
- thermal pressure through `heat` and `heat-capacity` stat grids;
|
||||
- detection pressure through `signature`, `signature-masking`,
|
||||
`sensor-sensitivity`, and native contact confidence rows;
|
||||
- cognition pressure through `cognition`, `cognitive-load`, and
|
||||
`fire-control` stat grids;
|
||||
- munition/commitment pressure through `munition-pressure`, native
|
||||
`AetheriaRuntimeWeaponStateCommit` rows, launch thresholds, lock confidence,
|
||||
and subsystem-quality damage bonuses.
|
||||
|
||||
The invariant is state compatibility. Out-of-view combat must be able to become
|
||||
visible combat by handing the frame back to a client or future presentation
|
||||
runtime without translating a private oracle state. Mechanics not yet present in
|
||||
visible gameplay may exist as named stat grids or transient reports, but they
|
||||
must not become a hidden second save model.
|
||||
|
||||
The C# host currently gates the kernel behind `--abstract-combat-kernel` because
|
||||
`AetheriaRuntimeDaemonTickRunner` still calls the older shared daemon
|
||||
simulation. That is a temporary compatibility boundary, not a second owner. The
|
||||
rebuild target is one daemon simulation body where command application,
|
||||
abstract combat, visible physics, contacts, heat, and publications all commit to
|
||||
the same typed state primitive.
|
||||
Combat has one live writer in `AetheriaRuntimeDaemonSimulation`. Projectile
|
||||
movement and contact are delegated through `IAetheriaRuntimeProjectilePhysics`
|
||||
to Ymir. The abandoned abstract pressure-model kernel was deleted rather than
|
||||
ported; it had no production caller and would have created a second authority
|
||||
over contacts, damage, heat, and weapon cooldowns.
|
||||
|
||||
## Current Control Flow
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ validation proves contract shape, not wiring, exclusivity, lowering, or parity.
|
|||
| Flight intent | `Ship`, `Thruster`, `AetherDrive`, input paths | daemon intent + Ymir physics | analog movement/look/tractor | EveUnity input driver | simplified daemon path wired; Ymir not wired | thrust allocation, torque, energy, heat, drag and gravity |
|
||||
| Collision | Unity physics and entity handlers | Ymir | collision/result facts | visual interpolation only | owner-exists; not wired; not exclusive | link Aetheria to Ymir.Core/service, share one world, and fail old-writer negative checks |
|
||||
| Targeting/contacts | sensors + `ActionGameManager` | daemon | contact/target semantics | target HUD and indicators | simplified owner wired/projected; not parity | visibility/nearest/explicit/lock cases |
|
||||
| Projectile flight | weapon/projectile classes | Ymir | projectile entity/event projection | native projectile visual | local substitutes only | remove both Aetheria-local steppers; prove spawn/travel/hit/despawn through one Ymir world |
|
||||
| Projectile flight | weapon/projectile classes | Ymir | projectile entity/event projection | native projectile visual | Ymir.Core adapter wired for spawn/travel/contact/despawn; native presentation and broader weapon parity incomplete | prove every authored projectile family and runtime visual lifecycle |
|
||||
| Shield/hull damage | energy-funded shield, armor cells, equipment and hull | daemon | entity status + damage events | meters, impacts, damage VFX | synthetic scalar owner wired; not parity | typed absorption, penetration, item damage and death causes |
|
||||
| Thermal/energy | cell conduction and capacitor/reactor/radiator network | daemon | ship/equipment status and warnings | schematic/post effects | cell conduction/radiation wired; energy network and medical thresholds remain reference | capacitor/reactor/radiator ordering, shared energy and medical timelines |
|
||||
| Weapons | ServerShared behaviors + Unity effects | daemon + Ymir where spatial | action capability, weapon state, attack events | effects/audio/HUD | one synthetic weapon wired; original engine reference-only | each weapon family |
|
||||
|
|
@ -42,7 +42,7 @@ validation proves contract shape, not wiring, exclusivity, lowering, or parity.
|
|||
| 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 | decaying sources and observer information thresholds | daemon | contacts and ping events | indicators/maps | reference | threshold, decay, ping and classification timelines |
|
||||
| AI/tasks | corporation task scheduler plus agent state machines | daemon | commander task board and shared semantic controls | Eve commander/pilot clients | explore, attack, same-zone haul, and persistent orbit patrol wired through shared commands; capability/priority assignment and rejected-transfer behavior proven | original optimum-range control, cross-zone haul, mining, towing, survey-tool timelines, cancellation and reconnect |
|
||||
| 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, attack, same-zone haul, mining/offload, resource surveying, physical station towing, and persistent orbit patrol wired through shared commands; capability/priority assignment and rejection behavior proven | optimum-range control, cross-zone logistics, cancellation, reconnect, and live commander lowering |
|
||||
| Consumables | cargo-backed timed behavior containers | daemon | dynamic actions and active effects | action bar/schematic | reference | consume, stacking, duration and cleanup |
|
||||
|
||||
## Ownership Invariants
|
||||
|
|
@ -78,36 +78,33 @@ validation proves contract shape, not wiring, exclusivity, lowering, or parity.
|
|||
|
||||
These are source-confirmed ownership failures, not feature backlog:
|
||||
|
||||
1. **Split combat writers.** Normal daemon simulation and the optional abstract
|
||||
combat kernel can both mutate combat state in one tick. Select one combat
|
||||
owner and delete the other's write path.
|
||||
2. **Physics delegation is incomplete.** Daemon projectile integration and
|
||||
1. **Physics delegation is incomplete.** Daemon projectile integration and
|
||||
contacts now use `Ymir.Core`, but ship flight, tractor, gravity, docking
|
||||
placement, and the Unity bridge/query path remain outside that authority.
|
||||
3. **Persisted behavior is not executable behavior.** Snapshot schemas preserve
|
||||
2. **Persisted behavior is not executable behavior.** Snapshot schemas preserve
|
||||
broad equipment/behavior state while active simulation executes one
|
||||
synthetic projectile weapon and simplified raider pursuit.
|
||||
4. **Client feedback lacks authoritative chronology.** Hits, lock transitions,
|
||||
3. **Client feedback lacks authoritative chronology.** Hits, lock transitions,
|
||||
damage topology, weapon transitions, death causes, effects, and drops have
|
||||
no complete deduplicated event stream.
|
||||
5. **View composition is implicit.** Provider prefabs contain pilot and map
|
||||
4. **View composition is implicit.** Provider prefabs contain pilot and map
|
||||
subviews, but portable render channels, entity presentation graphs, effects,
|
||||
attachment sockets, and map products are not yet first-class contracts.
|
||||
6. **The game loop has no single daemon owner.** Exploration, discovery,
|
||||
5. **The game loop has no single daemon owner.** Exploration, discovery,
|
||||
encounter, loot, docking, trade, refit, narrative, boss progression,
|
||||
completion, failure, and continue exist as pieces rather than one explicit
|
||||
run-state machine.
|
||||
7. **Two Aetheria-local spatial owners.** Daemon projectile stepping and the
|
||||
6. **Two Aetheria-local spatial owners.** Daemon ship movement and the
|
||||
Unity bridge/query path independently implement Ymir-shaped behavior and can
|
||||
disagree while standalone Ymir remains unwired.
|
||||
8. **Live conformance has no complete owner.** Static provider packs can pass
|
||||
7. **Live conformance has no complete owner.** Static provider packs can pass
|
||||
while daemon, runtime, or split-target dependencies are absent. The current
|
||||
Eve consumer smoke fails because its expected EveElectron proof is missing.
|
||||
9. **Normative native presentation has no implemented owner.** Render channels,
|
||||
8. **Normative native presentation has no implemented owner.** Render channels,
|
||||
presentation graphs, map products, attachment/effect lifecycles, material
|
||||
profiles, and source-version diagnostics are assigned in specification but
|
||||
lack complete Eve contracts and EveUnity lowerers.
|
||||
10. **Original-game acceptance lacks an evidence ledger.** No current owner
|
||||
9. **Original-game acceptance lacks an evidence ledger.** No current owner
|
||||
records fossil baseline, target state timeline, commands/receipts, rendered
|
||||
captures, and negative-writer checks as one scenario result.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue