Restore daemon armor cell damage
This commit is contained in:
parent
b6822f8094
commit
861b82f2ff
8 changed files with 471 additions and 29 deletions
|
|
@ -18,6 +18,7 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
DeployableRangeExpiryDetonatesAfterYmirMovement();
|
||||
CanonicalCatalogPublishesRecoveredMineLauncher();
|
||||
EnergyFundedShieldInterceptsDamageBeforeHull();
|
||||
ArmorCellsResolveBeforeEquipmentAndHull();
|
||||
DaemonSimulationTreatsYmirHitAsPresentationOnly();
|
||||
ProjectileContactCannotKill();
|
||||
MissingPhysicsOwnerCannotAdvanceProjectiles();
|
||||
|
|
@ -453,6 +454,56 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
"unfunded shield must not manufacture absorption");
|
||||
}
|
||||
|
||||
private static void ArmorCellsResolveBeforeEquipmentAndHull()
|
||||
{
|
||||
var source = Entity(0, -100, "player");
|
||||
var target = Entity(1, 0, "neutral");
|
||||
target.HullItemKey = "test-cell-hull";
|
||||
target.Equipment = [new AetheriaRuntimeLoadoutItemSlotCommit
|
||||
{
|
||||
X = 0, Y = 1,
|
||||
Item = new AetheriaRuntimeLoadoutItemCommit
|
||||
{ ItemKey = "test-cell-gear", Quality = 1, Durability = 2, Enabled = true }
|
||||
}];
|
||||
var hull = HullCatalogItem("test-cell-hull", 3, 3, 5);
|
||||
var gear = CatalogItem("test-cell-gear");
|
||||
gear.ShapeCells = [new AetheriaRuntimeShapeCell(0, 0)];
|
||||
var catalog = new AetheriaRuntimeCatalogSnapshot([hull, gear], [], []);
|
||||
var zone = new AetheriaRuntimeZoneSnapshotCommit
|
||||
{ ZoneIndex = 0, Entities = [source, target], PhysicalPayloads = [new AetheriaRuntimePhysicalPayloadCommit
|
||||
{
|
||||
PayloadId = "armor-blast", PayloadKind = "mine", WeaponItemKey = "test-cannon",
|
||||
SourceEntityIndex = source.EntityIndex, PositionX = target.PositionX, PositionZ = target.PositionZ,
|
||||
LifetimeSeconds = 30, BlastRadius = 200, PayloadMagnitude = 20,
|
||||
DamageType = "Corrosive", Penetration = 0, DamageSpread = 0,
|
||||
TriggeredAtSeconds = 0, DetonationDelaySeconds = 0, Stationary = true, Active = true
|
||||
}] };
|
||||
var run = new AetheriaRuntimeRunCheckpointCommit
|
||||
{ RunId = "armor-cell-smoke", CurrentZoneIndex = 0,
|
||||
CurrentEntityKey = "zone.0.entity.0", Zones = [zone] };
|
||||
|
||||
AetheriaRuntimeDaemonSimulation.Step(run, new AetheriaRuntimeDaemonIntentState(), 0.1,
|
||||
AetheriaRuntimeDaemonSimulationSettings.AetheriaDefault,
|
||||
new AetheriaYmirPhysicalPayloadPhysics(), new AetheriaYmirWorldPhysics(), catalog, 1, 0.1);
|
||||
|
||||
var armor = target.StatGrids.Single(value => value.Name == "armor");
|
||||
RequireNear(0, armor.Values[3], 0.000001, "source-facing splash cells must absorb damage first");
|
||||
RequireNear(1.0 / 3.0, target.Equipment.Single().Item.Durability, 0.000001,
|
||||
"installed equipment at the impact cell must receive residual damage second");
|
||||
RequireNear(100 - (10.0 / 3.0), Stat(target, "hull"), 0.000001,
|
||||
"only residual damage after armor and equipment may reach hull durability");
|
||||
var surface = AetheriaRuntimeDaemonGameSurfaceBuilder.Build(
|
||||
new AetheriaRuntimeDaemonFrameDocument { FrameId = 1, Run = run },
|
||||
new AetheriaRuntimeDaemonHealthDocument(),
|
||||
AetheriaRuntimeDaemonCommandBoundaryDocument.Create("daemon"));
|
||||
var targetNode = Flatten(surface.Surface.Root).Single(node =>
|
||||
node.Id == "aetheria.daemon.game.world.entity.1");
|
||||
RequireEqual("30", targetNode.Props["armor"],
|
||||
"Eve world projection must expose aggregate armor as derived presentation state");
|
||||
RequireEqual("0,5,5,0,5,5,0,5,5", targetNode.Props["armorGrid"],
|
||||
"Eve world projection must expose the exact daemon-owned schematic grid");
|
||||
}
|
||||
|
||||
private static void ChargedWeaponHoldRiskMalfunctionsDeterministically()
|
||||
{
|
||||
var source = Entity(0, 0, "player");
|
||||
|
|
@ -844,6 +895,22 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
0, 1000, Array.Empty<AetheriaRuntimeCurveKey>(), "", 1, 0, 0, 0, false,
|
||||
0, 0, "", Array.Empty<AetheriaRuntimeAudioStat>(), Array.Empty<AetheriaRuntimeCurveKey>(), "", "");
|
||||
|
||||
private static AetheriaRuntimeCatalogItem HullCatalogItem(string itemKey, int width, int height, double armor)
|
||||
{
|
||||
var cells = Enumerable.Range(0, height)
|
||||
.SelectMany(y => Enumerable.Range(0, width).Select(x => new AetheriaRuntimeShapeCell(x, y)))
|
||||
.ToArray();
|
||||
return new AetheriaRuntimeCatalogItem(
|
||||
itemKey, itemKey, "hull", "", "", 0, 1, 1, 1, 1,
|
||||
width, height, cells.Length, cells,
|
||||
width, height, cells.Length, cells,
|
||||
Array.Empty<AetheriaRuntimeHardpoint>(), Array.Empty<AetheriaRuntimeBehaviorPayload>(),
|
||||
"", "ship", Array.Empty<string>(),
|
||||
1, false, 0, 1, "", "", "", "", "",
|
||||
0, 1000, Array.Empty<AetheriaRuntimeCurveKey>(), "", 1, 0, armor, 0, false,
|
||||
0, 0, "", Array.Empty<AetheriaRuntimeAudioStat>(), Array.Empty<AetheriaRuntimeCurveKey>(), "", "");
|
||||
}
|
||||
|
||||
private static void AgentPatrolsHistoricalOrbitCircuitThroughMovementCommands()
|
||||
{
|
||||
var agent = Entity(0, 0, "workers");
|
||||
|
|
@ -1075,7 +1142,10 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
"LockWeapon",
|
||||
0,
|
||||
[
|
||||
new AetheriaRuntimeBehaviorField(1, Number(1)),
|
||||
new AetheriaRuntimeBehaviorField(2, PerformanceStat(7)),
|
||||
new AetheriaRuntimeBehaviorField(3, PerformanceStat(1.5)),
|
||||
new AetheriaRuntimeBehaviorField(4, PerformanceStat(2)),
|
||||
new AetheriaRuntimeBehaviorField(6, PerformanceStat(145)),
|
||||
new AetheriaRuntimeBehaviorField(9, PerformanceStat(5)),
|
||||
new AetheriaRuntimeBehaviorField(10, PerformanceStat(3)),
|
||||
|
|
@ -1181,8 +1251,10 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
"two authored bursts must commit all six due rounds through the shot resolver");
|
||||
Require(run.ShotReceipts.Count(value => value.WeaponItemKey == "test-lock-cannon") >= 6 &&
|
||||
run.ShotReceipts.All(value => value.Hit && value.HullAppliedDamage >= 0 &&
|
||||
value.HullAppliedDamage <= value.NominalDamage && value.ShieldAbsorbedDamage == 0),
|
||||
"zero-spread authored rounds must commit exact certain-hit damage receipts before presentation travel");
|
||||
value.HullAppliedDamage <= value.NominalDamage && value.ShieldAbsorbedDamage == 0 &&
|
||||
value.DamageType == "Corrosive" && Math.Abs(value.Penetration - 1.5) < 0.000001 &&
|
||||
Math.Abs(value.DamageSpread - 2) < 0.000001),
|
||||
"authored rounds must retain damage type, penetration, spread, and exact damage 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");
|
||||
|
|
|
|||
|
|
@ -16708,6 +16708,30 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root)
|
|||
"Shield authority must be the equipped energy-funded behavior transaction, not a scalar shield hitpoint pool.");
|
||||
}
|
||||
|
||||
var requiredArmorTransactionSymbols = new[]
|
||||
{
|
||||
"EnsureArmorState(entity, catalog)",
|
||||
"ResolveDamageCells(target, hull, impactX, impactZ, source, penetration, spread, splash)",
|
||||
"ApplyGridDamage(armor, cell.X, cell.Y, remaining)",
|
||||
"FindEquipmentAt(target, catalog, cell.X, cell.Y)",
|
||||
"for (var distance = 0.5; distance < penetration; distance += 0.5)",
|
||||
"ArmorAppliedDamage",
|
||||
"EquipmentAppliedDamage",
|
||||
"DamageCells = damage.Cells"
|
||||
};
|
||||
var missingArmorTransactionSymbols = requiredArmorTransactionSymbols
|
||||
.Where(symbol => !daemonSimulation.Contains(symbol, StringComparison.Ordinal) &&
|
||||
!shotReceiptDocument.Contains(symbol, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
if (missingArmorTransactionSymbols.Length > 0 ||
|
||||
daemonSimulation.Contains("ResolveDamage(target, weapon.Damage, catalog)", StringComparison.Ordinal) ||
|
||||
daemonSimulation.Contains("ResolveDamage(target, payload.PayloadMagnitude, catalog)", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Daemon damage must resolve shield, armor cells, installed equipment, then hull through one typed transaction: " +
|
||||
string.Join(", ", missingArmorTransactionSymbols));
|
||||
}
|
||||
|
||||
if (daemonSimulation.Contains("AetheriaRuntimeRtsSimulation", StringComparison.Ordinal) ||
|
||||
daemonSimulation.Contains("daemon-rts", StringComparison.Ordinal) ||
|
||||
daemonSimulation.Contains("rts-commander", StringComparison.Ordinal) ||
|
||||
|
|
|
|||
|
|
@ -333,6 +333,12 @@ namespace GameCult.Aetheria.State.Verse
|
|||
("hullAppliedDamage", FormatNumber(value.HullAppliedDamage)),
|
||||
("shieldEnergyConsumed", FormatNumber(value.ShieldEnergyConsumed)),
|
||||
("shieldHeatGenerated", FormatNumber(value.ShieldHeatGenerated)),
|
||||
("damageType", value.DamageType),
|
||||
("penetration", FormatNumber(value.Penetration)),
|
||||
("damageSpread", FormatNumber(value.DamageSpread)),
|
||||
("armorAppliedDamage", FormatNumber(value.ArmorAppliedDamage)),
|
||||
("equipmentAppliedDamage", FormatNumber(value.EquipmentAppliedDamage)),
|
||||
("damageCellCount", (value.DamageCells?.Count ?? 0).ToString(CultureInfo.InvariantCulture)),
|
||||
("origin", string.Join(",", FormatNumber(value.OriginX), FormatNumber(value.OriginZ))),
|
||||
("endpoint", string.Join(",", FormatNumber(value.EndpointX), FormatNumber(value.EndpointZ))),
|
||||
("presentationDuration", FormatNumber(value.PresentationDurationSeconds)),
|
||||
|
|
@ -638,6 +644,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
var hull = EntityStat(entity, "hull");
|
||||
var shield = EntityStat(entity, "shield");
|
||||
var heat = EntityStat(entity, "heat");
|
||||
var armorGrid = EntityGrid(entity, "armor");
|
||||
var maximumArmorGrid = EntityGrid(entity, "maximumArmor");
|
||||
var armor = armorGrid?.Values?.Sum() ?? 0;
|
||||
var maximumArmor = maximumArmorGrid?.Values?.Sum() ?? 0;
|
||||
var minimumTemperature = EntityStat(entity, AetheriaRuntimeThermalSimulation.MinimumTemperatureGrid);
|
||||
var maximumTemperature = EntityStat(entity, AetheriaRuntimeThermalSimulation.MaximumTemperatureGrid);
|
||||
var thermalVisibility = EntityStat(entity, "thermal-visibility");
|
||||
|
|
@ -664,6 +674,12 @@ namespace GameCult.Aetheria.State.Verse
|
|||
["hull"] = FormatNumber(hull),
|
||||
["maximumHull"] = FormatNumber(maximumHull),
|
||||
["hullRatio"] = FormatRatio(hull, maximumHull),
|
||||
["armor"] = FormatNumber(armor),
|
||||
["maximumArmor"] = FormatNumber(maximumArmor),
|
||||
["armorRatio"] = FormatRatio(armor, maximumArmor),
|
||||
["armorGridWidth"] = (armorGrid?.Width ?? 0).ToString(CultureInfo.InvariantCulture),
|
||||
["armorGridHeight"] = (armorGrid?.Height ?? 0).ToString(CultureInfo.InvariantCulture),
|
||||
["armorGrid"] = string.Join(",", (armorGrid?.Values ?? Array.Empty<double>()).Select(FormatNumber)),
|
||||
["shield"] = FormatNumber(shield),
|
||||
["maximumShield"] = FormatNumber(maximumShield),
|
||||
["shieldRatio"] = FormatRatio(shield, maximumShield),
|
||||
|
|
@ -907,6 +923,11 @@ namespace GameCult.Aetheria.State.Verse
|
|||
.FirstOrDefault(grid => string.Equals(grid?.Name, name, StringComparison.OrdinalIgnoreCase))
|
||||
?.Values?.FirstOrDefault() ?? 0;
|
||||
|
||||
private static AetheriaRuntimeEntityStatGridCommit? EntityGrid(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity, string name) =>
|
||||
(entity.StatGrids ?? Array.Empty<AetheriaRuntimeEntityStatGridCommit>())
|
||||
.FirstOrDefault(grid => string.Equals(grid?.Name, name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
private static double MaximumHull(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings) =>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
private const string Hull = "hull";
|
||||
private const string Shield = "shield";
|
||||
private const string Heat = "heat";
|
||||
private const string Armor = "armor";
|
||||
private const string MaximumArmor = "maximumArmor";
|
||||
|
||||
public static void Step(
|
||||
AetheriaRuntimeRunCheckpointCommit run,
|
||||
|
|
@ -43,7 +45,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
StepPickupLifetimes(run, zone, frameId, deltaSeconds);
|
||||
|
||||
EnsureStats(entities, settings);
|
||||
EnsureStats(entities, settings, catalog);
|
||||
foreach (var entity in entities)
|
||||
AetheriaRuntimeThermalSimulation.EnsureState(entity);
|
||||
foreach (var movement in intents?.Movements ?? Enumerable.Empty<AetheriaRuntimeDaemonMovementIntent>())
|
||||
|
|
@ -423,7 +425,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
BlastRadius = deployable.BlastRadius,
|
||||
PayloadMagnitude = weapon.Damage,
|
||||
MaximumSourceDistance = weapon.Range,
|
||||
WeaponItemKey = weapon.ItemKey
|
||||
WeaponItemKey = weapon.ItemKey,
|
||||
DamageType = weapon.DamageType,
|
||||
Penetration = weapon.Penetration,
|
||||
DamageSpread = weapon.DamageSpread
|
||||
});
|
||||
zone.PhysicalPayloads = payloads;
|
||||
weapon.State.Firing = true;
|
||||
|
|
@ -458,7 +463,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
var dx = target.PositionX - payload.PositionX;
|
||||
var dz = target.PositionZ - payload.PositionZ;
|
||||
if (dx * dx + dz * dz > payload.BlastRadius * payload.BlastRadius) continue;
|
||||
var damage = ResolveDamage(target, payload.PayloadMagnitude, catalog);
|
||||
var source = entities.FirstOrDefault(value => value.EntityIndex == payload.SourceEntityIndex);
|
||||
var damage = ResolveDamage(target, payload.PayloadMagnitude, payload.DamageType,
|
||||
payload.Penetration, payload.DamageSpread, source,
|
||||
payload.PositionX, payload.PositionZ, true, catalog);
|
||||
if (damage.ShieldAbsorbedDamage > 0)
|
||||
AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit
|
||||
{
|
||||
|
|
@ -470,14 +478,16 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AuxiliaryValue = damage.ShieldHeatGenerated,
|
||||
PositionX = payload.PositionX, PositionZ = payload.PositionZ
|
||||
});
|
||||
if (damage.HullAppliedDamage > 0)
|
||||
if (damage.TotalAppliedDamage > 0)
|
||||
AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit
|
||||
{
|
||||
EventId = $"physical-payload:{payload.PayloadId}:damage:{target.EntityIndex}",
|
||||
Kind = "entity.damaged", FrameId = frameId, ZoneIndex = zone.ZoneIndex,
|
||||
SourceEntityIndex = payload.SourceEntityIndex, TargetEntityIndex = target.EntityIndex,
|
||||
SubjectKey = payload.PayloadId, ItemKey = payload.WeaponItemKey,
|
||||
ScalarValue = damage.HullAppliedDamage,
|
||||
ScalarValue = damage.TotalAppliedDamage,
|
||||
AuxiliaryValue = damage.HullAppliedDamage,
|
||||
Reason = payload.DamageType,
|
||||
PositionX = payload.PositionX, PositionZ = payload.PositionZ
|
||||
});
|
||||
}
|
||||
|
|
@ -1124,7 +1134,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
var endpointZ = target.PositionZ + Math.Sin(angle) * impactRadius;
|
||||
var presentationKind = ResolveShotPresentationKind(weapon.State.BehaviorKind);
|
||||
var aliveBefore = IsAlive(target);
|
||||
var damage = hit ? ResolveDamage(target, weapon.Damage, catalog) : DamageResolution.None;
|
||||
var damage = hit ? ResolveDamage(target, weapon.Damage, weapon.DamageType,
|
||||
weapon.Penetration, weapon.DamageSpread, attacker, endpointX, endpointZ, false, catalog) : DamageResolution.None;
|
||||
|
||||
AetheriaRuntimeShotReceipts.Append(run, new AetheriaRuntimeShotReceiptCommit
|
||||
{
|
||||
|
|
@ -1134,7 +1145,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
WeaponBehaviorIndex = weapon.State.BehaviorIndex, ContactInformation = information,
|
||||
LockQuality = lockQuality, RangeFactor = rangeFactor, MotionFactor = motionFactor,
|
||||
DispersionFactor = dispersionFactor, HitProbability = probability, HitRoll = roll,
|
||||
Hit = hit, NominalDamage = weapon.Damage, AppliedDamage = damage.HullAppliedDamage,
|
||||
Hit = hit, NominalDamage = weapon.Damage, AppliedDamage = damage.TotalAppliedDamage,
|
||||
Outcome = !hit ? "miss" : damage.ShieldAbsorbedDamage > 0 ? "shielded" : "hit",
|
||||
OriginX = attacker.PositionX, OriginZ = attacker.PositionZ,
|
||||
EndpointX = endpointX, EndpointZ = endpointZ,
|
||||
|
|
@ -1143,12 +1154,19 @@ namespace GameCult.Aetheria.State.Verse
|
|||
: distance / Math.Max(1, weapon.ProjectileSpeed),
|
||||
PresentationKind = presentationKind,
|
||||
ImpactAngleRoll = angleRoll, ImpactRadiusRoll = radiusRoll,
|
||||
ImpactKind = !hit ? "none" : damage.ShieldAbsorbedDamage > 0 ? "shield" : "hull",
|
||||
ImpactKind = !hit ? "none" : damage.ShieldAbsorbedDamage > 0 ? "shield" :
|
||||
damage.ArmorAppliedDamage > 0 ? "armor" : damage.EquipmentAppliedDamage > 0 ? "equipment" : "hull",
|
||||
PresentationIntensity = Math.Max(0.1, weapon.Damage),
|
||||
ShieldAbsorbedDamage = damage.ShieldAbsorbedDamage,
|
||||
HullAppliedDamage = damage.HullAppliedDamage,
|
||||
ShieldEnergyConsumed = damage.ShieldEnergyConsumed,
|
||||
ShieldHeatGenerated = damage.ShieldHeatGenerated
|
||||
ShieldHeatGenerated = damage.ShieldHeatGenerated,
|
||||
DamageType = weapon.DamageType,
|
||||
Penetration = weapon.Penetration,
|
||||
DamageSpread = weapon.DamageSpread,
|
||||
ArmorAppliedDamage = damage.ArmorAppliedDamage,
|
||||
EquipmentAppliedDamage = damage.EquipmentAppliedDamage,
|
||||
DamageCells = damage.Cells
|
||||
});
|
||||
AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit
|
||||
{
|
||||
|
|
@ -1167,13 +1185,14 @@ namespace GameCult.Aetheria.State.Verse
|
|||
ItemKey = weapon.ItemKey, ScalarValue = damage.ShieldAbsorbedDamage,
|
||||
PositionX = endpointX, PositionZ = endpointZ
|
||||
});
|
||||
if (damage.HullAppliedDamage > 0)
|
||||
if (damage.TotalAppliedDamage > 0)
|
||||
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 = damage.HullAppliedDamage,
|
||||
ItemKey = weapon.ItemKey, ScalarValue = damage.TotalAppliedDamage,
|
||||
AuxiliaryValue = damage.HullAppliedDamage, Reason = weapon.DamageType,
|
||||
PositionX = target.PositionX, PositionZ = target.PositionZ
|
||||
});
|
||||
if (aliveBefore && !IsAlive(target))
|
||||
|
|
@ -1287,7 +1306,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
PositiveOr(behavior.EvaluateStat(24), settings.WeaponLockDirectionImpact),
|
||||
Math.Max(0, behavior.EvaluateStat(25)),
|
||||
Math.Max(0, behavior.EvaluateStat(5)),
|
||||
Math.Max(0, behavior.EvaluateStat(15)));
|
||||
Math.Max(0, behavior.EvaluateStat(15)),
|
||||
ReadEnumName(behavior.Payload, 1, "Kinetic"),
|
||||
Math.Max(0, behavior.EvaluateStat(3)),
|
||||
Math.Max(0, behavior.EvaluateStat(4)));
|
||||
}
|
||||
|
||||
private static ResolvedWeapon ResolveFallbackWeapon(
|
||||
|
|
@ -1302,7 +1324,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
0, "", -1, settings.WeaponCooldownSeconds,
|
||||
1, 0, false,
|
||||
settings.WeaponLockSpeed, settings.WeaponLockSensorImpact, settings.WeaponLockAngleDegrees,
|
||||
settings.WeaponLockDirectionImpact, settings.WeaponLockDecayPerSecond);
|
||||
settings.WeaponLockDirectionImpact, settings.WeaponLockDecayPerSecond,
|
||||
0, 0, "Kinetic", 0, 0);
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeWeaponStateCommit EnsureWeaponState(
|
||||
|
|
@ -1379,6 +1402,16 @@ namespace GameCult.Aetheria.State.Verse
|
|||
.FirstOrDefault(field => field != null && field.Key == key)?.Value?.BoolValue ?? false;
|
||||
}
|
||||
|
||||
private static string ReadEnumName(AetheriaRuntimeBehaviorPayload payload, int key, string fallback)
|
||||
{
|
||||
var value = (payload.Fields ?? Array.Empty<AetheriaRuntimeBehaviorField>())
|
||||
.FirstOrDefault(field => field != null && field.Key == key)?.Value;
|
||||
if (!string.IsNullOrWhiteSpace(value?.StringValue)) return value.StringValue;
|
||||
var names = new[] { "Kinetic", "Corrosive", "Electric", "Thermal", "Optical", "Ionizing" };
|
||||
var index = value == null ? -1 : (int)Math.Round(value.NumberValue);
|
||||
return index >= 0 && index < names.Length ? names[index] : fallback;
|
||||
}
|
||||
|
||||
private static WeaponRoundResult CommitWeaponRound(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
ResolvedWeapon weapon)
|
||||
|
|
@ -1449,7 +1482,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
int magazineSize, double reloadTime, int burstCount, double burstTime, bool singleAmmoBurst,
|
||||
double lockSpeed, double lockSensorImpact,
|
||||
double lockAngleDegrees, double lockDirectionImpact, double lockDecayPerSecond,
|
||||
double minRange = 0, double spread = 0)
|
||||
double minRange = 0, double spread = 0, string damageType = "Kinetic",
|
||||
double penetration = 0, double damageSpread = 0)
|
||||
{
|
||||
State = state; ItemKey = itemKey; Damage = damage; Range = range; Cooldown = cooldown;
|
||||
ProjectileSpeed = projectileSpeed; Heat = heat; Energy = energy; AmmoItemKey = ammoItemKey;
|
||||
|
|
@ -1458,6 +1492,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
LockSensorImpact = lockSensorImpact; LockAngleDegrees = lockAngleDegrees;
|
||||
LockDirectionImpact = lockDirectionImpact; LockDecayPerSecond = lockDecayPerSecond;
|
||||
MinRange = minRange; Spread = spread;
|
||||
DamageType = damageType; Penetration = penetration; DamageSpread = damageSpread;
|
||||
}
|
||||
|
||||
public AetheriaRuntimeWeaponStateCommit State { get; }
|
||||
|
|
@ -1481,6 +1516,9 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public double LockDecayPerSecond { get; }
|
||||
public double MinRange { get; }
|
||||
public double Spread { get; }
|
||||
public string DamageType { get; }
|
||||
public double Penetration { get; }
|
||||
public double DamageSpread { get; }
|
||||
}
|
||||
|
||||
private sealed class ResolvedConstantWeapon
|
||||
|
|
@ -1498,7 +1536,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
public ResolvedWeapon ResolutionShot(double deltaSeconds) => new ResolvedWeapon(
|
||||
State, ItemKey, Damage * deltaSeconds, Range, 0, 1, 0, 0, "", 0, 0,
|
||||
1, 0, false, 1, 0, 180, 0, 0, MinRange, Spread);
|
||||
1, 0, false, 1, 0, 180, 0, 0, MinRange, Spread, "Kinetic", 0, 0);
|
||||
|
||||
public AetheriaRuntimeWeaponStateCommit State { get; }
|
||||
public string ItemKey { get; }
|
||||
|
|
@ -1558,7 +1596,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
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.MinRange, Base.Spread);
|
||||
Base.MinRange, Base.Spread, Base.DamageType, Base.Penetration, Base.DamageSpread);
|
||||
}
|
||||
public ResolvedWeapon Base { get; }
|
||||
public AetheriaRuntimeLoadoutItemCommit Item { get; }
|
||||
|
|
@ -1608,7 +1646,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
private static void EnsureStats(
|
||||
IReadOnlyList<AetheriaRuntimeEntitySnapshotCommit> entities,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
AetheriaRuntimeDaemonSimulationSettings settings,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog)
|
||||
{
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
|
|
@ -1624,12 +1663,20 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
if (!entity.IsActive && GetStat(entity, Hull) > 0)
|
||||
entity.IsActive = true;
|
||||
EnsureArmorState(entity, catalog);
|
||||
}
|
||||
}
|
||||
|
||||
private static DamageResolution ResolveDamage(
|
||||
AetheriaRuntimeEntitySnapshotCommit target,
|
||||
double damage,
|
||||
string damageType,
|
||||
double penetration,
|
||||
double spread,
|
||||
AetheriaRuntimeEntitySnapshotCommit? source,
|
||||
double impactX,
|
||||
double impactZ,
|
||||
bool splash,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog)
|
||||
{
|
||||
damage = Math.Max(0, damage);
|
||||
|
|
@ -1651,13 +1698,180 @@ namespace GameCult.Aetheria.State.Verse
|
|||
var heat = damage / efficiency;
|
||||
AetheriaRuntimeThermalSimulation.AddHeat(target, heat);
|
||||
RefreshShieldProjection(target, catalog);
|
||||
return new DamageResolution(damage, 0, energyDemand, heat);
|
||||
return new DamageResolution(damage, 0, 0, 0, energyDemand, heat,
|
||||
Array.Empty<AetheriaRuntimeDamageCellCommit>());
|
||||
}
|
||||
|
||||
EnsureArmorState(target, catalog);
|
||||
var hull = catalog?.FindItem(target.HullItemKey ?? "");
|
||||
var cells = ResolveDamageCells(target, hull, impactX, impactZ, source, penetration, spread, splash);
|
||||
if (cells.Count == 0)
|
||||
cells.Add((0, 0));
|
||||
var armor = FindGrid(target, Armor);
|
||||
var perCell = damage / cells.Count;
|
||||
var armorApplied = 0.0;
|
||||
var equipmentApplied = 0.0;
|
||||
var hullRequested = 0.0;
|
||||
var receipts = new List<AetheriaRuntimeDamageCellCommit>(cells.Count);
|
||||
foreach (var cell in cells)
|
||||
{
|
||||
var remaining = perCell;
|
||||
var armorTaken = ApplyGridDamage(armor, cell.X, cell.Y, remaining);
|
||||
armorApplied += armorTaken;
|
||||
remaining -= armorTaken;
|
||||
var equipmentIndex = -1;
|
||||
var equipmentTaken = 0.0;
|
||||
if (remaining > 0.1)
|
||||
{
|
||||
var equipment = FindEquipmentAt(target, catalog, cell.X, cell.Y);
|
||||
if (equipment.Slot != null)
|
||||
{
|
||||
equipmentIndex = equipment.Index;
|
||||
equipmentTaken = Math.Min(Math.Max(0, equipment.Slot.Item.Durability), remaining);
|
||||
equipment.Slot.Item.Durability = Math.Max(0, equipment.Slot.Item.Durability - equipmentTaken);
|
||||
equipmentApplied += equipmentTaken;
|
||||
remaining -= equipmentTaken;
|
||||
}
|
||||
}
|
||||
var cellHull = remaining > 0 ? remaining : 0;
|
||||
hullRequested += cellHull;
|
||||
receipts.Add(new AetheriaRuntimeDamageCellCommit
|
||||
{
|
||||
X = cell.X, Y = cell.Y, ArmorAppliedDamage = armorTaken,
|
||||
EquipmentIndex = equipmentIndex, EquipmentAppliedDamage = equipmentTaken,
|
||||
HullAppliedDamage = cellHull
|
||||
});
|
||||
}
|
||||
var hullBefore = Math.Max(0, GetStat(target, Hull));
|
||||
var hullApplied = Math.Min(hullBefore, damage);
|
||||
var hullApplied = hullRequested > 0.1 ? Math.Min(hullBefore, hullRequested) : 0;
|
||||
if (hullRequested > 0 && hullApplied < hullRequested)
|
||||
foreach (var receipt in receipts)
|
||||
receipt.HullAppliedDamage *= hullApplied / hullRequested;
|
||||
SetStat(target, Hull, hullBefore - hullApplied);
|
||||
return new DamageResolution(0, hullApplied, 0, 0);
|
||||
return new DamageResolution(0, armorApplied, equipmentApplied, hullApplied, 0, 0, receipts);
|
||||
}
|
||||
|
||||
private static void EnsureArmorState(AetheriaRuntimeEntitySnapshotCommit entity, AetheriaRuntimeCatalogSnapshot? catalog)
|
||||
{
|
||||
var armorGrid = FindGrid(entity, Armor);
|
||||
var maximumArmorGrid = FindGrid(entity, MaximumArmor);
|
||||
if (armorGrid != null && maximumArmorGrid != null) return;
|
||||
var hull = catalog?.FindItem(entity.HullItemKey ?? "");
|
||||
if (hull == null || hull.ShapeWidth <= 0 || hull.ShapeHeight <= 0 || hull.ShapeCells == null || hull.ShapeCells.Count == 0)
|
||||
return;
|
||||
var values = new double[hull.ShapeWidth * hull.ShapeHeight];
|
||||
foreach (var cell in hull.ShapeCells)
|
||||
if (cell.X >= 0 && cell.Y >= 0 && cell.X < hull.ShapeWidth && cell.Y < hull.ShapeHeight)
|
||||
values[cell.Y * hull.ShapeWidth + cell.X] = Math.Max(0, hull.HullArmor);
|
||||
foreach (var hardpoint in hull.Hardpoints ?? Array.Empty<AetheriaRuntimeHardpoint>())
|
||||
foreach (var cell in hardpoint.ShapeCells ?? Array.Empty<AetheriaRuntimeShapeCell>())
|
||||
{
|
||||
var x = hardpoint.PositionX + cell.X;
|
||||
var y = hardpoint.PositionY + cell.Y;
|
||||
if (x >= 0 && y >= 0 && x < hull.ShapeWidth && y < hull.ShapeHeight)
|
||||
values[y * hull.ShapeWidth + x] += Math.Max(0, hardpoint.Armor);
|
||||
}
|
||||
var grids = (entity.StatGrids ?? Array.Empty<AetheriaRuntimeEntityStatGridCommit>()).ToList();
|
||||
if (armorGrid == null)
|
||||
grids.Add(new AetheriaRuntimeEntityStatGridCommit { Name = Armor, Width = hull.ShapeWidth, Height = hull.ShapeHeight, Values = values });
|
||||
if (maximumArmorGrid == null)
|
||||
grids.Add(new AetheriaRuntimeEntityStatGridCommit { Name = MaximumArmor, Width = hull.ShapeWidth, Height = hull.ShapeHeight, Values = values.ToArray() });
|
||||
entity.StatGrids = grids;
|
||||
}
|
||||
|
||||
private static List<(int X, int Y)> ResolveDamageCells(AetheriaRuntimeEntitySnapshotCommit target,
|
||||
AetheriaRuntimeCatalogItem? hull, double impactX, double impactZ,
|
||||
AetheriaRuntimeEntitySnapshotCommit? source, double penetration, double spread, bool splash)
|
||||
{
|
||||
var result = new HashSet<(int X, int Y)>();
|
||||
if (hull == null || hull.ShapeCells == null || hull.ShapeCells.Count == 0) return result.ToList();
|
||||
var forward = Normalize(target.DirectionX, target.DirectionY);
|
||||
if (Math.Abs(forward.X) + Math.Abs(forward.Y) < 0.001) forward = (0, 1);
|
||||
var right = (X: forward.Y, Y: -forward.X);
|
||||
var occupied = new HashSet<(int X, int Y)>(hull.ShapeCells.Select(cell => (cell.X, cell.Y)));
|
||||
if (splash && source != null)
|
||||
{
|
||||
var incoming = Normalize(target.PositionX - source.PositionX, target.PositionZ - source.PositionZ);
|
||||
var localIncoming = (X: incoming.X * right.X + incoming.Y * right.Y,
|
||||
Y: incoming.X * forward.X + incoming.Y * forward.Y);
|
||||
var centerX = hull.ShapeCells.Average(cell => cell.X);
|
||||
var centerY = hull.ShapeCells.Average(cell => cell.Y);
|
||||
foreach (var cell in hull.ShapeCells)
|
||||
if ((cell.X - centerX) * localIncoming.X + (cell.Y - centerY) * localIncoming.Y < 0)
|
||||
result.Add((cell.X, cell.Y));
|
||||
return result.OrderBy(cell => cell.Y).ThenBy(cell => cell.X).ToList();
|
||||
}
|
||||
var dx = impactX - target.PositionX;
|
||||
var dz = impactZ - target.PositionZ;
|
||||
var localX = dx * right.X + dz * right.Y;
|
||||
var localY = dx * forward.X + dz * forward.Y;
|
||||
var radius = string.Equals(target.Kind, "station", StringComparison.OrdinalIgnoreCase) ? 48.0 : 20.0;
|
||||
var schematicX = (localX / (radius * 2) + 0.5) * Math.Max(1, hull.ShapeWidth - 1);
|
||||
var schematicY = (localY / (radius * 2) + 0.5) * Math.Max(1, hull.ShapeHeight - 1);
|
||||
var first = hull.ShapeCells.OrderBy(cell =>
|
||||
(cell.X - schematicX) * (cell.X - schematicX) + (cell.Y - schematicY) * (cell.Y - schematicY)).First();
|
||||
result.Add((first.X, first.Y));
|
||||
var hitHardpoint = (hull.Hardpoints ?? Array.Empty<AetheriaRuntimeHardpoint>())
|
||||
.FirstOrDefault(hardpoint => (hardpoint.ShapeCells ?? Array.Empty<AetheriaRuntimeShapeCell>())
|
||||
.Any(cell => hardpoint.PositionX + cell.X == first.X && hardpoint.PositionY + cell.Y == first.Y));
|
||||
if (hitHardpoint != null)
|
||||
foreach (var cell in hitHardpoint.ShapeCells ?? Array.Empty<AetheriaRuntimeShapeCell>())
|
||||
if (occupied.Contains((hitHardpoint.PositionX + cell.X, hitHardpoint.PositionY + cell.Y)))
|
||||
result.Add((hitHardpoint.PositionX + cell.X, hitHardpoint.PositionY + cell.Y));
|
||||
for (var i = 0; i < (int)Math.Round(Math.Max(0, spread)); i++)
|
||||
{
|
||||
var expanded = result.ToArray();
|
||||
foreach (var cell in expanded)
|
||||
foreach (var step in new[] { (-1, 0), (1, 0), (0, -1), (0, 1) })
|
||||
if (occupied.Contains((cell.X + step.Item1, cell.Y + step.Item2)))
|
||||
result.Add((cell.X + step.Item1, cell.Y + step.Item2));
|
||||
}
|
||||
if (penetration > 0.5 && source != null)
|
||||
{
|
||||
var travel = Normalize(target.PositionX - source.PositionX, target.PositionZ - source.PositionZ);
|
||||
var penetrationX = travel.X * right.X + travel.Y * right.Y;
|
||||
var penetrationY = travel.X * forward.X + travel.Y * forward.Y;
|
||||
var pointX = first.X + 0.5;
|
||||
var pointY = first.Y + 0.5;
|
||||
for (var distance = 0.5; distance < penetration; distance += 0.5)
|
||||
{
|
||||
pointX += penetrationX * 0.5;
|
||||
pointY += penetrationY * 0.5;
|
||||
var cell = ((int)Math.Floor(pointX), (int)Math.Floor(pointY));
|
||||
if (occupied.Contains(cell)) result.Add(cell);
|
||||
}
|
||||
}
|
||||
return result.OrderBy(cell => cell.Y).ThenBy(cell => cell.X).ToList();
|
||||
}
|
||||
|
||||
private static (AetheriaRuntimeLoadoutItemSlotCommit? Slot, int Index) FindEquipmentAt(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity, AetheriaRuntimeCatalogSnapshot? catalog, int x, int y)
|
||||
{
|
||||
var equipment = entity.Equipment ?? Array.Empty<AetheriaRuntimeLoadoutItemSlotCommit>();
|
||||
for (var index = 0; index < equipment.Count; index++)
|
||||
{
|
||||
var slot = equipment[index];
|
||||
var item = catalog?.FindItem(slot.Item?.ItemKey ?? "");
|
||||
if (item?.ShapeCells == null) continue;
|
||||
if (item.ShapeCells.Any(cell => slot.X + cell.X == x && slot.Y + cell.Y == y)) return (slot, index);
|
||||
}
|
||||
return (null, -1);
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeEntityStatGridCommit? FindGrid(AetheriaRuntimeEntitySnapshotCommit entity, string name) =>
|
||||
(entity.StatGrids ?? Array.Empty<AetheriaRuntimeEntityStatGridCommit>())
|
||||
.FirstOrDefault(candidate => string.Equals(candidate.Name, name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
private static double ApplyGridDamage(AetheriaRuntimeEntityStatGridCommit? grid, int x, int y, double damage)
|
||||
{
|
||||
if (grid == null || x < 0 || y < 0 || x >= grid.Width || y >= grid.Height) return 0;
|
||||
var values = (grid.Values ?? Array.Empty<double>()).ToArray();
|
||||
var index = y * grid.Width + x;
|
||||
if (index < 0 || index >= values.Length) return 0;
|
||||
var applied = Math.Min(Math.Max(0, values[index]), Math.Max(0, damage));
|
||||
values[index] -= applied;
|
||||
grid.Values = values;
|
||||
return applied;
|
||||
}
|
||||
|
||||
private static void RefreshShieldProjection(
|
||||
|
|
@ -1681,21 +1895,32 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
private readonly struct DamageResolution
|
||||
{
|
||||
public static DamageResolution None { get; } = new DamageResolution(0, 0, 0, 0);
|
||||
public static DamageResolution None { get; } = new DamageResolution(0, 0, 0, 0, 0, 0,
|
||||
Array.Empty<AetheriaRuntimeDamageCellCommit>());
|
||||
|
||||
public DamageResolution(double shieldAbsorbedDamage, double hullAppliedDamage,
|
||||
double shieldEnergyConsumed, double shieldHeatGenerated)
|
||||
public DamageResolution(double shieldAbsorbedDamage, double armorAppliedDamage,
|
||||
double equipmentAppliedDamage, double hullAppliedDamage,
|
||||
double shieldEnergyConsumed, double shieldHeatGenerated,
|
||||
IReadOnlyList<AetheriaRuntimeDamageCellCommit> cells)
|
||||
{
|
||||
ShieldAbsorbedDamage = shieldAbsorbedDamage;
|
||||
ArmorAppliedDamage = armorAppliedDamage;
|
||||
EquipmentAppliedDamage = equipmentAppliedDamage;
|
||||
HullAppliedDamage = hullAppliedDamage;
|
||||
ShieldEnergyConsumed = shieldEnergyConsumed;
|
||||
ShieldHeatGenerated = shieldHeatGenerated;
|
||||
Cells = cells;
|
||||
}
|
||||
|
||||
public double ShieldAbsorbedDamage { get; }
|
||||
public double ArmorAppliedDamage { get; }
|
||||
public double EquipmentAppliedDamage { get; }
|
||||
public double HullAppliedDamage { get; }
|
||||
public double ShieldEnergyConsumed { get; }
|
||||
public double ShieldHeatGenerated { get; }
|
||||
public IReadOnlyList<AetheriaRuntimeDamageCellCommit> Cells { get; }
|
||||
public double TotalAppliedDamage =>
|
||||
ArmorAppliedDamage + EquipmentAppliedDamage + HullAppliedDamage;
|
||||
}
|
||||
|
||||
private static bool IsAlive(AetheriaRuntimeEntitySnapshotCommit entity)
|
||||
|
|
|
|||
|
|
@ -490,6 +490,23 @@ namespace GameCult.Aetheria.State.Verse
|
|||
[Key(30)] public double HullAppliedDamage { get; set; }
|
||||
[Key(31)] public double ShieldEnergyConsumed { get; set; }
|
||||
[Key(32)] public double ShieldHeatGenerated { get; set; }
|
||||
[Key(33)] public string DamageType { get; set; } = "Kinetic";
|
||||
[Key(34)] public double Penetration { get; set; }
|
||||
[Key(35)] public double DamageSpread { get; set; }
|
||||
[Key(36)] public double ArmorAppliedDamage { get; set; }
|
||||
[Key(37)] public double EquipmentAppliedDamage { get; set; }
|
||||
[Key(38)] public IReadOnlyList<AetheriaRuntimeDamageCellCommit> DamageCells { get; set; } = Array.Empty<AetheriaRuntimeDamageCellCommit>();
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class AetheriaRuntimeDamageCellCommit
|
||||
{
|
||||
[Key(0)] public int X { get; set; }
|
||||
[Key(1)] public int Y { get; set; }
|
||||
[Key(2)] public double ArmorAppliedDamage { get; set; }
|
||||
[Key(3)] public int EquipmentIndex { get; set; } = -1;
|
||||
[Key(4)] public double EquipmentAppliedDamage { get; set; }
|
||||
[Key(5)] public double HullAppliedDamage { get; set; }
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
|
|
@ -640,6 +657,9 @@ namespace GameCult.Aetheria.State.Verse
|
|||
[Key(25)] public double MaximumSourceDistance { get; set; }
|
||||
[Key(26)] public string WeaponItemKey { get; set; } = "";
|
||||
[Key(27)] public string TriggerReason { get; set; } = "";
|
||||
[Key(28)] public string DamageType { get; set; } = "Kinetic";
|
||||
[Key(29)] public double Penetration { get; set; }
|
||||
[Key(30)] public double DamageSpread { get; set; }
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
|
|
|
|||
|
|
@ -725,6 +725,31 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
|
|||
|
||||
## Current Authority Map
|
||||
|
||||
### Daemon Damage Transaction
|
||||
|
||||
- Owner: the daemon's canonical damage transaction owns damage-layer ordering
|
||||
and mutation for direct weapons and deployables.
|
||||
- Inputs: hull and hardpoint catalog topology; initialized armor and
|
||||
maximum-armor grids; shield, equipment, and scalar hull state; deterministic
|
||||
impact position/direction; damage amount, orthogonal spread, 0.5-cell
|
||||
penetration, and typed damage type.
|
||||
- Outputs: one atomic `shield -> armor cell -> equipment -> scalar hull`
|
||||
result, mutated canonical grids/equipment/hull state, and receipts recording
|
||||
which layers were reached and how much each layer absorbed or received.
|
||||
- Derived state: aggregate armor and exact schematic armor/maximum-armor facts
|
||||
are Eve projections of canonical cell state. Scalar hull is the terminal
|
||||
remainder, not an armor surrogate. Damage type is typed/pass-through; no
|
||||
resistance authority exists because the fossil did not apply resistances.
|
||||
- Forbidden writers: direct-fire code, deployable handlers, Ymir contacts,
|
||||
Unity components, Eve lowerers, scalar-health helpers, and reconciliation
|
||||
loops cannot independently apply or repair armor, equipment, or hull damage.
|
||||
- Shared paths: direct and deployable impacts enter the same transaction after
|
||||
their respective authoritative impact facts are resolved.
|
||||
- Cut line: scalar-hull-only and caller-specific damage paths are no longer
|
||||
owners. Hull/hardpoint topology initializes armor grids; only the daemon
|
||||
transaction mutates them thereafter. Penetration always advances by a
|
||||
half-cell step, eliminating the fossil's non-advancing infinite loop.
|
||||
|
||||
- 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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Deterministic Combat Resolution
|
||||
|
||||
Status: target authority map
|
||||
Status: daemon armor-cell damage ownership implemented; broader combat parity remains
|
||||
|
||||
## Objective
|
||||
|
||||
|
|
@ -20,6 +20,11 @@ execution path because it is human-controlled.
|
|||
The daemon combat resolver owns shot identity, solution quality, seeded outcome,
|
||||
impact distribution, damage transaction, and combat receipts.
|
||||
|
||||
For committed direct and deployable hits, the daemon damage transaction is the
|
||||
single owner of layer ordering and mutation. It applies one shared
|
||||
`shield -> armor cell -> equipment -> scalar hull` transaction; neither the
|
||||
weapon path nor the deployable path owns a second damage model.
|
||||
|
||||
### Inputs
|
||||
|
||||
The resolver may read:
|
||||
|
|
@ -35,6 +40,10 @@ The resolver may read:
|
|||
countermeasures, and only those defenses exposed by gathered information;
|
||||
- doctrine constraints and accepted semantic action parameters;
|
||||
- a deterministic entropy key derived from run seed and stable shot identity.
|
||||
- the target hull shape and hardpoint catalog topology used to initialize its
|
||||
armor and maximum-armor grids;
|
||||
- the resolved impact position and direction supplied by the direct-shot or
|
||||
deployable detonation path.
|
||||
|
||||
Missing knowledge remains uncertainty. The resolver must not replace an
|
||||
observer's weak contact with canonical target internals when constructing its
|
||||
|
|
@ -60,6 +69,11 @@ One committed shot produces an immutable receipt containing:
|
|||
Receipts are CultCache/CultMesh state. Eve projects them without becoming a
|
||||
second combat model.
|
||||
|
||||
The daemon also publishes the mutated armor and maximum-armor grids. Aggregate
|
||||
armor is derived from those cells for compact Eve status; exact cell values are
|
||||
available for the schematic. Scalar hull health is the terminal remainder of
|
||||
the transaction, not a substitute armor owner.
|
||||
|
||||
## Pipeline
|
||||
|
||||
```text
|
||||
|
|
@ -126,6 +140,43 @@ does not secretly reveal the canonical component location. The sampled impact
|
|||
then enters the target's shield, armor, hull-cell, equipment, thermal, and crew
|
||||
damage pipeline.
|
||||
|
||||
The implemented damage transaction maps the deterministic impact onto the
|
||||
target schematic. Damage spread expands through orthogonally adjacent cells.
|
||||
Penetration advances through the schematic in 0.5-cell increments, including
|
||||
the fix for the fossil path that could fail to advance and loop forever. Damage
|
||||
type remains typed and is passed through state and receipts, but does not apply
|
||||
resistance modifiers: the fossil carried damage types but never used them for
|
||||
resistance.
|
||||
|
||||
Direct hits begin at the deterministic impact cell; a hit on a hardpoint begins
|
||||
with that hardpoint's complete footprint before spread and penetration expand
|
||||
the shape. Splash payloads such as mines preserve the fossil's distinct rule:
|
||||
they select the source-facing half of the hull schematic, then enter the same
|
||||
layer transaction.
|
||||
|
||||
## Armor-Cell Authority Map
|
||||
|
||||
- Owner: the daemon's canonical damage transaction owns shield interception,
|
||||
schematic impact mapping, armor-cell mutation, equipment damage, and scalar
|
||||
hull remainder for both direct and deployable damage.
|
||||
- Inputs: hull and hardpoint catalog topology, initialized armor and
|
||||
maximum-armor grids, authoritative target state, deterministic impact and
|
||||
direction, damage amount, spread, penetration, and typed damage type.
|
||||
- Outputs: atomically mutated shield resources, armor cells, equipment state,
|
||||
scalar hull, aggregate/exact Eve armor facts, and shot/damage receipts with
|
||||
the layers reached and damage applied at each layer.
|
||||
- Derived state: aggregate armor, schematic presentation, impact effects,
|
||||
meters, and scalar summaries are views of the canonical transaction. Damage
|
||||
type is currently pass-through evidence, not a resistance table.
|
||||
- Forbidden writers: direct-weapon handlers, deployable detonation handlers,
|
||||
Ymir contacts, Unity/Eve presentation, scalar-hull helpers, and repair loops
|
||||
may not independently order layers or mutate armor/equipment/hull.
|
||||
- Shared paths: direct shots and deployable detonations submit the same damage
|
||||
transaction after producing their authoritative impact facts.
|
||||
- Cut line: the old scalar-hull-only and per-caller damage paths no longer own
|
||||
damage. Catalog topology initializes the grids once; after initialization,
|
||||
only the daemon damage transaction mutates them.
|
||||
|
||||
## Charged Weapons
|
||||
|
||||
A charged fire request commits time before it commits a shot:
|
||||
|
|
@ -182,6 +233,7 @@ Eve receives:
|
|||
|
||||
- persistent firing-solution and weapon state;
|
||||
- immutable shot and damage receipts;
|
||||
- aggregate armor status and the exact armor/maximum-armor schematic grid;
|
||||
- hit/miss, impact, malfunction, refusal, and destruction chronology;
|
||||
- derived trajectory hints such as origin, impact/miss endpoint, launch time,
|
||||
impact time, effect identity, and view channels.
|
||||
|
|
@ -199,6 +251,8 @@ drop or simplify an effect. It may not promote a visual collision into damage.
|
|||
- cognition and agents may propose shots but may not sample or apply outcomes.
|
||||
- Eve lowerers may not reconstruct hit probability from presentation props.
|
||||
- a repair loop may not reconcile client-observed impacts into daemon health.
|
||||
- direct and deployable callers may not bypass the shared layer transaction
|
||||
with scalar hull damage.
|
||||
|
||||
## Cut Line
|
||||
|
||||
|
|
@ -223,7 +277,8 @@ Required proofs:
|
|||
4. Cognition quality, range, aspect, and target motion contribute independently
|
||||
and are visible in the receipt.
|
||||
5. Hit and miss both consume the committed weapon resources.
|
||||
6. Impact distribution reaches shield, armor, hull-cell, and equipment damage.
|
||||
6. Direct and deployable impacts share the shield, armor-cell, equipment, and
|
||||
scalar-hull transaction, with layer facts preserved in receipts.
|
||||
7. Removing all projectile presentation still produces the same damage receipt.
|
||||
8. Injecting a fake visual collision cannot produce damage.
|
||||
9. Charged hold risk replays exactly and commits immediately when a valid
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ validation proves contract shape, not wiring, exclusivity, lowering, or parity.
|
|||
| 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 | Eve presentation for ordinary tracers; Ymir for persistent physical payloads | receipt trajectory/effect facts or persistent payload state | native projectile visual | ordinary instant, charged, and constant execution creates no projectile body; each weapon state owns a stable shot sequence and receipts carry origin, endpoint, nominal duration, and effect identity for Eve presentation; `SpawnProjectile` and its alternate writer are deleted; Ymir projectile contacts are feedback-only for explicitly persisted payload rows and cannot write damage; Ymir.Core remains embedded for world integration, radial fields, circle contacts, pickups, and genuinely persistent/interceptable payloads | split/rename the remaining physical-payload interface and remove ordinary projectile terminology from runtime contracts |
|
||||
| Shield/hull damage | energy-funded shield, armor cells, equipment and hull | daemon | entity status + damage events | meters, impacts, damage VFX | equipped Shield behavior now owns the fossil all-or-nothing energy gate: funded hits consume `damage * EnergyUsage`, add `damage / Efficiency` heat, and publish shield absorption without hull loss; unfunded hits bypass the shield; shot receipts expose exact shield/hull/energy/heat quantities and `effect.impact.shield` resolves through the provider asset manifest; fake or later Ymir contacts cannot decide damage | typed armor/hull/equipment grids, penetration, spread, damage types, and generic shield-effect lifecycle parity |
|
||||
| Shield/armor/equipment/hull damage | energy-funded shield, schematic armor cells, equipment and scalar hull | daemon canonical damage transaction | aggregate/exact armor grid, entity status, and layer-aware shot/damage receipts | schematic, meters, impacts, damage VFX | owner-exists; wired; exclusive; projected: daemon initializes armor/maximum-armor grids from hull plus hardpoint catalog topology; direct and deployable damage share one `shield -> armor cell -> equipment -> scalar hull` transaction; direct impacts select a cell or complete hardpoint footprint before orthogonal spread and 0.5-cell penetration, while splash payloads select the source-facing hull half; the fossil penetration infinite-loop defect is fixed; damage type is typed/pass-through without resistances because the fossil never applied them; Eve exposes aggregate and exact armor state and receipts identify reached/applied layers; fake Ymir contacts and presentation cannot decide damage | fossil parity fixtures for topology, edge impacts, orthogonal spread, multi-cell penetration, equipment interception, and generic shield/equipment effect lifecycle |
|
||||
| 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 |
|
||||
| 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; committed direct damage now enters the shared daemon armor-cell transaction | guided persistent payloads, visibility/wear, remaining impact-distribution parity, 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 |
|
||||
| Tractor/scoop | analog tractor and physical timed pickups | daemon + Ymir | tractor power, pickup body and receipt | beam/interaction feedback | fossil 2/s power ramp and authored forward radius/traction/distance feed pickup bodies into the shared Ymir world; shield contact collects exactly once when capacity permits or applies the fossil 25-unit rejection kick; 30s daemon lifetime; instant cargo teleport deleted | prove generic runtime beam, contact, success and rejection feedback |
|
||||
| Dock/undock | wormhole-first interact; first eligible bay; component prerequisites | daemon + Ymir placement | dock commands/context | camera/UI transition | daemon path wired/projected; Ymir placement and parity unproven | priority, eligibility, placement and reconnect |
|
||||
|
|
|
|||
Loading…
Reference in a new issue