Snapshot for release 2026.10.15.2 (internal 2d4b0af)

This commit is contained in:
Tom Bohar 2026-10-15 20:32:35 -04:00
commit d5e0b50de7
224 changed files with 17914 additions and 1182 deletions

View file

@ -19,6 +19,7 @@ internal static class Program
CombatStallWatchdogTests.Register(runner);
CreatureWeaknessTests.Register(runner);
MonsterDamageTierTests.Register(runner);
LootBaselineTests.Register(runner);
return runner.Run("RynthAi tests", args.Length > 0 ? args[0] : null);
}
}

View file

@ -21,12 +21,15 @@
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthAi\LegacyUi\NavRouteParser.cs" Link="Linked\NavRouteParser.cs" />
<!-- Combat: the melee/missile stall ladder (pure timing state, time passed in). -->
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthAi\Combat\CombatStallWatchdog.cs" Link="Linked\CombatStallWatchdog.cs" />
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthAi\Combat\PointBlankFacing.cs" Link="Linked\PointBlankFacing.cs" />
<!-- Weapon weakness selection: element ranking per monster. Its only outside reference is
CreatureProfileStore.Folder (the user override folder), faked in Fakes\. -->
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthAi\CreatureData\CreatureWeakness.cs" Link="Linked\CreatureWeakness.cs" />
<!-- Learned per-monster damage (System only), for the Aelrynth difficulty-tier tests. -->
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthAi\CreatureData\MonsterDamageStore.cs" Link="Linked\MonsterDamageStore.cs" />
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthAi\CreatureData\PlayerWeenies.cs" Link="Linked\PlayerWeenies.cs" />
<!-- Loot: the measured loot-timer baseline and its [LootSettings] log line. -->
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthAi\LootBaseline.cs" Link="Linked\LootBaseline.cs" />
</ItemGroup>
<ItemGroup>

View file

@ -22,6 +22,53 @@ internal static class CombatStallWatchdogTests
r.Add("stall: a tick gap starts the count over", TickGapResets);
r.Add("stall: ineligible never acts", Ineligible);
r.Add("stall: Unfire takes a step back - the same step is due again next tick, not 3 s later", UnfireRetries);
r.Add("stall: a missile target at point blank starts the ladder at 3.5 s", PointBlank);
r.Add("point blank facing: one snap only for a close target behind, after a full shot cycle", PointBlankFacingRules);
}
/// <summary>
/// PointBlankFacing (Kelpie 2026-10-14/15: crossbow at 1.7 m, target 177 degrees behind, no
/// shots until the target was dropped): snap only within 3 m, more than 90 degrees off, after
/// 2.5 s with no shot, once per 3 s per target, then hold 300 ms.
/// </summary>
private static void PointBlankFacingRules()
{
var f = new PointBlankFacing();
DateTime shot = T0;
DateTime now = T0.AddMilliseconds(2600);
Check.True(f.ShouldSnap(now, 7, 1.7, 177, shot), "1.7 m, 177 degrees off, 2.6 s since a shot: snap");
Check.False(f.ShouldSnap(T0.AddMilliseconds(2000), 7, 1.7, 177, shot), "a shot 2 s ago may still be in flight: wait");
Check.False(f.ShouldSnap(now, 7, 3.5, 177, shot), "beyond 3 m the server turns the character itself");
Check.False(f.ShouldSnap(now, 7, 1.7, 80, shot), "80 degrees off: left to the server");
Check.False(f.ShouldSnap(now, 0, 1.7, 177, shot), "no target");
Check.True(f.ShouldSnap(now, 7, 1.7, 177, NoEvidence), "no shot ever: snap");
f.Snapped(now, 7);
Check.True(f.Settling(now.AddMilliseconds(200), 7), "the attack waits 300 ms after the snap");
Check.False(f.Settling(now.AddMilliseconds(350), 7), "then goes");
Check.False(f.Settling(now.AddMilliseconds(200), 8), "another target isn't held");
Check.False(f.ShouldSnap(now.AddMilliseconds(2000), 7, 1.7, 177, shot), "no second snap for the same target within 3 s");
Check.True(f.ShouldSnap(now.AddMilliseconds(3100), 7, 1.7, 177, shot), "after 3 s it may snap again");
Check.True(f.ShouldSnap(now.AddMilliseconds(500), 8, 1.7, 177, shot), "a new target may snap at once");
Check.Eq(f.Snaps, 1, "one snap counted");
}
/// <summary>The caller passes PointBlankStallMs for a missile target within 3 m (Kelpie 2026-10-14).</summary>
private static void PointBlank()
{
var w = new CombatStallWatchdog();
Act first = Act.None;
int at = -1;
for (int t = 0; t <= 10_000 && first == Act.None; t += TickMs)
{
first = w.Tick(T0.AddMilliseconds(t), eligible: true, NoEvidence, out _,
stallAfterMs: CombatStallWatchdog.PointBlankStallMs);
if (first != Act.None) at = t;
}
Check.Eq((first, at), (Act.Reissue, 3500), "step 1 after 3.5 s at point blank");
var normal = new CombatStallWatchdog();
Check.Eq(RunUntilAction(normal, 0, 10_000, NoEvidence), (Act.Reissue, 6000), "the default is still 6 s");
}
/// <summary>Ticks every 500 ms from <paramref name="fromMs"/> to <paramref name="toMs"/>

