LockOnSituation: the warning is measured against the hostile's live bearing at the first lock, limit 0.5 deg
The staged line stopped being the hostile's line once consumable-ai r3 gave it a flanking approach. The message records the drift from the staged line. LockOn.cs's 5-degree staged-match claim is removed. Builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ca050c9b05
commit
82362da9d5
2 changed files with 9 additions and 5 deletions
|
|
@ -12,9 +12,9 @@ public sealed class LockOn : Scenario
|
|||
|
||||
// The hostile starts about 4000 m off, ahead and to port of the player, facing the player. At that range its passive
|
||||
// sensors hold no track of the player (the test asks the sim's own PassiveInfo against the detection threshold). The
|
||||
// hostile closes, sees the player some fourteen seconds in and locks. The zone's pull bends the hostile's run and moves the
|
||||
// player, and the warning must still point at where the hostile was staged to within 5 degrees at the lock: this side keeps
|
||||
// the bend under one degree (on the far side it is more than seven). At Duel's 900 m (and at 600 m) it sees and locks
|
||||
// hostile closes, sees the player some fourteen seconds in and locks. Its flanking approach and the zone's pull carry it
|
||||
// off the staged line (about 5 degrees by the lock on the merged tree), and the warning must point at where the hostile
|
||||
// is at the lock, which the test checks against the live bearing. At Duel's 900 m (and at 600 m) it sees and locks
|
||||
// within a second.
|
||||
public static readonly CultMath.float2 HostileAt = float2(-2000, 3450);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public sealed partial class RunStartTests
|
|||
|
||||
var lockedAt = -1;
|
||||
var bearingDot = 0f;
|
||||
var stagedDrift = 0f;
|
||||
var strengths = new List<float>();
|
||||
for (var tick = 0; tick < 600 && (lockedAt < 0 || tick < lockedAt + 40); tick++)
|
||||
{
|
||||
|
|
@ -44,13 +45,16 @@ public sealed partial class RunStartTests
|
|||
if (lockedAt < 0)
|
||||
{
|
||||
lockedAt = tick;
|
||||
bearingDot = dot(normalize(paint.Bearing), toPlayer * -1f);
|
||||
// The warning points at the hostile where it is at the lock; the hostile has left the staged line by then.
|
||||
var live = normalize(hostile.Position.xz - player.Position.xz);
|
||||
bearingDot = dot(normalize(paint.Bearing), live);
|
||||
stagedDrift = degrees(acos(clamp(dot(live, -toPlayer), -1f, 1f)));
|
||||
}
|
||||
strengths.Add(paint.Strength);
|
||||
}
|
||||
}
|
||||
Assert.True(lockedAt >= 0, "the hostile never locked the player within 600 ticks of .1 s");
|
||||
Assert.True(bearingDot >= cos(radians(5f)), "the warning points at the hostile");
|
||||
Assert.True(bearingDot >= cos(radians(.5f)), $"the warning points at the hostile where it is (the hostile is {stagedDrift} deg off its staged line at the lock)");
|
||||
Assert.True(strengths.First() < strengths.Last(), $"the lock tightens: Strength went {strengths.First()} to {strengths.Last()}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue