← Back to Godot · project planning pack

Skill · Version 1.0.0

Unity NPC scenario tests

Builds repeatable Unity tests for NPC decisions, sensors and navigation. Controls time and randomness, then checks real scene behavior where pure decision tests cannot prove the result.

unity-ai-scenario-testing

Agents using this skill

See how it helps

When is it useful?

Use it when AI behavior must remain stable after changes or rare target and lifecycle failures need dependable reproduction.

What does it help you do?

  • Tests pure decisions with controlled facts, clocks and randomness.
  • Uses PlayMode arenas for sensors, navigation and actor lifecycle.
  • Asserts bounded transitions and preserves reproducible failure traces.

Try asking this

Create a Unity test arena where a guard sees a player, loses sight behind a wall and searches the last known position. Fix the random seed and timing, verify bounded transitions and repeat the test after the guard is disabled and reused. Preserve a trace when the search fails.

Detailed documentation

Read the skill’s original instructions, examples and checks in their authored language.

Details…Show less

Reproducible NPC Scenario Tests

Inspect Unity Test Framework version, test assemblies, NPC architecture and available Editor/player tooling. Name the bug or behavior contract before choosing a test layer.

  • Test pure decision/scoring rules in EditMode with controlled facts, clock, random source and stable candidate ordering. Cover impossible choices, thresholds, ties, memory expiry and cancellation without constructing an unnecessary scene.
  • Use PlayMode for real sensors, physics, NavMesh, animation/lifecycle and scene transitions. Build a small arena with explicit geometry, layers, baked/runtime navigation and owned test actors; verify setup before interpreting a behavior failure.
  • Assert transitions and bounded outcomes, not arbitrary render-frame sleeps. A path request can be pending; observe completion/failure with a timeout and include a decision/path trace on failure.
  • Distinguish a reproducible scenario from deterministic Unity physics. Record seed, timestep, package versions, initial state and player input; do not promise identical cross-platform trajectories merely because the seed matches.
  • Test target destruction, occlusion, unreachable destinations, interrupted actions, pooled reuse and repeated scene load. Restore global time/random/physics settings and clean up actors, assets and subscriptions after each test.
  • For crowd performance, fix scene, actor count, camera, build/backend and warm-up. Use supported profiler/performance-test tooling; compare distributions/worst-frame spikes and allocations rather than a single Editor frame.

Run only checks supported by the current environment and task. Report EditMode, PlayMode and player results separately, preserve failure output and identify behavior that still requires human playtesting. Never reuse upstream example measurements as this project's results.

Reference: version-matched Unity Test Framework. No upstream test helper scripts are assumed installed.

Included files 2

  • LICENSE.txt
  • SKILL.md