Add a seeded automated playtester and a read-only playtest state export #20
No reviewers
Labels
No labels
playtest
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ai-collab/animrpg202610!20
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/playtest-bot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds an automated playtester under
tools/playtest/and one flag-gated, read-only state export for it.What it does
bash tools/playtest/run.sh --seeds 1,2,3plays a new game per seed: title → opening → creation → overworld grind for the gate fee → Calwen (guild quest, inn, merchant) → Green Stair floors 1–10 → the Woldbeast. It acts only throughInputEventKeyand mouse events, at--fixed-fps 60withEngine.time_scale4 (time is accelerated 4x; noted in Technical Outline §11.1). Each run writesplaytest_out/<stamp>/seed-<n>/report.json,report.md,godot.log, per-finding snapshots underevents/, and Xvfb screenshots undershots/.playtest_out/is gitignored.bot.gd: SceneTree main loop, input, aLoggerfor engine and script errors, and the reportsbrain.gd: the policy. It reads live state, finds paths with BFS over exported walkability, and moves focus with the arrow keys. It has no fixed coordinates or routes. In battle it heals with herbs or Heal when HP is low, targets the weakest foe, and attacks.monitor.gd: detects script errors, softlocks, scene/mode mismatches, panels outside the viewport, out-of-range values, battle anomalies, missing damage feedback, frame-time hitches, and spec checks (gate fee, early encounters, inn, shop, chests, quest turn-in, wipe placement, boss phase, entrance circles)run.shrefuses to run if a bot source names a game singleton (GameManager,ContentDb, …), so all reads go throughPlaytestStateGame-code change (the hook)
scripts/debug/playtest_state.gd(PlaytestState) is active only under the user arg--playtestorANIMRPG_PLAYTEST=1. Without the flag, every call returns{}or[], and the new testtests/test_playtest_state.gdchecks this. With the flag it returns copies of the state (position, menus with screen rects, battle bodies, doors, stairs, tile walkability). It writes nothing, moves nothing, and grants nothing.scripts/autoload/game_manager.gd: two lines. Under the same flag,--playtest-seed=Nseeds the GameManager RNG afterrandomize(), so a seed replays the same session. Normal play is unchanged. Please review this one deliberately: it is the only line in a gameplay file.Versioning
No version step.
VERSIONstays0.4.4, the formal version onmain. The squash publishes no tag.Results (against 0.4.2, before the 0.4.3 and 0.4.4 squashes)
On seeds 1–4 the bot defeated the Woldbeast each time, with one wipe per seed at the floor-10 boss, 15.3k–16.5k frames, and about 4.5 minutes each under Xvfb with llvmpipe. Those runs predate the pack art and the window scale. Findings were filed as
playtestissues and were not fixed here:set_input_as_handledon a null viewport after camp or stairs start a battle3.0 MPFrame-time hitches show up under Xvfb with llvmpipe: 35 frames over 50 ms and over 3x the median on seed 4, worst 75 ms. Software rendering on a shared box likely causes these, so I didn't file them.
Checks on the rebase onto
ba8f789:tools/lint_gdscript.shclean,tools/run_tests.sh33/33.95692e48c8ae53503c41