Expand debug system pages and add noclip exploration
This commit is contained in:
1 parent
b915a2c2e4
commit
d7838980fd
20 files changed
+628
-47
No files matched your search
@@ -78,6 +78,28 @@ using (var scene = new SceneAudio(new PreparedEntityResources(manifest)))
|
||||
}
|
||||
Console.WriteLine("PASS mixer pauses all stream categories and preserves pause across replacement streams");
|
||||
|
||||
using (var muted = new SdlAudio(wave, muted: true))
|
||||
{
|
||||
var queued = muted.QueuedBytes;
|
||||
Require(muted.Muted && !muted.Paused, "Muted audio remains running");
|
||||
Thread.Sleep(200);
|
||||
Require(muted.QueuedBytes < queued, "Mute must advance transport rather than freeze obsolete speech");
|
||||
muted.SetMuted(false); Require(!muted.Muted, "Mute toggle restores gain");
|
||||
}
|
||||
using (var scene = new SceneAudio(new PreparedEntityResources(manifest)))
|
||||
{
|
||||
scene.SetDebugMute(true, true, true); scene.SetPaused(true);
|
||||
scene.Music("music.omt", 0); scene.Speech("voice.omt", 1); scene.Effect(58);
|
||||
var queued = Queued(scene);
|
||||
scene.SetPaused(false);
|
||||
Require(scene.MusicMuted && scene.SpeechMuted && scene.EffectsMuted, "Menu resume preserves category mute preferences");
|
||||
Thread.Sleep(200);
|
||||
var after = Queued(scene);
|
||||
Require(after.Music < queued.Music && after.Speech < queued.Speech && after.Effects < queued.Effects,
|
||||
"Muted categories consume audio after menu resume");
|
||||
}
|
||||
Console.WriteLine("PASS muted transport advances and category settings survive menu pause/new streams");
|
||||
|
||||
var disposed = new SdlAudio(wave, paused: true);
|
||||
disposed.Dispose(); disposed.Dispose();
|
||||
try { disposed.SetPaused(false); throw new InvalidOperationException("Expected disposed-state rejection"); }
|
||||
|
||||
@@ -50,13 +50,13 @@ try { lines = diagnostics.Lines(status, motion); }
|
||||
finally { CultureInfo.CurrentCulture = originalCulture; }
|
||||
Require(lines.Length == 12 && lines.All(l => l.Length <= 58), "Live diagnostics fit the compact overlay bounds");
|
||||
Require(lines[2].Contains("76.5") && lines[2].Contains("-3.5") && !lines.Any(l => l.Contains("NEG")), "Numeric output is invariant under user culture");
|
||||
Require(lines[6] == "CTRL T FORCE F PAUSED F", "Control and pause diagnostics use live state");
|
||||
Require(lines[6] == "CTRL T FORCE F PAUSED F NOCLIP F", "Control, pause and noclip diagnostics use live state");
|
||||
Require(lines[7].Contains("SCENE 60 SCORE 150 JETPACK 1 7.5S"), "Task, score, ownership and burst countdown are visible together");
|
||||
var changedStatus = status with { Root = new(40, 50, 60), ForcedControl = true, Inspecting = true, Cutscene = "neutron1a" };
|
||||
var changedStatus = status with { Root = new(40, 50, 60), ForcedControl = true, Inspecting = true, Cutscene = "neutron1a", Systems = new() { Noclip = true } };
|
||||
var changedMotion = motion with { Velocity = new(0, 500, 0), Pose = "FLY", Shot = 2, Blocked = true, Paused = true, VulkanErrors = 3 };
|
||||
var changed = diagnostics.Lines(changedStatus, changedMotion);
|
||||
Require(changed[2] != lines[2] && changed[3] != lines[3] && changed[5].Contains("FLY"), "Motion and position text changes with every live snapshot");
|
||||
Require(changed[6] == "CTRL T FORCE T PAUSED T" && changed[8].Contains("ORBIT") && changed[9].Contains("neutron1a SHOT 2 BLOCK T")
|
||||
Require(changed[6] == "CTRL T FORCE T PAUSED T NOCLIP T" && changed[8].Contains("ORBIT") && changed[9].Contains("neutron1a SHOT 2 BLOCK T")
|
||||
&& changed[11].Contains("VK ERR 3"), "Force/camera/cutscene/block/Vulkan diagnostics stay independent");
|
||||
var authoredView = diagnostics.Lines(changedStatus with { CameraMode = "STRT", FarPlane = 5000 }, changedMotion);
|
||||
Require(authoredView[8] == "CAM STRT FAR 5000.0", "Actual rendered camera/projection can override inferred mode");
|
||||
|
||||
@@ -41,6 +41,31 @@ menu.Toggle(65);
|
||||
Require(menu.SceneTask == 65, "Reopening refreshes live task state");
|
||||
Console.WriteLine("PASS debug navigation, input repeat, staged tasks, scene/start selection and view");
|
||||
|
||||
menu.Key(43);
|
||||
Require(menu.Page == 1 && menu.Selected == 0 && menu.Key(40) == DebugAction.Noclip, "Tab reaches player tools and noclip");
|
||||
menu.Key(43, true); Require(menu.Page == 1, "Tab repeat cannot change pages");
|
||||
menu.Key(81); menu.Key(79);
|
||||
Require(menu.FlySpeed == 1200 && menu.Key(40) == DebugAction.NoclipSpeed, "Fly speed is bounded and staged");
|
||||
for (var i = 0; i < 6; i++) menu.Key(81);
|
||||
menu.Key(79); Require(menu.JetpackState == 4, "Jetpack ownership/availability editor includes disabled state");
|
||||
menu.Key(81); Require(menu.Key(40) == DebugAction.ApplyJetpackState, "Availability requires explicit apply");
|
||||
menu.Key(43);
|
||||
Require(menu.Page == 2 && menu.Selected == 0 && menu.Key(40) == DebugAction.CameraObstruction, "Systems page exposes existing static ray");
|
||||
for (var i = 0; i < 6; i++) menu.Key(81);
|
||||
Require(menu.Key(40) == DebugAction.SaveCheckpoint, "Systems checkpoint save action");
|
||||
menu.Key(81); Require(menu.Key(40) == DebugAction.LoadCheckpoint, "Systems checkpoint load action");
|
||||
for (var page = 0; page < 3; page++)
|
||||
{
|
||||
var pageView = menu.View(new("LV1B", "STARTEXP", Vector3.Zero, 0, 0, true, 20, 0, 30, "NONE", true, 0, 10000, false));
|
||||
Require(pageView.Lines.Length <= 32 && pageView.SelectedLine >= 0 && pageView.SelectedLine < pageView.Lines.Length,
|
||||
"Every menu page fits the fixed widescreen-aware overlay");
|
||||
menu.Key(43);
|
||||
}
|
||||
menu.Key(43); // Return from systems to general.
|
||||
Require(menu.Page == 0, "Tab cycles all three pages");
|
||||
Require(menu.FindScene("VR04")?.LevelFile == "VR04.gam" && menu.FindScene("MISSING") == null, "Checkpoint resolution only uses prepared catalog");
|
||||
Console.WriteLine("PASS paged player/systems tools, noclip, staged settings and bounded overlay views");
|
||||
|
||||
var original = Path.GetFullPath(args.Length == 1 ? args[0] : "../Original");
|
||||
var catalog = DebugMenu.AvailableScenes(original, Path.GetFullPath("artifacts/extracted"));
|
||||
Require(catalog.Length == 33 && catalog.All(s => s.Starts.Length > 0), "Only33 supplied scenes with prepared geometry are offered");
|
||||
|
||||
@@ -10,6 +10,7 @@ var tests = new (string Name, Action Check)[]
|
||||
("clock remainder, stall bound, reset and invalid intervals", ClockBoundaries),
|
||||
("physics consumes prior motion; fresh versus retained input order", FrameOrdering),
|
||||
("source camera query origin, hit adjustment, gain and one query per input", CameraQueryConsumer),
|
||||
("debug noclip bypasses walls/gravity/camera and exits without queued motion", Noclip),
|
||||
("turn-only speed, forward acceleration/cap and release", SpeedLimits),
|
||||
("backpedal cap and release", Backpedal),
|
||||
("yaw sign, forward half-turn and left precedence", Turning),
|
||||
@@ -124,6 +125,55 @@ static void CameraQueryConsumer()
|
||||
Check(queries == beforeQueries + 1, "no additional camera obstruction query after interpolation");
|
||||
}
|
||||
|
||||
static void Noclip()
|
||||
{
|
||||
var points = new[] {
|
||||
new Vector3(-1000, 0, -1000), new(-1000, 0, 1000), new(1000, 0, 1000),
|
||||
new Vector3(-1000, 0, -1000), new(1000, 0, 1000), new(1000, 0, -1000),
|
||||
new Vector3(-1000, -1000, 50), new(1000, -1000, 50), new(1000, 1000, 50),
|
||||
new Vector3(-1000, -1000, 50), new(1000, 1000, 50), new(-1000, 1000, 50) };
|
||||
var mesh = new Mesh(points.Select(p => new MeshVertex(p, Vector2.Zero, Vector3.One)).ToArray(),
|
||||
Enumerable.Range(0, points.Length).Select(i => (uint)i).ToArray());
|
||||
var standing = new Mesh([new(new(-20, -20, -20), Vector2.Zero, Vector3.One), new(new(20, 80, 20), Vector2.Zero, Vector3.One)], []);
|
||||
var collision = new SceneCollision(mesh);
|
||||
var rayQueries = 0; var dynamicQueries = 0;
|
||||
var simulation = new LabSimulation(collision, standing, new(0, 25, 0), 0,
|
||||
(_, _) => { rayQueries++; return null; });
|
||||
simulation.DynamicRootResolver = (a, b, r) => { dynamicQueries++; return b; };
|
||||
var entry = simulation.Position;
|
||||
simulation.Step(new(false, false, false, false, true));
|
||||
Check(simulation.PendingImpulse.Y > 0, "Fixture has queued motion before noclip");
|
||||
simulation.SetNoclip(true);
|
||||
var rays = rayQueries; var bodies = dynamicQueries;
|
||||
for (var i = 0; i < 10; i++) simulation.Step(new(true, false, false, false, true));
|
||||
Check(simulation.Position.Z > 90 && !simulation.Grounded && simulation.Jumps == 1,
|
||||
"Noclip crosses a solid wall without another gameplay jump");
|
||||
Near(simulation.PendingImpulse.Length(), 0, 0, "Noclip discards queued impulse");
|
||||
Check(rayQueries == rays && dynamicQueries == bodies && simulation.Energy == 20,
|
||||
"Noclip bypasses camera/body queries and jetpack drain");
|
||||
var height = simulation.Position.Y;
|
||||
for (var i = 0; i < 10; i++) simulation.Step(new(false, false, false, false, false, Rise: true));
|
||||
Check(simulation.Position.Y > height + 90, "Noclip ascends independently of jumping/gravity");
|
||||
simulation.Step(new(false, false, false, false, false, Descend: true, Fast: true));
|
||||
Near(simulation.Velocity.Y, -1800, .001f, "Fast descend uses bounded fly speed multiplier");
|
||||
var saved = simulation.Position;
|
||||
simulation.Step(default); NearVector(simulation.Position, saved, .0001f, "Released noclip has no momentum or gravity");
|
||||
Check(!simulation.SetNoclip(false), "Clear exit retains exploration position");
|
||||
NearVector(simulation.Position, saved, .0001f, "Disabling in clear space retains position");
|
||||
Check(simulation.Velocity == Vector3.Zero && simulation.PendingImpulse == Vector3.Zero && simulation.JumpState == 0,
|
||||
"Disabling clears fly velocity and queued gameplay work");
|
||||
simulation.Step(default); Check(simulation.Position.Y < saved.Y, "Normal gravity resumes after disabling");
|
||||
simulation.ReturnToNoclipEntry(); NearVector(simulation.Position, entry, .001f, "Explicit return restores entry");
|
||||
|
||||
simulation.Reset(); simulation.SetNoclip(true);
|
||||
for (var i = 0; i < 5; i++) simulation.Step(new(true, false, false, false, false));
|
||||
Check(!collision.CanOccupy(simulation.Position, LabSimulation.BodyRadius, simulation.BodyHeight), "Exit fixture intersects wall");
|
||||
Check(simulation.SetNoclip(false), "Embedded exit restores known entry instead of leaving the capsule trapped");
|
||||
NearVector(simulation.Position, entry, .001f, "Embedded exit restores cached position");
|
||||
simulation.SetNoclip(true); simulation.Reset();
|
||||
Check(!simulation.Noclip && !simulation.HasNoclipEntry, "Reset clears modern noclip state");
|
||||
}
|
||||
|
||||
static void SpeedLimits()
|
||||
{
|
||||
var turn = FlatSimulation();
|
||||
|
||||
Reference in new issue
Block a user