faction-play-1 fixes: doctrine-catalog apply writes nothing on rerun; tests pin the unseen rule off-origin, the hail speaker in every build order, wire slot 17, exact-name match, scaled standoff, compliance axes, threshold boundaries, follow velocity

Does not build-verified yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-16 22:05:02 +02:00
commit c30764e33e
3 changed files with 237 additions and 43 deletions

View file

@ -6,6 +6,8 @@ using GameCult.Caching;
// Authors the starting FactionDoctrine of the four factions the demo cast uses (aetheria-release, faction-play-1).
// Tuning is a starting point; the operator adjusts it after play. The Pirates record is on master (cut pirates-record);
// a faction with no Faction record is named and skipped, and apply is re-run after a cast faction's record lands.
// A faction that already has a doctrine is kept as it is (the operator tunes after play), so a rerun that finds
// nothing to author writes nothing.
public static class DoctrineCatalog
{
private static readonly (string faction, FactionDoctrine doctrine)[] Table =
@ -46,6 +48,12 @@ public static class DoctrineCatalog
continue;
}
if (faction.Doctrine != null)
{
output.WriteLine($"{name}: already has a doctrine, kept");
continue;
}
output.WriteLine($"{name}: engage on {doctrine.EngageOn}, grace {doctrine.Grace:0.##}s, hail \"{doctrine.Hail}\", " +
$"comply {doctrine.ComplySpeed:0.##}, range exponent {doctrine.Combatant.RangeExponent:0.##}, " +
$"min hit {doctrine.Combatant.MinHitProbability:0.##}");
@ -59,6 +67,13 @@ public static class DoctrineCatalog
return 0;
}
if (changed.Count == 0)
{
output.WriteLine("
Nothing to author.");
return 0;
}
cache.Commit(batch =>
{
foreach (var faction in changed) batch.Upsert(typeof(Faction), faction, cache.RefOf(faction).Key);