Document architecture checkpoint and restore original task callback order

This commit is contained in:
UnixNight committed 2026-10-25 12:56:17 -04:00
1 parent 69d0187a21
commit 531883aaac
45 files changed
+2935 -43

No files matched your search

+39
View File
@@ -7,6 +7,45 @@ using GamePort.Application;
var root = Path.GetFullPath(args.Length == 1 ? args[0] : "../Original");
var level = GamLevel.Load(AssetPath.Resolve(root,"gam/level1b.gam"));
var save = OriginalSave.Load(AssetPath.Resolve(root,"NewGame.tsk"));
// Original Carl413F30 owns its complete base+derived task callback. Observers
// must never see a generic-only Carl state or wait for SceneInteractions to fix it.
var orderedTasks = new TaskStates(save.Tasks);
var orderedDirector = new SceneDirector(level, orderedTasks, (_, _) => 1);
var orderedCarl = orderedDirector.FindActor("C3DCARL")!;
var orderedMarker = orderedDirector.FindActor("CARLESC3")!;
var notifiedCarl = false;
var notifiedAfterCarl = false;
orderedDirector.ActorChanged += actor =>
{
if (ReferenceEquals(actor, orderedCarl))
{
Check(orderedTasks.Get("SCENE") == 50 && actor.Active && actor.Visible && actor.AIstate == 6
&& actor.Position == orderedMarker.Position, "Carl callback observer sees final derived state");
notifiedCarl = true;
}
else if (notifiedCarl)
{
Check(orderedCarl.Position == orderedMarker.Position && orderedCarl.AIstate == 6,
"Later actor callbacks observe completed Carl override");
notifiedAfterCarl = true;
}
};
orderedCarl.Position = Vector3.Zero; orderedCarl.AIstate = 0;
orderedTasks.SetExisting("SCENE", 50);
Check(notifiedCarl && notifiedAfterCarl, "Authored registry includes Carl followed by task actors");
foreach (var scene in new[] { -1, 0, 30, 31, 59, 60, 61 })
{
var boundaryTasks = new TaskStates(save.Tasks.Select(t => t.Name == "SCENE" ? t with { State = scene } : t));
var boundaryDirector = new SceneDirector(level, boundaryTasks, (_, _) => 1);
var actor = boundaryDirector.FindActor("C3DCARL")!;
var generic = TaskActivation.Animated(actor.SourceGam!, scene);
Check(actor.Active == (scene is >= 0 and < 60 || scene == 60 && generic != false),
"LV1B Carl derived activation boundaries and generic result at60");
if (scene is > 30 and <= 60)
Check(actor.AIstate == 6 && actor.Position == boundaryDirector.FindActor("CARLESC3")!.Position,
"Carl marker/state override follows base activation at construction");
}
Console.WriteLine("PASS per-actor Carl task callback order, derived observation and LV1B boundaries");
var tasks = new TaskStates(save.Tasks);
var director = new SceneDirector(level,tasks,(_,_)=>.1);
var cues = 0;