Execute authored catalog weapons
This commit is contained in:
parent
9b55f2b908
commit
4810780e03
5 changed files with 195 additions and 52 deletions
|
|
@ -480,6 +480,36 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
var agent = Entity(0, 0, "player");
|
||||
agent.AgentTaskCapabilities = [AetheriaRuntimeAgentTaskTypes.Attack];
|
||||
agent.WeaponGroups = [new[] { 0 }];
|
||||
agent.Equipment =
|
||||
[
|
||||
new AetheriaRuntimeLoadoutItemSlotCommit
|
||||
{
|
||||
Item = new AetheriaRuntimeLoadoutItemCommit
|
||||
{
|
||||
ItemKey = "test-lock-cannon", Quality = 1, Durability = 1, Enabled = true
|
||||
}
|
||||
}
|
||||
];
|
||||
var weaponPayload = new AetheriaRuntimeBehaviorPayload(
|
||||
0,
|
||||
"LockWeapon",
|
||||
0,
|
||||
[
|
||||
new AetheriaRuntimeBehaviorField(2, PerformanceStat(7)),
|
||||
new AetheriaRuntimeBehaviorField(6, PerformanceStat(145)),
|
||||
new AetheriaRuntimeBehaviorField(10, PerformanceStat(3)),
|
||||
new AetheriaRuntimeBehaviorField(16, PerformanceStat(330)),
|
||||
new AetheriaRuntimeBehaviorField(19, PerformanceStat(0.2)),
|
||||
new AetheriaRuntimeBehaviorField(21, PerformanceStat(2)),
|
||||
new AetheriaRuntimeBehaviorField(22, PerformanceStat(1)),
|
||||
new AetheriaRuntimeBehaviorField(23, PerformanceStat(45)),
|
||||
new AetheriaRuntimeBehaviorField(24, PerformanceStat(1)),
|
||||
new AetheriaRuntimeBehaviorField(25, PerformanceStat(1))
|
||||
]);
|
||||
var catalog = new AetheriaRuntimeCatalogSnapshot(
|
||||
[CatalogItem("test-lock-cannon", weaponPayload)],
|
||||
Array.Empty<AetheriaRuntimeCorporation>(),
|
||||
Array.Empty<AetheriaRuntimeNameFile>());
|
||||
var target = Entity(1, 105, "raider");
|
||||
target.Kind = "station";
|
||||
target.StatGrids = [Grid("hull", 24), Grid("shield", 0), Grid("heat", 0)];
|
||||
|
|
@ -524,12 +554,14 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
FixedDeltaSeconds = 0.1,
|
||||
SimulationTimeSeconds = frame * 0.1,
|
||||
ObservedCommands = frame == 0 ? [issue] : Array.Empty<AetheriaRuntimeDaemonCommandDocument>(),
|
||||
Catalog = catalog,
|
||||
ProjectilePhysics = new AetheriaYmirProjectilePhysics(),
|
||||
BuildPublications = false
|
||||
});
|
||||
sawTargetCommand |= tick.OperationResult.AppliedCommandIds.Any(id => id.EndsWith(":target", StringComparison.Ordinal));
|
||||
sawFireCommand |= tick.OperationResult.AppliedCommandIds.Any(id => id.EndsWith(":fire", StringComparison.Ordinal));
|
||||
var weapon = (agent.WeaponStates ?? Array.Empty<AetheriaRuntimeWeaponStateCommit>()).Single();
|
||||
var weapon = (agent.WeaponStates ?? Array.Empty<AetheriaRuntimeWeaponStateCommit>())
|
||||
.Single(value => value.OwnerKind == AetheriaRuntimeBehaviorStateProjector.EquipmentOwnerKind);
|
||||
sawPartialLock |= weapon.LockProgress > 0 && weapon.LockProgress < 0.99;
|
||||
if (firstLaunchFrame < 0 && run.GameEvents.Any(value => value.Kind == "projectile.launched"))
|
||||
firstLaunchFrame = frame;
|
||||
|
|
@ -543,6 +575,12 @@ internal sealed class AetheriaDaemonYmirSmokeChecks
|
|||
Require(firstLaunchFrame > 1, "accepted fire intent must not bypass progressive weapon lock acquisition");
|
||||
Require(run.GameEvents.Any(value => value.Kind == "projectile.launched" && value.SourceEntityIndex == agent.EntityIndex),
|
||||
"accepted fire control must emit authoritative projectile launch chronology");
|
||||
Require(run.GameEvents.Any(value => value.Kind == "projectile.launched" &&
|
||||
value.ItemKey == "test-lock-cannon" && Math.Abs(value.ScalarValue - 7) < 0.000001),
|
||||
"daemon combat must launch the equipped catalog weapon with its authored damage");
|
||||
Require((agent.WeaponStates ?? Array.Empty<AetheriaRuntimeWeaponStateCommit>()).Any(value => value.OwnerKind == AetheriaRuntimeBehaviorStateProjector.EquipmentOwnerKind &&
|
||||
value.OwnerIndex == 0 && value.BehaviorKind == "LockWeapon"),
|
||||
"weapon progress must belong to the equipped authored behavior instead of a synthetic entity weapon");
|
||||
Require(!target.IsActive,
|
||||
$"attack task must end through daemon damage after Ymir projectile contacts; hull={Stat(target, "hull"):0.###} " +
|
||||
$"agent={agent.PositionX:0.###},{agent.PositionZ:0.###} target={target.PositionX:0.###},{target.PositionZ:0.###} " +
|
||||
|
|
|
|||
|
|
@ -16580,9 +16580,10 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root)
|
|||
{
|
||||
"public static class AetheriaRuntimeDaemonSimulation",
|
||||
"AetheriaRuntimeDaemonSimulationSettings settings",
|
||||
"StepCombat(run, zone, entities, intents, deltaSeconds, settings, projectilePhysics)",
|
||||
"EnsureDaemonWeaponState(",
|
||||
"SpawnProjectile(zone, attacker, target, settings)",
|
||||
"StepCombat(run, zone, entities, intents, deltaSeconds, settings, projectilePhysics, catalog, frameId)",
|
||||
"AetheriaRuntimeEquippedBehaviorQueries.Find(entity, catalog, AetheriaRuntimeBehaviorKinds.InstantWeapon)",
|
||||
"EnsureWeaponState(",
|
||||
"SpawnProjectile(zone, attacker, target, weapon, settings)",
|
||||
"projectilePhysics.Step(zone, entities, deltaSeconds)",
|
||||
"Damage(target, hit.Projectile.Damage)"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -49,16 +49,22 @@ namespace GameCult.Aetheria.State.Verse
|
|||
{
|
||||
Stat("Damage", 2),
|
||||
Stat("Penetration", 3),
|
||||
Stat("DamageSpread", 4),
|
||||
Stat("MinRange", 5),
|
||||
Stat("Range", 6),
|
||||
Stat("Energy", 9),
|
||||
Stat("Heat", 10),
|
||||
Stat("Visibility", 11)
|
||||
Stat("Visibility", 11),
|
||||
Stat("Spread", 15),
|
||||
Stat("Velocity", 16)
|
||||
};
|
||||
|
||||
private static readonly AetheriaRuntimeBehaviorFieldMetadata[] InstantWeaponFields =
|
||||
With(WeaponFields, Stat("Cooldown", 19));
|
||||
With(WeaponFields, Stat("BurstCount", 17), Stat("BurstTime", 18), Stat("Cooldown", 19));
|
||||
|
||||
private static readonly AetheriaRuntimeBehaviorFieldMetadata[] LockWeaponFields =
|
||||
With(InstantWeaponFields, Stat("LockSpeed", 21), Stat("LockAngle", 23));
|
||||
With(InstantWeaponFields, Stat("LockSpeed", 21), Stat("SensorImpact", 22), Stat("LockAngle", 23),
|
||||
Stat("DirectionImpact", 24), Stat("Decay", 25));
|
||||
|
||||
private static readonly IReadOnlyDictionary<string, AetheriaRuntimeBehaviorMetadata> ByKind =
|
||||
new[]
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
StepTargetPursuit(entities, settings);
|
||||
var worldStep = StepWorldPhysics(zone, entities, deltaSeconds, worldPhysics);
|
||||
ResolvePickupContacts(run, zone, entities, worldStep, catalog, frameId);
|
||||
StepCombat(run, zone, entities, intents, deltaSeconds, settings, projectilePhysics, frameId);
|
||||
StepCombat(run, zone, entities, intents, deltaSeconds, settings, projectilePhysics, catalog, frameId);
|
||||
AetheriaRuntimeMiningSimulation.Step(run, zone, entities, intents, catalog, frameId, simulationTimeSeconds, deltaSeconds);
|
||||
AetheriaRuntimeSurveySimulation.Step(run, zone, entities, intents, catalog, frameId, simulationTimeSeconds, deltaSeconds);
|
||||
RefreshContacts(entities, settings);
|
||||
|
|
@ -233,15 +233,20 @@ namespace GameCult.Aetheria.State.Verse
|
|||
double deltaSeconds,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings,
|
||||
IAetheriaRuntimeProjectilePhysics projectilePhysics,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog,
|
||||
long frameId)
|
||||
{
|
||||
var byIndex = entities.ToDictionary(entity => entity.EntityIndex);
|
||||
foreach (var attacker in entities)
|
||||
{
|
||||
var weaponState = EnsureDaemonWeaponState(attacker, settings);
|
||||
weaponState.Firing = false;
|
||||
weaponState.CooldownProgress = Math.Max(0, weaponState.CooldownProgress - deltaSeconds);
|
||||
weaponState.CoolingDown = weaponState.CooldownProgress > 0;
|
||||
var weaponGroup = ResolveFireGroup(run, zone, attacker, intents);
|
||||
var weapons = ResolveWeapons(attacker, weaponGroup, catalog, settings);
|
||||
foreach (var weapon in weapons)
|
||||
{
|
||||
weapon.State.Firing = false;
|
||||
weapon.State.CooldownProgress = Math.Max(0, weapon.State.CooldownProgress - deltaSeconds);
|
||||
weapon.State.CoolingDown = weapon.State.CooldownProgress > 0;
|
||||
}
|
||||
|
||||
if (!IsAlive(attacker) ||
|
||||
attacker.TargetEntityIndex < 0 ||
|
||||
|
|
@ -249,30 +254,32 @@ namespace GameCult.Aetheria.State.Verse
|
|||
!IsAlive(target) ||
|
||||
!Hostile(attacker, target))
|
||||
{
|
||||
weaponState.LockTargetEntityIndex = -1;
|
||||
weaponState.LockProgress = 0;
|
||||
foreach (var weapon in weapons)
|
||||
{
|
||||
weapon.State.LockTargetEntityIndex = -1;
|
||||
weapon.State.LockProgress = 0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
UpdateWeaponLock(attacker, target, weaponState, deltaSeconds, settings);
|
||||
if (DistanceSq(attacker, target) > settings.AttackRange * settings.AttackRange ||
|
||||
weaponState.LockProgress <= 0.99)
|
||||
if (IsPlayerOwned(attacker) && weaponGroup < 0)
|
||||
continue;
|
||||
|
||||
if (weaponState.CooldownProgress > 0)
|
||||
continue;
|
||||
foreach (var weapon in weapons)
|
||||
{
|
||||
UpdateWeaponLock(attacker, target, weapon, deltaSeconds, settings);
|
||||
if (DistanceSq(attacker, target) > weapon.Range * weapon.Range ||
|
||||
weapon.State.LockProgress <= 0.99 ||
|
||||
weapon.State.CooldownProgress > 0)
|
||||
continue;
|
||||
|
||||
if (IsPlayerOwned(attacker) && !WantsFire(run, zone, attacker, intents))
|
||||
continue;
|
||||
|
||||
var projectile = SpawnProjectile(zone, attacker, target, settings);
|
||||
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 });
|
||||
weaponState.Firing = true;
|
||||
weaponState.CoolingDown = true;
|
||||
weaponState.CooldownProgress = settings.WeaponCooldownSeconds;
|
||||
AetheriaRuntimeThermalSimulation.AddHeat(
|
||||
attacker,
|
||||
ResolveProjectileDamage(attacker, settings) * settings.ProjectileHeatScale);
|
||||
var projectile = SpawnProjectile(zone, attacker, target, weapon, settings);
|
||||
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;
|
||||
weapon.State.CoolingDown = true;
|
||||
weapon.State.CooldownProgress = weapon.Cooldown;
|
||||
AetheriaRuntimeThermalSimulation.AddHeat(attacker, weapon.Heat);
|
||||
}
|
||||
}
|
||||
|
||||
PrepareProjectiles(zone, byIndex, deltaSeconds);
|
||||
|
|
@ -311,10 +318,11 @@ namespace GameCult.Aetheria.State.Verse
|
|||
private static void UpdateWeaponLock(
|
||||
AetheriaRuntimeEntitySnapshotCommit attacker,
|
||||
AetheriaRuntimeEntitySnapshotCommit target,
|
||||
AetheriaRuntimeWeaponStateCommit weaponState,
|
||||
ResolvedWeapon weapon,
|
||||
double deltaSeconds,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
{
|
||||
var weaponState = weapon.State;
|
||||
if (weaponState.LockTargetEntityIndex != target.EntityIndex)
|
||||
{
|
||||
weaponState.LockTargetEntityIndex = target.EntityIndex;
|
||||
|
|
@ -326,10 +334,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
var dot = Math.Max(-1.0, Math.Min(1.0,
|
||||
targetDirection.X * lookDirection.X + targetDirection.Y * lookDirection.Y));
|
||||
var angleDegrees = Math.Acos(dot) * 180.0 / Math.PI;
|
||||
if (angleDegrees >= settings.WeaponLockAngleDegrees)
|
||||
if (angleDegrees >= weapon.LockAngleDegrees)
|
||||
{
|
||||
weaponState.LockProgress = Clamp01(
|
||||
weaponState.LockProgress - deltaSeconds * settings.WeaponLockDecayPerSecond);
|
||||
weaponState.LockProgress - deltaSeconds * weapon.LockDecayPerSecond);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -338,10 +346,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
var information = Clamp01(contact?.InfoGathered ?? 0);
|
||||
var directionalQuality = Math.Max(0, 1.0 - angleDegrees / 90.0);
|
||||
var acquisition =
|
||||
Math.Pow(directionalQuality, settings.WeaponLockDirectionImpact) *
|
||||
Math.Pow(directionalQuality, weapon.LockDirectionImpact) *
|
||||
deltaSeconds *
|
||||
settings.WeaponLockSpeed *
|
||||
Math.Pow(information, settings.WeaponLockSensorImpact);
|
||||
weapon.LockSpeed *
|
||||
Math.Pow(information, weapon.LockSensorImpact);
|
||||
weaponState.LockProgress = Clamp01(weaponState.LockProgress + acquisition);
|
||||
}
|
||||
|
||||
|
|
@ -395,44 +403,103 @@ namespace GameCult.Aetheria.State.Verse
|
|||
projectile.VelocityY = projectile.DirectionY * speed;
|
||||
}
|
||||
|
||||
private static bool WantsFire(
|
||||
private static int ResolveFireGroup(
|
||||
AetheriaRuntimeRunCheckpointCommit run,
|
||||
AetheriaRuntimeZoneSnapshotCommit zone,
|
||||
AetheriaRuntimeEntitySnapshotCommit attacker,
|
||||
AetheriaRuntimeDaemonIntentState intents)
|
||||
{
|
||||
return (intents == null
|
||||
var intent = (intents == null
|
||||
? Enumerable.Empty<AetheriaRuntimeDaemonWeaponGroupIntent>()
|
||||
: intents.WeaponGroups)
|
||||
.Any(intent => intent != null &&
|
||||
.LastOrDefault(intent => intent != null &&
|
||||
ActorMatches(intent.ActorEntityKey, zone.ZoneIndex, attacker.EntityIndex) &&
|
||||
intent.WeaponGroup == 0 &&
|
||||
intent.Fire &&
|
||||
intent.Active);
|
||||
return intent?.WeaponGroup ?? (IsPlayerOwned(attacker) ? -1 : 0);
|
||||
}
|
||||
|
||||
private static bool ActorMatches(string actorEntityKey, int zoneIndex, int entityIndex) =>
|
||||
AetheriaRuntimeRunCheckpointCommit.TryParseEntityKey(actorEntityKey, out var actorZoneIndex, out var actorEntityIndex) &&
|
||||
actorZoneIndex == zoneIndex && actorEntityIndex == entityIndex;
|
||||
|
||||
private static AetheriaRuntimeWeaponStateCommit EnsureDaemonWeaponState(
|
||||
private static IReadOnlyList<ResolvedWeapon> ResolveWeapons(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
int weaponGroup,
|
||||
AetheriaRuntimeCatalogSnapshot? catalog,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
{
|
||||
var equipmentIndices = weaponGroup >= 0 && weaponGroup < (entity.WeaponGroups ?? Array.Empty<IReadOnlyList<int>>()).Count
|
||||
? entity.WeaponGroups[weaponGroup] ?? Array.Empty<int>()
|
||||
: Array.Empty<int>();
|
||||
var authored = AetheriaRuntimeEquippedBehaviorQueries.Find(entity, catalog, AetheriaRuntimeBehaviorKinds.InstantWeapon)
|
||||
.Where(behavior => equipmentIndices.Contains(behavior.EquipmentIndex))
|
||||
.Select(behavior => ResolveAuthoredWeapon(entity, behavior, settings))
|
||||
.ToArray();
|
||||
if (catalog != null)
|
||||
return authored;
|
||||
|
||||
return new[] { ResolveFallbackWeapon(entity, settings) };
|
||||
}
|
||||
|
||||
private static ResolvedWeapon ResolveAuthoredWeapon(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
AetheriaRuntimeEquippedBehavior behavior,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
{
|
||||
var state = EnsureWeaponState(entity, AetheriaRuntimeBehaviorStateProjector.EquipmentOwnerKind,
|
||||
behavior.EquipmentIndex, behavior.BehaviorIndex, behavior.Payload.Kind, settings);
|
||||
return new ResolvedWeapon(
|
||||
state,
|
||||
behavior.Item.ItemKey,
|
||||
PositiveOr(behavior.EvaluateStat(2), ResolveProjectileDamage(entity, settings)),
|
||||
PositiveOr(behavior.EvaluateStat(6), settings.AttackRange),
|
||||
PositiveOr(behavior.EvaluateStat(19), settings.WeaponCooldownSeconds),
|
||||
PositiveOr(behavior.EvaluateStat(16), settings.ProjectileSpeed),
|
||||
Math.Max(0, behavior.EvaluateStat(10)),
|
||||
PositiveOr(behavior.EvaluateStat(21), settings.WeaponLockSpeed),
|
||||
Math.Max(0, behavior.EvaluateStat(22)),
|
||||
PositiveOr(behavior.EvaluateStat(23), settings.WeaponLockAngleDegrees),
|
||||
PositiveOr(behavior.EvaluateStat(24), settings.WeaponLockDirectionImpact),
|
||||
Math.Max(0, behavior.EvaluateStat(25)));
|
||||
}
|
||||
|
||||
private static ResolvedWeapon ResolveFallbackWeapon(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
{
|
||||
var state = EnsureWeaponState(entity, "daemon-simulation", entity.EntityIndex, 0, "ProjectileWeapon", settings);
|
||||
return new ResolvedWeapon(state,
|
||||
IsPlayerOwned(entity) ? "vanguard-bolt" : "raider-bolt",
|
||||
ResolveProjectileDamage(entity, settings), settings.AttackRange, settings.WeaponCooldownSeconds,
|
||||
settings.ProjectileSpeed, ResolveProjectileDamage(entity, settings) * settings.ProjectileHeatScale,
|
||||
settings.WeaponLockSpeed, settings.WeaponLockSensorImpact, settings.WeaponLockAngleDegrees,
|
||||
settings.WeaponLockDirectionImpact, settings.WeaponLockDecayPerSecond);
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeWeaponStateCommit EnsureWeaponState(
|
||||
AetheriaRuntimeEntitySnapshotCommit entity,
|
||||
string ownerKind,
|
||||
int ownerIndex,
|
||||
int behaviorIndex,
|
||||
string behaviorKind,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
{
|
||||
var states = (entity.WeaponStates ?? Array.Empty<AetheriaRuntimeWeaponStateCommit>()).ToList();
|
||||
var state = states.FirstOrDefault(candidate =>
|
||||
candidate != null &&
|
||||
string.Equals(candidate.OwnerKind, "daemon-simulation", StringComparison.Ordinal) &&
|
||||
candidate.OwnerIndex == entity.EntityIndex);
|
||||
string.Equals(candidate.OwnerKind, ownerKind, StringComparison.Ordinal) &&
|
||||
candidate.OwnerIndex == ownerIndex &&
|
||||
candidate.BehaviorIndex == behaviorIndex);
|
||||
if (state != null)
|
||||
return state;
|
||||
|
||||
state = new AetheriaRuntimeWeaponStateCommit
|
||||
{
|
||||
OwnerKind = "daemon-simulation",
|
||||
OwnerIndex = entity.EntityIndex,
|
||||
BehaviorIndex = 0,
|
||||
BehaviorKind = "ProjectileWeapon",
|
||||
OwnerKind = ownerKind,
|
||||
OwnerIndex = ownerIndex,
|
||||
BehaviorIndex = behaviorIndex,
|
||||
BehaviorKind = behaviorKind,
|
||||
Ammo = -1,
|
||||
BurstRemaining = 0,
|
||||
BurstInterval = settings.WeaponCooldownSeconds,
|
||||
|
|
@ -447,6 +514,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AetheriaRuntimeZoneSnapshotCommit zone,
|
||||
AetheriaRuntimeEntitySnapshotCommit attacker,
|
||||
AetheriaRuntimeEntitySnapshotCommit target,
|
||||
ResolvedWeapon weapon,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
{
|
||||
var direction = Normalize(target.PositionX - attacker.PositionX, target.PositionZ - attacker.PositionZ);
|
||||
|
|
@ -469,14 +537,14 @@ namespace GameCult.Aetheria.State.Verse
|
|||
PositionZ = attacker.PositionZ + direction.Y * settings.ProjectileSpawnOffset,
|
||||
DirectionX = direction.X,
|
||||
DirectionY = direction.Y,
|
||||
VelocityX = direction.X * settings.ProjectileSpeed,
|
||||
VelocityY = direction.Y * settings.ProjectileSpeed,
|
||||
Damage = ResolveProjectileDamage(attacker, settings),
|
||||
VelocityX = direction.X * weapon.ProjectileSpeed,
|
||||
VelocityY = direction.Y * weapon.ProjectileSpeed,
|
||||
Damage = weapon.Damage,
|
||||
Radius = settings.ProjectileRadius,
|
||||
LifetimeSeconds = settings.ProjectileLifetimeSeconds,
|
||||
Guided = true,
|
||||
Active = true,
|
||||
WeaponKind = IsPlayerOwned(attacker) ? "vanguard-bolt" : "raider-bolt"
|
||||
WeaponKind = weapon.ItemKey
|
||||
};
|
||||
projectiles.Add(projectile);
|
||||
zone.Projectiles = projectiles.ToArray();
|
||||
|
|
@ -500,6 +568,35 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return IsPlayerOwned(attacker) ? settings.PawnProjectileDamage : settings.RaiderProjectileDamage;
|
||||
}
|
||||
|
||||
private static double PositiveOr(double value, double fallback) =>
|
||||
double.IsFinite(value) && value > 0 ? value : fallback;
|
||||
|
||||
private sealed class ResolvedWeapon
|
||||
{
|
||||
public ResolvedWeapon(AetheriaRuntimeWeaponStateCommit state, string itemKey, double damage, double range,
|
||||
double cooldown, double projectileSpeed, double heat, double lockSpeed, double lockSensorImpact,
|
||||
double lockAngleDegrees, double lockDirectionImpact, double lockDecayPerSecond)
|
||||
{
|
||||
State = state; ItemKey = itemKey; Damage = damage; Range = range; Cooldown = cooldown;
|
||||
ProjectileSpeed = projectileSpeed; Heat = heat; LockSpeed = lockSpeed;
|
||||
LockSensorImpact = lockSensorImpact; LockAngleDegrees = lockAngleDegrees;
|
||||
LockDirectionImpact = lockDirectionImpact; LockDecayPerSecond = lockDecayPerSecond;
|
||||
}
|
||||
|
||||
public AetheriaRuntimeWeaponStateCommit State { get; }
|
||||
public string ItemKey { get; }
|
||||
public double Damage { get; }
|
||||
public double Range { get; }
|
||||
public double Cooldown { get; }
|
||||
public double ProjectileSpeed { get; }
|
||||
public double Heat { get; }
|
||||
public double LockSpeed { get; }
|
||||
public double LockSensorImpact { get; }
|
||||
public double LockAngleDegrees { get; }
|
||||
public double LockDirectionImpact { get; }
|
||||
public double LockDecayPerSecond { get; }
|
||||
}
|
||||
|
||||
private static void RefreshContacts(
|
||||
IReadOnlyList<AetheriaRuntimeEntitySnapshotCommit> entities,
|
||||
AetheriaRuntimeDaemonSimulationSettings settings)
|
||||
|
|
|
|||
|
|
@ -17,13 +17,14 @@ validation proves contract shape, not wiring, exclusivity, lowering, or parity.
|
|||
|---|---|---|---|---|---|---|
|
||||
| Run/session state | `ServerShared`, `ActionGameManager` | Aetheria daemon/CultCache | provider/session advertisement | all clients | owner-exists; wired; projected; not proven | restart and multi-client convergence |
|
||||
| Entity identity/loadout | `ServerShared/Entity*` | daemon | typed entity and inventory surfaces | EveUnity/Electron | owner-exists; wired; projected; not proven | loadout round trip and reconnect |
|
||||
| Loadout generation | map/faction availability, item cost, hull hardpoints and role constraints | daemon using canonical galaxy, faction knowledge/economy and typed catalog | generated loadout plus provenance/availability facts | Eve inspection and refit surfaces | typed catalog selection exists, but full fossil map- and faction-aware generation is not yet daemon-owned | same seed/map/faction/budget produces an affordable available legal loadout; unavailable foreign equipment cannot appear |
|
||||
| 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 |
|
||||
| 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 projectile weapon wired through progressive fossil-derived lock, cooldown, heat, Ymir flight/contact, and daemon damage; original behavior families remain reference-only | catalog-authored weapon stats and each weapon family |
|
||||
| Weapons | ServerShared behaviors + Unity effects | daemon + Ymir where spatial | action capability, weapon state, attack events | effects/audio/HUD | selected weapon groups now resolve equipped typed-catalog behaviors for damage, range, cooldown, projectile velocity, heat and lock parameters; temporal state belongs to the equipped behavior; Ymir owns flight/contact and daemon owns damage; catalog-free fixtures retain an explicit synthetic fallback | energy/ammunition/burst/resource transactions and each remaining weapon family |
|
||||
| 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