View file

@ -0,0 +1,71 @@
using RynthCore.Plugin.RynthAi;
using RynthCore.RynthAiTests.Harness;
namespace RynthCore.RynthAiTests.Tests;
// The loot-timer baseline (LootBaseline.cs) and the [LootSettings] line the corpse looting logs:
// each timer marked baseline or custom, floors noted, and the approach range's Min-above-Max note.
// Kelpie's and Storm's saved timers on 2026-10-14 are the real-world cases.
internal static class LootBaselineTests
{
public static void Register(Runner r)
{
r.Add("loot baseline: the measured values", Values);
r.Add("loot baseline: all baseline is said once", AllBaseline);
r.Add("loot baseline: Kelpie's custom timers and his Min-above-Max range", Kelpie);
r.Add("loot baseline: a timer below the code's floor says what it acts as", Storm);
r.Add("loot baseline: legacy fractional ranges are read as 240 yd fractions", FractionalRange);
}
private static void Values()
{
LootBaseline.Timers b = LootBaseline.Values;
Check.Eq(b, new LootBaseline.Timers(100, 300, 300, 1000, 1500, 12000), "baseline timers");
// Above the measured 95th percentile of appraisal replies (256 ms).
Check.True(LootBaseline.AssessWindowMs > 256, "assess window covers the 95th percentile");
foreach (LootBaseline.Entry e in LootBaseline.Compare(b))
Check.False(e.BelowFloor, $"{e.Label} baseline is not below its floor");
}
private static void AllBaseline()
{
string line = LootBaseline.Describe(LootBaseline.Values, 10, 2);
Check.True(line.StartsWith("[LootSettings] Content Settle 100 ms baseline"), line);
Check.True(line.Contains("-- all baseline"), "summary says all baseline: " + line);
Check.False(line.Contains("custom"), "no timer is custom: " + line);
Check.False(line.Contains("Approach Range"), "a sane range adds no note: " + line);
}
private static void Kelpie()
{
var kelpie = new LootBaseline.Timers(125, 550, 450, 1000, 1200, 12000);
string line = LootBaseline.Describe(kelpie, 40, 240);
Check.True(line.Contains("Content Settle 125 ms custom (baseline 100)"), line);
Check.True(line.Contains("Empty Corpse Wait 550 ms custom (baseline 300)"), line);
Check.True(line.Contains("Assess Window 450 ms custom (baseline 300)"), line);
Check.True(line.Contains("Loot Retry Timeout 1000 ms baseline"), line);
Check.True(line.Contains("Corpse Open Retry 1200 ms custom (baseline 1500)"), line);
Check.True(line.Contains("Corpse Timeout 12000 ms baseline"), line);
Check.True(line.Contains("-- 4 of 6 custom"), line);
Check.True(line.Contains("Approach Range Min 240 yd is above Max 40 yd, so Min acts as 40 yd"), line);
}
/// <summary>Storm's saved timers, with Empty Corpse Wait lowered from 200 to 150 to go under its floor.</summary>
private static void Storm()
{
var storm = new LootBaseline.Timers(100, 150, 150, 300, 1500, 8500);
string line = LootBaseline.Describe(storm, 6.5, 2);
Check.True(line.Contains("Empty Corpse Wait 150 ms custom (baseline 300) [acts as 200]"), line);
Check.False(line.Contains("Assess Window 150 ms custom (baseline 300) [acts"), "150 is above the 100 floor: " + line);
Check.True(line.Contains("-- 4 of 6 custom"), line);
}
private static void FractionalRange()
{
// 0.05 of 240 yd = 12 yd Max; Min 20 yd is above it.
string line = LootBaseline.Describe(LootBaseline.Values, 0.05, 20);
Check.True(line.Contains("Min 20 yd is above Max 12 yd"), line);
// Unset values fall back to 10 / 2 yd, which is fine.
Check.False(LootBaseline.Describe(LootBaseline.Values, 0, 0).Contains("Approach Range"), "unset range adds no note");
}
}