runtime_assert
Validate live Godot game state by asserting node properties, scene structure, on-screen text, performance baselines, and screenshot differences during runtime.
Instructions
运行时断言:在运行中的游戏上验证节点状态/场景结构/屏幕文本/性能/截图对比。agent 可任意时刻调用,不必走 workflow.dev_loop。全部依赖 game-bridge(需先 game_bridge_install + 游戏运行中)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | node_state: 节点路径(如 /root/Main/Player) | |
| text | No | screen_text: 要查找的文本 | |
| nodes | No | scene_structure: 期望的节点列表 | |
| action | Yes | 断言类型 | |
| expect | No | node_state: 期望的属性键值对(如 {"health": 100, "position": {"x": 0}}) | |
| present | No | screen_text: true=断言文本存在(默认),false=断言不存在 | |
| baseline | No | perf: 期望的性能基线(如 {"fps": 60}) | |
| reference | No | screenshot_diff: 参考截图路径(res://、项目相对或绝对路径;须在白名单内) | |
| threshold | No | screenshot_diff: 像素差异容忍阈值(0-1,默认 0.12)。per-pixel 归一化 RGB 距离严格大于此值才计为差异像素;值越小越严格 | |
| tolerance | No | node_state/perf: 数值容差(默认 0,精确匹配) | |
| project_path | No | 项目路径(screenshot_diff 必填:解析 user:// 截图落盘位置) | |
| max_diff_ratio | No | screenshot_diff: 允许的差异像素占比上限(0-1,默认 0.05)。严格像素回归传 0;常规视觉回归建议以同布局好图对校准(本仓实测同布局好图对 ≈0.176,勿低于该量级) |