Generate a test script for the described scenario
Creates minimal NCRS replay scripts to reproduce and debug reported game bugs.
/plugin marketplace add nethercore-systems/nethercore-ai-plugins/plugin install zx-dev@nethercore-ai-plugins[description of bug or behavior to test]Create a minimal NCRS replay script to reproduce and debug a reported issue.
If no argument provided, use AskUserQuestion:
The user can type a custom description.
If argument provided, parse the description for:
Search the game code for registered debug variables:
grep -r "debug_register" src/
Identify available variables like:
$player_x, $player_y - Position$velocity_x, $velocity_y - Movement$on_ground - Grounded stateSearch for available debug actions that can simplify test setup:
grep -r "debug_action_begin" src/
Look for actions that can skip setup:
Load Level - Jump to specific levelsSet Position - Place player at exact coordinatesSkip Menu - Bypass title/menu screensSpawn Enemy - Create test scenariosIf relevant actions exist, use them instead of long input sequences to reach the test scenario faster.
Check if tests/replay/ exists:
test -d tests/replay && echo "EXISTS" || mkdir -p tests/replay
Create a minimal .ncrs file based on the bug description.
Template structure (basic):
# [Bug Description] Test
# Tests: [what behavior is being verified]
# Expected: [expected behavior]
console = "zx"
seed = 0
players = 1
frames = [
# Initial state - always capture frame 0
{ f = 0, p1 = "idle", snap = true },
# Action frames - reproduce the bug
{ f = 1, p1 = "[input]", snap = true },
# Assertion - verify expected behavior
{ f = [N], p1 = "[input]", snap = true, assert = "[condition]" },
# After effect - capture result
{ f = [N+offset], p1 = "idle", snap = true },
]
Template with action setup (when available):
# [Bug Description] Test
# Tests: [what behavior is being verified]
# Expected: [expected behavior]
console = "zx"
seed = 0
players = 1
# Setup phase - use actions to skip to relevant state
[[frames]]
f = 0
action = "Load Level"
action_params = { level = 3 }
# Begin actual test
[[frames]]
f = 1
p1 = "idle"
snap = true
# Reproduce the bug
[[frames]]
f = 2
p1 = "[input]"
snap = true
assert = "[condition]"
Generate assertions based on bug type:
| Bug Type | Typical Assertion |
|---|---|
| Jump not working | assert = "$velocity_y < 0" |
| Not moving | assert = "$player_x > [initial]" or $velocity_x != 0 |
| Clipping | Compare positions at collision frames |
| Health issues | assert = "$health == [expected]" |
| Input not registering | Snap frames around input, check state changes |
Naming convention: [issue]_test.ncrs (e.g., jump_test.ncrs, collision_test.ncrs)
Write to tests/replay/[name]_test.ncrs.
Include comments explaining:
After writing the file, tell the user:
Test created: tests/replay/[name]_test.ncrs
Run the test:
nether replay run tests/replay/[name]_test.ncrs --report report.json
Or run headlessly:
nether replay run tests/replay/[name]_test.ncrs --headless --report report.json
After running, share report.json for analysis with /replay-analyze.