Skip to content

Automation

Kevin Mallinson edited this page Nov 14, 2026 · 1 revision

Automation

A command channel for test runs. With [features] automation=1 the game reads thug2-decomp-commands.txt in its folder once a frame and writes its state to thug2-decomp-status.json. Scripts can then drive the game without posting keys or waiting fixed times: a cold start to the free-skate level select takes about 8 seconds.

It is meant for test copies of the game, not the install you play. Online play is always refused: no command joins, hosts or enters a lobby.

Commands

One a line; # starts a comment.

Command What it does
waitfor ready / frontend / ingame / level <name> / menu <id> / focus <id> Waits for the game to get there
level <name> Loads a level (as -level)
choose <id>, focus <id> Chooses / focuses a menu item, stepping the menu there as the pad would
press <button> [frames], hold <button> [frames] Presses or holds a pad button
run <script> [name=value ...] Runs a game script
teleport <x> <y> <z> [heading] Puts the skater there, standing
camera <x> <y> <z> <dx> <dy> <dz> [<vx> <vy> <vz>], camera off Holds the camera at a pose (optionally moving) / lets it go
capture <frames> [folder] [afterload] Saves the next frames as PNGs in Screenshots\<folder>
trace <frames> [objects] Writes the skater's state every frame to thug2-decomp-trace.txt
rtprobe ..., colprobe ... Casts one ray through the ray-traced scene / the game's collision
fe select <screen>/<item>, fe focus, fe back, fe press Drives the new front end
console <line> Runs a console command
wait <frames>, echo <text>, quit

A failure or a refusal skips the rest of the batch.

The scripts that use it

tools/game has the PowerShell and TypeScript scripts built on it: run_game.ps1 -Commands ..., game_cmd.ps1 for a running game, and the checks that capture the same spots with different settings (renderer_parity.ts, water_check.ts, rt_shadows_check.ts, frame_bench.ts...). Its README lists them all. Most of this wiki's pictures were taken with teleport, camera and capture.

Clone this wiki locally