feat(01-04): observe accepted input with bounded passive output
This commit is contained in:
1 parent
773c228a30
commit
72523eebb7
2 files changed
+184
-3
No files matched your search
+10
-3
@@ -15,6 +15,8 @@ internal static class Program
|
||||
{
|
||||
try
|
||||
{
|
||||
using var observation = args.Contains("--help") || !args.Contains("--fidelity-output") ? null : FidelityObservation.FromArguments(args,
|
||||
Directory.GetCurrentDirectory(), AssetPath.FindOriginal(Option(args, "--assets")));
|
||||
using var presentation = new RenderSession();
|
||||
OriginalSave? carriedSave = null;
|
||||
PlayerLevelState? carriedPlayer = null;
|
||||
@@ -24,8 +26,8 @@ internal static class Program
|
||||
var grapplerMemory = new GrapplerMemory();
|
||||
while (true)
|
||||
{
|
||||
var result = Run(args, carriedSave, carriedPlayer, returning, diagnostics, presentation, energy, grapplerMemory, out var continuation);
|
||||
if (result != 0 || continuation == null) return result;
|
||||
var result = Run(args, carriedSave, carriedPlayer, returning, diagnostics, presentation, energy, grapplerMemory, observation, out var continuation);
|
||||
if (result != 0 || continuation == null) { observation?.Complete(result); return result; }
|
||||
args = continuation.Args; carriedSave = continuation.Save; returning = continuation.Returning;
|
||||
carriedPlayer = continuation.Player;
|
||||
}
|
||||
@@ -45,7 +47,7 @@ internal static class Program
|
||||
private sealed record SceneContinuation(string[] Args, OriginalSave Save, bool Returning, PlayerLevelState? Player);
|
||||
|
||||
private static int Run(string[] args, OriginalSave? carriedSave, PlayerLevelState? carriedPlayer, bool returning, DebugDiagnostics diagnostics,
|
||||
RenderSession presentation, PlayerEnergy energy, GrapplerMemory grapplerMemory, out SceneContinuation? continuation)
|
||||
RenderSession presentation, PlayerEnergy energy, GrapplerMemory grapplerMemory, FidelityObservation? observation, out SceneContinuation? continuation)
|
||||
{
|
||||
continuation = null;
|
||||
if (args.Contains("--help"))
|
||||
@@ -69,6 +71,9 @@ internal static class Program
|
||||
--start TAG Use a named original STRT checkpoint
|
||||
--load-save PATH Resume original TSK task/items/checkpoint state
|
||||
--write-save PATH Write checkpoint state as TSK outside asset directory
|
||||
--fidelity-output PATH New local diagnostic session directory
|
||||
--fidelity-session ID Stable session identity across scene continuations
|
||||
--fidelity-case ID Declared comparison case; does not establish acceptance
|
||||
--mute Disable scene audio
|
||||
--time SECONDS Fixed animation time for comparisons
|
||||
--headless Render offscreen through Vulkan
|
||||
@@ -1294,6 +1299,8 @@ internal static class Program
|
||||
bool acceptsInput;
|
||||
if (playerBinding != null) acceptsInput = playerBinding.Step(input);
|
||||
else { simulation.Step(input); acceptsInput = true; }
|
||||
observation?.RecordInput(level?.Code ?? "preview", simulation.Steps, input, acceptsInput,
|
||||
director?.ControlledTag ?? (playerBinding == null ? "direct-simulation" : "script"));
|
||||
scooterFixture?.Received(input);
|
||||
grapplerFixture?.Received(input);
|
||||
rocketFixture?.Received(input);
|
||||
|
||||
Reference in new issue
Block a user