diff --git a/src/game/engine/scenes/tests/gameplay_arc_proof.gd b/src/game/engine/scenes/tests/gameplay_arc_proof.gd index 24eb5574..ac68331f 100644 --- a/src/game/engine/scenes/tests/gameplay_arc_proof.gd +++ b/src/game/engine/scenes/tests/gameplay_arc_proof.gd @@ -228,10 +228,15 @@ func _capture_step(label: String, mode: String, focus: Vector2i = Vector2i.ZERO) else: _setup_camera_fit() _sync_renderers() - # Wall-clock wait so every queued canvas redraw and the camera transform - # both flush through the GPU composite before we read the texture. - # process_frame fires BEFORE draw; only a real timer hands the GPU time. - await get_tree().create_timer(0.5).timeout + # Force a draw cycle now so the canvas-item changes + camera transform + # both make it into the framebuffer before we read it. Without this the + # captured texture is a stale snapshot of the FIRST rendered frame and + # every subsequent screenshot serialises identical bytes (verified hash + # collision across 12 frames in an earlier run). + await get_tree().process_frame + await get_tree().process_frame + RenderingServer.force_draw(false, 0.0) + await get_tree().process_frame var image: Image = get_viewport().get_texture().get_image() if image == null: push_error("gameplay_arc: viewport image null at %s" % label)