Skip to content

Simplify the gameplay tests against the improved harness - #1032

Merged
4ian merged 2 commits into
mainfrom
claude/gameplay-tests-starters-6jb8r0
Aug 9, 2026
Merged

Simplify the gameplay tests against the improved harness#1032
4ian merged 2 commits into
mainfrom
claude/gameplay-tests-starters-6jb8r0

Conversation

@4ian

@4ian 4ian commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #1031, against GDevelop master 4cc37b4 ("Various improvements for gameplay tests"), which fixed several of the things the tests were working around. Fifteen games now use the harness directly instead.

What each harness fix bought

Harness fix What it replaced
setMousePosition projects through the 3D camera ~40 lines per game of Newton-iterated cursor search, in 4 games. starting-3d-twin-stick-shooter aims diagonally again instead of only straight up and down, and starting-3d-rts-unit-selection is back to a plain scene-coordinate selection box.
Custom object children report scene coordinates The parent-origin arithmetic in the RPG dialog test.
getObjectVariable Hand-rolled snapshot.variables.find(...) readers in 7 games. The enemy tests read health by instance id, so "destroyed" is just the variable being gone.
stepUntilObjectIsStable The 12-line "read, compare, count still frames" loop in both physics games — the exact shape that had produced a silent false green.
getEventLog() / sceneReset "The player is back within 5px of its spawn" in the 5 tests that check a run ends. The assertion now says what it means.

CI: screenshots stored next to the results

The screenshots a test takes with harness.takeScreenshot(...) are now kept in the artifacts, in a gameplay-test-screenshots/ folder next to that game's results.json. The paths recorded inside the results file are rewritten to point at them (GDevelop records an absolute path in the game folder, where the files no longer are), so a downloaded results file still resolves its images. A retried run no longer nests the folder inside itself.

Verification

All 30 tests of the 15 changed games pass locally against the current master build. Every test is unchanged in what it asserts, except the twin-stick aiming test, which got stronger (diagonal aim and a moving crosshair, as in its 2D counterpart).

Two things left alone, and why

  • lookTowardWithMouseDelta has a hardcoded 3° tolerance. It now measures correctly (on the layer's camera — right eye height, whatever rotation the game drives), but reports aimed: true while 1.3° off, which is a clean miss at the range of starting-first-person-shooter's target; calling it again steps zero frames. starting-first-person-shooter keeps its own aiming loop. Exposing toleranceDegrees would make it usable for "aim well enough to hit".
  • The yaw measured from the camera looks 90° out. getRelativePosition('Player', target, { fromCamera }) returns yawDiff: -90.04 while the player is demonstrably facing the target. The pitch from the same call is exact (-3.31°, matching what the test computed by hand), so this looks like a convention offset rather than a broken measurement.

Both are written up in GAMEPLAY_TESTS_FEEDBACK-starters.md, along with a correction: my earlier claim that a drag box is screen-space was wrong — the box is in scene coordinates, and the unit that went unselected did so because the cursor was being placed in the wrong spot.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M2jc7PVAvmMmirAQude2v1


Generated by Claude Code

GDevelop master 4cc37b4 fixed several of the things the tests worked around,
so fifteen games now use the harness directly:

- setMousePosition projects through the 3D camera, so the four games that
  clicked or dragged through one drop their cursor-search helper. The
  twin-stick shooter aims diagonally again, the RTS uses a scene-coordinate
  selection box.
- getObjectVariable replaces the hand-rolled variable readers of 7 games.
- stepUntilObjectIsStable replaces the settle loops of the physics games.
- getEventLog()'s sceneReset replaces "the player is back at its spawn" in
  the 5 tests that check a run ends.

Store the screenshots a test takes in the CI artifacts, in a
gameplay-test-screenshots folder next to the results of the game, and rewrite
the paths inside the results file to point at them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2jc7PVAvmMmirAQude2v1
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Preview the game(s) changed or added in this Pull Request


This is an automatic message displaying links to the games in this PR - double check the JSON in case of doubt.

@4ian
4ian merged commit ca9d386 into main Aug 9, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants