Repository navigation
test(platformer): wait for the spawn to land instead of counting 12 frames - #112
juanpflores wants to merge 1 commit into
Conversation
…rames The Orbital Ops and Enchanted Repo smoke suites checked is_on_floor() a fixed 12 physics frames after change_scene_to_file(). Godot's physics clock lags the engine's own start-up, so the first process frame runs a burst of catch-up steps (up to the 8-step cap) before the deferred scene swap lands. Start-up grew from ~115 ms (#40) to ~230 ms (mostly #97), so 7 of the 12 awaited frames now pass with no scene present and the 10 px drop onto the floor needs 7 real steps. Both checks now wait_for the spawned player to touch the floor, as the later checks already do. Co-Authored-By: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
orbital_ops_smokefailed its first check, "Spawn settles on visible station floor", onmainwith no related code change.enchanted_repo_smokefails its equivalent "Fresh run spawns on visible ground" check in the same way.Root cause. Both suites called
change_scene_to_file()and then awaited a fixed 12physics_frames before checkingplayer.is_on_floor(). Godot's physics clock starts behind the engine's own start-up time, so the first process frame runs a burst of catch-up physics steps (capped at 8) before the deferred scene swap lands. Those catch-up frames count against the 12 but no level exists yet. The spawn is 10 px above the floor at 1600 px/s² gravity and needs 7 real steps to land, so the check tolerates at most 5 start-up steps. Tracing per frame onmain:change_scene_to_fileEngine start-up measured at
SceneTree._initialize()grew from ~115 ms at #40 (when the suites went into CI, 3 catch-up steps, landing at frame 10) to ~230 ms onmain. The biggest step was #97 (how-to-play cards: ~143 ms to ~222 ms); the spawn position, station floor geometry and zero-g flag are unchanged and fine. The check was a start-up-time race, and start-up crossed the threshold.Fix. Both suites now
wait_forthe spawned player to be on the floor (2 s timeout), the same way the later checks in these suites already wait on conditions, and checkhp == 3separately as "Fresh run starts at full health". No game code changes.Testing
Before the change, both suites failed only their spawn check, alone and in the batch.
Screenshots / video
Not applicable: test-only change.
Checklist
feat(runner): ...,fix(platformer): ...)ASSETS_LICENSES.mdwith a redistributable license (no assets changed)docs/are updated if behavior or controls changed (no behavior change)Summary by CodeRabbit