diff --git a/Aetheria.State.Daemon.Smoke/Program.cs b/Aetheria.State.Daemon.Smoke/Program.cs index a348ff62b..2b7b9e14c 100644 --- a/Aetheria.State.Daemon.Smoke/Program.cs +++ b/Aetheria.State.Daemon.Smoke/Program.cs @@ -15,8 +15,8 @@ internal sealed class AetheriaDaemonYmirSmokeChecks ConstantWeaponRunsOnDaemonThroughYmirBeamContact(); ChargedWeaponCannotBypassChargeLifecycle(); ChargedWeaponHoldRiskMalfunctionsDeterministically(); - DaemonSimulationAppliesYmirHit(); - ProjectileDeathEmitsOnce(); + DaemonSimulationTreatsYmirHitAsPresentationOnly(); + ProjectileContactCannotKill(); MissingPhysicsOwnerCannotAdvanceProjectiles(); MissingWorldPhysicsOwnerCannotAdvanceShips(); TractorRampsAndPullsThroughYmirWithoutTeleportingCargo(); @@ -955,6 +955,12 @@ internal sealed class AetheriaDaemonYmirSmokeChecks "one empty magazine must consume exactly one reserve cargo commodity before reload"); Require(run.GameEvents.Count(value => value.Kind == "projectile.launched" && value.ItemKey == "test-lock-cannon") >= 6, "two authored bursts must emit all six due rounds through the projectile owner"); + Require(run.ShotReceipts.Count(value => value.WeaponItemKey == "test-lock-cannon") >= 6 && + run.ShotReceipts.All(value => value.Hit && value.AppliedDamage == value.NominalDamage), + "zero-spread authored rounds must commit immutable certain-hit receipts before presentation travel"); + Require(run.ShotReceipts.Select(value => value.ShotId).Distinct(StringComparer.Ordinal).Count() == + run.ShotReceipts.Count, + "every burst round must own a stable independent shot identity"); Require(run.GameEvents.Count(value => value.Kind == "weapon.reload.started") == 1 && run.GameEvents.Count(value => value.Kind == "weapon.reload.completed") == 1, "empty magazine transition must publish one authoritative reload start and completion pair"); @@ -964,11 +970,18 @@ internal sealed class AetheriaDaemonYmirSmokeChecks value.Kind == "projectile.launched" && value.FrameId > reloadStarted && value.FrameId < reloadCompleted), "reload interval must be a projectile-free authoritative timeline, not a cosmetic client delay"); Require(!target.IsActive, - $"attack task must end through daemon damage after Ymir projectile contacts; hull={Stat(target, "hull"):0.###} " + + $"attack task must end through daemon shot resolution before presentation projectile contacts; hull={Stat(target, "hull"):0.###} " + $"agent={agent.PositionX:0.###},{agent.PositionZ:0.###} target={target.PositionX:0.###},{target.PositionZ:0.###} " + $"projectiles={run.Zones[0].Projectiles.Count} task={run.AgentTasks.Single().Status}"); RequireEqual(AetheriaRuntimeAgentTaskStatuses.Completed, run.AgentTasks.Single().Status, "attack task must complete when its target dies"); + var shotSurface = AetheriaRuntimeDaemonGameSurfaceBuilder.Build( + new AetheriaRuntimeDaemonFrameDocument { FrameId = 60, Run = run }, + new AetheriaRuntimeDaemonHealthDocument(), + AetheriaRuntimeDaemonCommandBoundaryDocument.Create("daemon")); + Require(Flatten(shotSurface.Surface.Root).Any(node => node.Kind == "shot.receipt" && + node.Props["itemKey"] == "test-lock-cannon" && node.Props["outcome"] == "hit"), + "Eve must project inspectable deterministic shot receipts without reconstructing combat"); } private static void AttackTaskAdmissionRejectsImpossibleWork() @@ -1528,7 +1541,7 @@ internal sealed class AetheriaDaemonYmirSmokeChecks RequireEqual("aetheria.daemon.entity.2", step.Hits[0].TargetBodyId, "entity body id must be stable"); } - private static void DaemonSimulationAppliesYmirHit() + private static void DaemonSimulationTreatsYmirHitAsPresentationOnly() { var (run, _, target) = Scenario(); @@ -1540,12 +1553,12 @@ internal sealed class AetheriaDaemonYmirSmokeChecks new AetheriaYmirProjectilePhysics(), new AetheriaYmirWorldPhysics()); - RequireEqual(88.0, Stat(target, "hull"), "Aetheria must interpret the Ymir contact as damage"); + RequireEqual(100.0, Stat(target, "hull"), "presentation projectile contact must not write combat damage"); RequireEqual(0, run.Zones[0].Projectiles.Count, "spent projectile must leave daemon state"); RequireEqual(1, run.GameEvents.Count(value => value.Kind == "projectile.impact" && value.SubjectKey == "smoke-projectile"), "Ymir contact must emit one projectile-identity impact event"); - RequireEqual(1, run.GameEvents.Count(value => value.Kind == "entity.damaged" && value.TargetEntityIndex == target.EntityIndex), - "daemon damage interpretation must emit one target damage event"); + RequireEqual(0, run.GameEvents.Count(value => value.Kind == "entity.damaged" && value.TargetEntityIndex == target.EntityIndex), + "presentation projectile contact must not manufacture a damage event"); var feedback = AetheriaRuntimeDaemonGameSurfaceBuilder.Build( new AetheriaRuntimeDaemonFrameDocument { FrameId = 0, Run = run }, new AetheriaRuntimeDaemonHealthDocument(), @@ -1554,15 +1567,16 @@ internal sealed class AetheriaDaemonYmirSmokeChecks "Eve feedback must project authoritative projectile impact identity"); } - private static void ProjectileDeathEmitsOnce() + private static void ProjectileContactCannotKill() { var (run, _, target) = Scenario(); target.StatGrids.Single(grid => grid.Name == "hull").Values = [5]; AetheriaRuntimeDaemonSimulation.Step(run, new AetheriaRuntimeDaemonIntentState(), 0.1, AetheriaRuntimeDaemonSimulationSettings.AetheriaDefault, new AetheriaYmirProjectilePhysics(), new AetheriaYmirWorldPhysics(), frameId: 9); - Require(!target.IsActive, "lethal Ymir projectile contact must deactivate target"); - RequireEqual(1, run.GameEvents.Count(value => value.Kind == "entity.destroyed" && value.TargetEntityIndex == target.EntityIndex), - "alive-to-dead transition must emit one destruction event"); + Require(target.IsActive && Math.Abs(Stat(target, "hull") - 5) < 0.000001, + "even nominally lethal presentation contact must leave canonical target state untouched"); + RequireEqual(0, run.GameEvents.Count(value => value.Kind == "entity.destroyed" && value.TargetEntityIndex == target.EntityIndex), + "presentation contact must not manufacture a destruction event"); } private static void MissingPhysicsOwnerCannotAdvanceProjectiles() diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs index 15c1af826..febe792cf 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs @@ -38,6 +38,7 @@ namespace GameCult.Aetheria.State.Verse run.CurrentEntityKey, frame.SimulationSettings), FeedbackStream(run, frame.FrameId), + ShotReceiptStream(run), GravityFieldSurface("aetheria.daemon.game.field"), MainMenuOverlay("aetheria.daemon.game.main_menu", activeMainMenuSurfaceId), Node( @@ -300,6 +301,39 @@ namespace GameCult.Aetheria.State.Verse return Node("aetheria.daemon.game.feedback", "feedback.stream", new[] { ("retainedCount", events.Length.ToString(CultureInfo.InvariantCulture)) }, events); } + private static AetheriaRuntimeSurfaceComponent ShotReceiptStream(AetheriaRuntimeRunCheckpointCommit run) + { + var receipts = (run.ShotReceipts ?? Array.Empty()) + .Where(value => value != null) + .OrderBy(value => value.FrameId) + .ThenBy(value => value.ShotId, StringComparer.Ordinal) + .Select(value => Node( + $"aetheria.daemon.game.shots.{SurfaceToken(value.ShotId)}", + "shot.receipt", + new[] + { + ("shotId", value.ShotId), ("outcome", value.Outcome), + ("frameId", value.FrameId.ToString(CultureInfo.InvariantCulture)), + ("zoneIndex", value.ZoneIndex.ToString(CultureInfo.InvariantCulture)), + ("sourceEntityIndex", value.SourceEntityIndex.ToString(CultureInfo.InvariantCulture)), + ("targetEntityIndex", value.TargetEntityIndex.ToString(CultureInfo.InvariantCulture)), + ("itemKey", value.WeaponItemKey), + ("contactInformation", FormatNumber(value.ContactInformation)), + ("lockQuality", FormatNumber(value.LockQuality)), + ("rangeFactor", FormatNumber(value.RangeFactor)), + ("motionFactor", FormatNumber(value.MotionFactor)), + ("dispersionFactor", FormatNumber(value.DispersionFactor)), + ("hitProbability", FormatNumber(value.HitProbability)), + ("hitRoll", FormatNumber(value.HitRoll)), + ("hit", value.Hit ? "true" : "false"), + ("nominalDamage", FormatNumber(value.NominalDamage)), + ("appliedDamage", FormatNumber(value.AppliedDamage)) + })) + .ToArray(); + return Node("aetheria.daemon.game.shots", "shot.receipt-stream", + new[] { ("retainedCount", receipts.Length.ToString(CultureInfo.InvariantCulture)) }, receipts); + } + private static AetheriaRuntimeSurfaceComponent BuildSurveyKnowledge(AetheriaRuntimeRunCheckpointCommit run) { var entries = (run.CorporationSurveys ?? Array.Empty()) diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs index 7a0654a6e..8fe337636 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs @@ -324,6 +324,7 @@ namespace GameCult.Aetheria.State.Verse weapon.State.BurstRemaining--; weapon.State.BurstTimer -= weapon.State.BurstInterval; var projectile = SpawnProjectile(zone, attacker, target, weapon, settings); + CommitShotResolution(run, zone, attacker, target, weapon, projectile, frameId); AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit { EventId = $"projectile:{projectile.ProjectileId}:launched", Kind = "projectile.launched", FrameId = frameId, ZoneIndex = zone.ZoneIndex, SourceEntityIndex = attacker.EntityIndex, TargetEntityIndex = target.EntityIndex, SubjectKey = projectile.ProjectileId, ItemKey = projectile.WeaponKind, ScalarValue = projectile.Damage, PositionX = projectile.PositionX, PositionZ = projectile.PositionZ }); weapon.State.Firing = true; AetheriaRuntimeThermalSimulation.AddHeat(attacker, weapon.Heat); @@ -342,12 +343,7 @@ namespace GameCult.Aetheria.State.Verse { if (byIndex.TryGetValue(hit.TargetEntityIndex, out var target)) { - var aliveBefore = IsAlive(target); - Damage(target, hit.Projectile.Damage); AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit { EventId = $"projectile:{hit.Projectile.ProjectileId}:impact", Kind = "projectile.impact", FrameId = frameId, ZoneIndex = zone.ZoneIndex, SourceEntityIndex = hit.Projectile.SourceEntityIndex, TargetEntityIndex = target.EntityIndex, SubjectKey = hit.Projectile.ProjectileId, ItemKey = hit.Projectile.WeaponKind, ScalarValue = hit.Projectile.Damage, PositionX = hit.PointX, PositionZ = hit.PointZ }); - AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit { EventId = $"projectile:{hit.Projectile.ProjectileId}:damage", Kind = "entity.damaged", FrameId = frameId, ZoneIndex = zone.ZoneIndex, SourceEntityIndex = hit.Projectile.SourceEntityIndex, TargetEntityIndex = target.EntityIndex, SubjectKey = hit.Projectile.ProjectileId, ScalarValue = hit.Projectile.Damage, PositionX = hit.PointX, PositionZ = hit.PointZ }); - if (aliveBefore && !IsAlive(target)) - AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit { EventId = $"projectile:{hit.Projectile.ProjectileId}:destroyed:{target.EntityIndex}", Kind = "entity.destroyed", FrameId = frameId, ZoneIndex = zone.ZoneIndex, SourceEntityIndex = hit.Projectile.SourceEntityIndex, TargetEntityIndex = target.EntityIndex, SubjectKey = hit.Projectile.ProjectileId, PositionX = hit.PointX, PositionZ = hit.PointZ }); } } @@ -486,6 +482,7 @@ namespace GameCult.Aetheria.State.Verse state.BurstRemaining--; state.BurstTimer -= state.BurstInterval; var projectile = SpawnProjectile(zone, attacker, solutionTarget, shot, settings); + CommitShotResolution(run, zone, attacker, solutionTarget, shot, projectile, frameId); AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit { EventId = $"projectile:{projectile.ProjectileId}:launched", Kind = "projectile.launched", @@ -900,6 +897,94 @@ namespace GameCult.Aetheria.State.Verse .ToArray(); } + private static void CommitShotResolution( + AetheriaRuntimeRunCheckpointCommit run, + AetheriaRuntimeZoneSnapshotCommit zone, + AetheriaRuntimeEntitySnapshotCommit attacker, + AetheriaRuntimeEntitySnapshotCommit target, + ResolvedWeapon weapon, + AetheriaRuntimeProjectileCommit presentation, + long frameId) + { + var shotId = presentation.ProjectileId; + if ((run.ShotReceipts ?? Array.Empty()) + .Any(value => value != null && string.Equals(value.ShotId, shotId, StringComparison.Ordinal))) + return; + + var contact = (attacker.Contacts ?? Array.Empty()) + .FirstOrDefault(value => value != null && value.TargetEntityIndex == target.EntityIndex); + var information = Clamp01(contact?.InfoGathered ?? 0); + var lockQuality = Clamp01(weapon.State.LockProgress); + var distance = Math.Sqrt(DistanceSq(attacker, target)); + var rangeSpan = Math.Max(0.001, weapon.Range - weapon.MinRange); + var normalizedRange = Clamp01((distance - weapon.MinRange) / rangeSpan); + var rangeFactor = distance < weapon.MinRange || distance > weapon.Range ? 0 : 1 - normalizedRange * 0.35; + var dx = target.PositionX - attacker.PositionX; + var dz = target.PositionZ - attacker.PositionZ; + var length = Math.Max(0.001, Math.Sqrt(dx * dx + dz * dz)); + var relativeX = target.VelocityX - attacker.VelocityX; + var relativeZ = target.VelocityY - attacker.VelocityY; + var transverse = Math.Abs(relativeX * (-dz / length) + relativeZ * (dx / length)); + var motionFactor = 1.0 / (1.0 + transverse / Math.Max(1, weapon.ProjectileSpeed)); + var dispersionFactor = 1.0 / (1.0 + weapon.Spread); + var probability = weapon.Spread <= 0 + ? 1 + : Clamp01(information * (0.5 + 0.5 * lockQuality) * rangeFactor * motionFactor * dispersionFactor); + var roll = ShotRoll(run.GenerationSeed, shotId, "hit"); + var hit = roll < probability; + var appliedDamage = hit ? weapon.Damage : 0; + var aliveBefore = IsAlive(target); + if (hit) Damage(target, appliedDamage); + + AetheriaRuntimeShotReceipts.Append(run, new AetheriaRuntimeShotReceiptCommit + { + ShotId = shotId, FrameId = frameId, ZoneIndex = zone.ZoneIndex, + SourceEntityIndex = attacker.EntityIndex, TargetEntityIndex = target.EntityIndex, + WeaponItemKey = weapon.ItemKey, WeaponOwnerIndex = weapon.State.OwnerIndex, + WeaponBehaviorIndex = weapon.State.BehaviorIndex, ContactInformation = information, + LockQuality = lockQuality, RangeFactor = rangeFactor, MotionFactor = motionFactor, + DispersionFactor = dispersionFactor, HitProbability = probability, HitRoll = roll, + Hit = hit, NominalDamage = weapon.Damage, AppliedDamage = appliedDamage, + Outcome = hit ? "hit" : "miss" + }); + AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit + { + EventId = $"shot:{shotId}:resolved", Kind = "shot.resolved", FrameId = frameId, + ZoneIndex = zone.ZoneIndex, SourceEntityIndex = attacker.EntityIndex, + TargetEntityIndex = target.EntityIndex, SubjectKey = hit ? "hit" : "miss", + ItemKey = weapon.ItemKey, ScalarValue = probability, + PositionX = target.PositionX, PositionZ = target.PositionZ + }); + if (hit) + AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit + { + EventId = $"shot:{shotId}:damage", Kind = "entity.damaged", FrameId = frameId, + ZoneIndex = zone.ZoneIndex, SourceEntityIndex = attacker.EntityIndex, + TargetEntityIndex = target.EntityIndex, SubjectKey = shotId, + ItemKey = weapon.ItemKey, ScalarValue = appliedDamage, + PositionX = target.PositionX, PositionZ = target.PositionZ + }); + if (aliveBefore && !IsAlive(target)) + AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit + { + EventId = $"shot:{shotId}:destroyed:{target.EntityIndex}", Kind = "entity.destroyed", + FrameId = frameId, ZoneIndex = zone.ZoneIndex, SourceEntityIndex = attacker.EntityIndex, + TargetEntityIndex = target.EntityIndex, SubjectKey = shotId, + ItemKey = weapon.ItemKey, PositionX = target.PositionX, PositionZ = target.PositionZ + }); + } + + private static double ShotRoll(uint seed, string shotId, string salt) + { + unchecked + { + uint hash = seed ^ 2166136261u; + foreach (var c in (shotId ?? "") + ":" + (salt ?? "")) hash = (hash ^ c) * 16777619u; + hash ^= hash >> 16; hash *= 2246822519u; hash ^= hash >> 13; + return (hash + 1.0) / (uint.MaxValue + 2.0); + } + } + private static IReadOnlyList ResolveChargedWeapons( AetheriaRuntimeEntitySnapshotCommit entity, int requestedWeaponGroup, AetheriaRuntimeCatalogSnapshot? catalog, AetheriaRuntimeDaemonSimulationSettings settings) @@ -967,7 +1052,9 @@ namespace GameCult.Aetheria.State.Verse Math.Max(0, behavior.EvaluateStat(22)), PositiveOr(behavior.EvaluateStat(23), settings.WeaponLockAngleDegrees), PositiveOr(behavior.EvaluateStat(24), settings.WeaponLockDirectionImpact), - Math.Max(0, behavior.EvaluateStat(25))); + Math.Max(0, behavior.EvaluateStat(25)), + Math.Max(0, behavior.EvaluateStat(5)), + Math.Max(0, behavior.EvaluateStat(15))); } private static ResolvedWeapon ResolveFallbackWeapon( @@ -1168,7 +1255,8 @@ namespace GameCult.Aetheria.State.Verse double cooldown, double projectileSpeed, double heat, double energy, string ammoItemKey, int magazineSize, double reloadTime, int burstCount, double burstTime, bool singleAmmoBurst, double lockSpeed, double lockSensorImpact, - double lockAngleDegrees, double lockDirectionImpact, double lockDecayPerSecond) + double lockAngleDegrees, double lockDirectionImpact, double lockDecayPerSecond, + double minRange = 0, double spread = 0) { State = state; ItemKey = itemKey; Damage = damage; Range = range; Cooldown = cooldown; ProjectileSpeed = projectileSpeed; Heat = heat; Energy = energy; AmmoItemKey = ammoItemKey; @@ -1176,6 +1264,7 @@ namespace GameCult.Aetheria.State.Verse BurstCount = burstCount; BurstTime = burstTime; SingleAmmoBurst = singleAmmoBurst; LockSensorImpact = lockSensorImpact; LockAngleDegrees = lockAngleDegrees; LockDirectionImpact = lockDirectionImpact; LockDecayPerSecond = lockDecayPerSecond; + MinRange = minRange; Spread = spread; } public AetheriaRuntimeWeaponStateCommit State { get; } @@ -1197,6 +1286,8 @@ namespace GameCult.Aetheria.State.Verse public double LockAngleDegrees { get; } public double LockDirectionImpact { get; } public double LockDecayPerSecond { get; } + public double MinRange { get; } + public double Spread { get; } } private sealed class ResolvedConstantWeapon @@ -1245,7 +1336,8 @@ namespace GameCult.Aetheria.State.Verse Base.ProjectileSpeed * VelocityMultiplier, Base.Heat * Base.BurstCount * HeatMultiplier / count, Base.Energy * Base.BurstCount / count, Base.AmmoItemKey, Base.MagazineSize, Base.ReloadTime, count, Base.BurstTime, Base.SingleAmmoBurst, Base.LockSpeed, Base.LockSensorImpact, - Base.LockAngleDegrees, Base.LockDirectionImpact, Base.LockDecayPerSecond); + Base.LockAngleDegrees, Base.LockDirectionImpact, Base.LockDecayPerSecond, + Base.MinRange, Base.Spread); } public ResolvedWeapon Base { get; } public AetheriaRuntimeLoadoutItemCommit Item { get; } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeShotReceipts.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeShotReceipts.cs new file mode 100644 index 000000000..9a99ff6df --- /dev/null +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeShotReceipts.cs @@ -0,0 +1,26 @@ +using System; +using System.Linq; + +#nullable enable + +namespace GameCult.Aetheria.State.Verse +{ + public static class AetheriaRuntimeShotReceipts + { + public const int RetainedReceiptCount = 256; + + public static void Append(AetheriaRuntimeRunCheckpointCommit run, AetheriaRuntimeShotReceiptCommit receipt) + { + if (run == null || receipt == null || string.IsNullOrWhiteSpace(receipt.ShotId)) return; + var receipts = (run.ShotReceipts ?? Array.Empty()) + .Where(value => value != null && !string.Equals(value.ShotId, receipt.ShotId, StringComparison.Ordinal)) + .Append(receipt) + .OrderBy(value => value.FrameId) + .ThenBy(value => value.ShotId, StringComparer.Ordinal) + .ToArray(); + run.ShotReceipts = receipts.Length <= RetainedReceiptCount + ? receipts + : receipts.Skip(receipts.Length - RetainedReceiptCount).ToArray(); + } + } +} diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSnapshotDocuments.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSnapshotDocuments.cs index 161339c4b..952ef9603 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSnapshotDocuments.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSnapshotDocuments.cs @@ -207,6 +207,10 @@ namespace GameCult.Aetheria.State.Verse public IReadOnlyList GameEvents { get; set; } = Array.Empty(); + [Key(15)] + public IReadOnlyList ShotReceipts { get; set; } = + Array.Empty(); + public AetheriaRuntimeLoadoutTemplateCommit CreateLoadoutTemplate(string entityKey) { return TryParseEntityKey(entityKey, out var zoneIndex, out var entityIndex) @@ -448,6 +452,30 @@ namespace GameCult.Aetheria.State.Verse [Key(11)] public double PositionZ { get; set; } } + [MessagePackObject] + public sealed class AetheriaRuntimeShotReceiptCommit + { + [Key(0)] public string ShotId { get; set; } = ""; + [Key(1)] public long FrameId { get; set; } + [Key(2)] public int ZoneIndex { get; set; } = -1; + [Key(3)] public int SourceEntityIndex { get; set; } = -1; + [Key(4)] public int TargetEntityIndex { get; set; } = -1; + [Key(5)] public string WeaponItemKey { get; set; } = ""; + [Key(6)] public int WeaponOwnerIndex { get; set; } = -1; + [Key(7)] public int WeaponBehaviorIndex { get; set; } = -1; + [Key(8)] public double ContactInformation { get; set; } + [Key(9)] public double LockQuality { get; set; } + [Key(10)] public double RangeFactor { get; set; } + [Key(11)] public double MotionFactor { get; set; } + [Key(12)] public double DispersionFactor { get; set; } + [Key(13)] public double HitProbability { get; set; } + [Key(14)] public double HitRoll { get; set; } + [Key(15)] public bool Hit { get; set; } + [Key(16)] public double NominalDamage { get; set; } + [Key(17)] public double AppliedDamage { get; set; } + [Key(18)] public string Outcome { get; set; } = ""; + } + [MessagePackObject] public sealed class AetheriaRuntimeCorporationSurveyCommit { diff --git a/docs/original-game-migration-matrix.md b/docs/original-game-migration-matrix.md index b12c6b90c..9769cc995 100644 --- a/docs/original-game-migration-matrix.md +++ b/docs/original-game-migration-matrix.md @@ -21,8 +21,8 @@ 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 | movement intents feed Ymir-owned body integration; authored thrust allocation, torque, energy and heat remain simplified | prove original drive/equipment behavior ordering and runtime interpolation | | Collision | Unity physics and entity handlers | Ymir | collision/result facts | visual interpolation only | Ymir.Core world stepping wired for entity bodies, radial fields and contacts; missing-owner negative proof passes | publish authoritative collision events and prove Unity cannot write transforms back | | Targeting/contacts | sensors + `ActionGameManager` | daemon | contact/target semantics | target HUD and indicators | simplified owner wired/projected; daemon weapon lock now acquires and decays from facing, elapsed time, and observer-local contact confidence instead of granting an immediate perfect lock | target-switch reset, angular decay, visibility/nearest/explicit cases, and runtime lock feedback | -| 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 | +| Projectile flight | weapon/projectile classes | Eve presentation for ordinary tracers; Ymir for persistent physical payloads | derived trajectory/effect facts or persistent payload state | native projectile visual | ordinary instant/charged damage resolves from immutable daemon shot receipts at commitment; Ymir projectile contacts are feedback-only and cannot write damage; temporary projectile rows remain as presentation timing; Ymir.Core remains embedded for world integration, radial fields, circle contacts, pickups, and genuinely persistent/interceptable payloads | delete ordinary `IAetheriaRuntimeProjectilePhysics` after constant weapons and presentation trajectories consume receipts; retain Ymir for world physics and physical payloads | +| Shield/hull damage | energy-funded shield, armor cells, equipment and hull | daemon | entity status + damage events | meters, impacts, damage VFX | bounded immutable shot receipts record stable identity, observer information, lock, range, motion, dispersion, probability, roll, outcome, and applied damage; daemon applies current scalar shield-then-hull damage at shot commitment; fake or later Ymir projectile contacts cannot emit damage/destruction | cognition/signature factors, named independent entropy dimensions, miss/impact distribution, typed armor/hull/equipment grids, penetration and damage types | | 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 plus Ymir geometry/kinematics | action capability, weapon state, shot/damage receipts | effects/audio/HUD | instant and constant resource/timing lifecycles are daemon-owned; charged weapons accept one semantic request, spool without requiring a solution, hold at full charge, commit automatically when a solution appears, and perform deterministic once-per-second malfunction hazard checks after the authored safe hold interval with increasing persisted risk; generic Eve `weapon.state` exposes charge hold/risk and feedback exposes readiness, commit, refusal, and malfunction chronology | replace projectile-contact damage with `deterministic-combat-resolution.md`, then guided persistent payloads, visibility/wear, penetration, impact distribution, and Unity effect reconciliation | | Destruction/drops | entity death and pickup paths | daemon | death/drop events and world entities | effects and pickups | fragments wired; chronology and original drop transaction absent | exactly-once drops and cleanup |