Skip to content

t1k:unity:dots-testing:runtime-validator

FieldValue
Moduledots-testing
Version2.1.7
Effortmedium
Tools

Keywords: DOTS, runtime validation, testing, validator

/t1k:unity:dots-testing:runtime-validator

Validates full ECS pipeline end-to-end via MCP tools during Play mode. Generic — works for ANY project using the dots-rpg library.

  • After implementing/modifying systems or components
  • After scene setup changes or prefab updates
  • Before committing code changes (final verification)
  • Debugging “troops don’t move”, “entities invisible”, “no combat” issues
  • After clearing Library/EntityScenes/ cache
TaskCheck
Verify compilationConsole Clean (#1)
Confirm entities existEntities Spawn (#2)
Confirm renderingRendering Active (#3)
Debug invisible entitiesNaN Bounds (#4)
Confirm AI/navigationTroops Move (#5)
Confirm combat pipelineCombat Active (#6)
Debug camera issuesCamera Valid (#7)
Full battle testBattle Resolves (#8)

Load ALL via ToolSearch before validation:

ToolPurposeNote
mcp__UnityMCP__manage_editorEnter/pause/stop Play modeUse action="play", "pause", "stop"
mcp__UnityMCP__read_consoleError checkingFilter with types=["error"]
mcp__UnityMCP__manage_dotsEntity queries (count, list, inspect)Use DIRECTLY — NOT through execute_custom_tool
mcp__UnityMCP__batch_executerendering_stats via batchbatch_execute(commands=[{"tool":"rendering_stats","params":{...}}])
mcp__UnityMCP__find_gameobjectsFind Camera, NavMeshSurfaceEdit mode checks
mcp__UnityMCP__manage_componentsRead camera/component propertiesEdit mode only
mcp__UnityMCP__manage_sceneSubScene hierarchy checksEdit mode checks
mcp__UnityMCP__validation_snapshotAggregated validation data (capture/compare)Use this FIRST — replaces 15+ individual MCP calls with 1

CRITICAL: manage_dots is a DIRECT MCP tool — call it directly as mcp__UnityMCP__manage_dots. rendering_stats is NOT a direct MCP tool — call it via batch_execute(commands=[{"tool":"rendering_stats","params":{"action":"get_stats"}}]).

PREFERRED: If validation_snapshot tool is available, use it instead of individual manage_dots + rendering_stats calls. It aggregates entity counts, rendering stats, position snapshots, and combat state in a single response.

#CheckMCP ToolAction/ParamsPass ConditionPhase
1Console Cleanread_consoletypes=["error"]0 errorsPre-flight (Edit mode)
1bSubScene Presentmanage_dots_subsceneaction="list_subscenes"count > 0 OR Bootstrapper wires one at runtimePre-flight (Edit mode) — MANDATORY
1cGame-view Aspectinspect editor / ask useraspect matches project target form factormatches the project’s documented form factor (e.g., 2160x1080 Portrait)Pre-flight (Edit mode)
2Entities Spawnmanage_dotsaction="query_count", component DOTSCombat.Healthcount > 0Play: T+5s
3Rendering Activeexecute_custom_toolrendering_stats, action="get_stats"drawCalls > 10 AND triangles > 100Play: T+5s
4No NaN Boundsmanage_dotsaction="query_entities", ChunkWorldRenderBoundsno NaN/Infinity in valuesPlay: T+5s
5Troops Movemanage_dotsquery_entities LocalTransform at T1 vs T2position delta > 0.1 for >50% entitiesPlay: PAUSE at T+10s
6Combat Activemanage_dotsaction="query_count", DeadTag (enabled only)count > 0Play: PAUSE at T+20s
7Camera Validmanage_componentsread Camera on MainCamerafarClipPlane > camera.position.yPre-flight
8Battle Resolvesmanage_dotsquery DOTSCombat.BattleStatewinner != 0Play: poll until done

Pre-flight gate 1b — Empty Play mode root cause

Section titled “Pre-flight gate 1b — Empty Play mode root cause”

If manage_dots_subscene list_subscenes returns count=0 AND no Bootstrapper is wired:

  • Play mode WILL render an empty Game view (only Camera + Light visible)
  • manage_dots list_worlds will show ONLY default systems (no Converted Scene:* worlds)
  • Fix path: run the demo’s Tools/<DemoName>/Setup Scene menu item (idempotent per the project’s “Editor SceneSetup idempotency” rule) BEFORE entering Play mode
  • This precondition is MANDATORY because the symptom (“nothing renders”) otherwise looks like a rendering bug, not a scene-setup gap
  • Generic for any Unity DOTS project — applies any time a demo scene is committed without a SubScene component wired up

Pre-flight gate 1c — Game-view aspect mismatch

Section titled “Pre-flight gate 1c — Game-view aspect mismatch”

If Unity Game-view aspect doesn’t match the project’s documented target form factor:

  • Demo UI Canvas may scale to wrong dimensions
  • Camera viewport may letterbox or squeeze the playable area
  • User will report “nothing visible” or “everything is tiny/squashed”
  • Target form factor MUST be documented in the project’s CLAUDE.md (e.g., 2160x1080 Portrait for portrait-mobile demos)
  • Cannot be set programmatically via current MCP tools — ASK USER to switch aspect via Game-view Aspect dropdown before declaring validation pass
  • Generic for any Unity project that has a documented target form factor

-> See references/validation-protocol-guide.md for full phase-by-phase workflow, pause/resume strategy, and optimized validation_snapshot workflow.

Anti-PatternSymptomFix
Not pausing to inspect stateMiss movement/combat windowsUse pause/resume at T+5s, T+15s, T+25s
Using execute_custom_tool for manage_dotsIndirect call, slowerCall manage_dots DIRECTLY as MCP tool
Fixed sleep instead of pollingFlaky results on slow machinesPoll with timeout loop
Hardcoded entity counts (e.g., == 82)Fails when army size changesUse > 0 or percentage thresholds
Demo-specific component queriesBreaks in new projectsUse generic components: Health, DeadTag, LocalTransform
Skipping console checkMiss compilation errorsALWAYS check console FIRST
Checking DamageEvent buffer for combatBuffer cleared same frameCheck Health.Current decrease or DeadTag enabled count
Single position snapshot for movementCan’t detect movementTake TWO snapshots with 3-5s gap
Inheriting Play mode sessionBattle already endedALWAYS stop and re-enter Play mode
Not stopping Play mode on errorUnity stuck in bad stateALWAYS stop play mode in finally block

-> See references/troubleshooting-guide.md for common failures table and 19 documented gotchas.