← Zurück zu libGDX · Projektplanungspaket

Skill · Version 1.0.0

Unity-NPC-Fehlersuche

Erklärt unerwartetes Unity-NPC-Verhalten durch getrennte Spuren von Wahrnehmung, Gedächtnis, Entscheidung und Bewegung. Sucht veraltete Fakten oder konkurrierende Steuerung vor einem Systemwechsel.

unity-npc-ai-debugging

Agenten mit diesem Skill

Entdecke, wie der Skill hilft

Wann ist der Skill hilfreich?

Nutze ihn bei pendelnden, schlecht navigierenden oder scheinbar allwissenden Gegnern.

Wobei hilft er dir?

  • Verfolgt Wahrnehmung, Gedächtnis, Entscheidungen, Ausführung und Navigation getrennt.
  • Prüft veraltete Ziele, schwankende Bewertungen und konkurrierende Bewegungsschreiber.
  • Profiliert typische Gruppen und prüft den ursprünglichen Fehler nach Korrektur.

Das könntest du fragen

Eine Unity-Wache wechselt jede Sekunde zwischen Verfolgung und Patrouille. Erfasse bei jedem Wechsel Wahrnehmung, Erinnerung und Bewertung und prüfe Bewegungszuständigkeit sowie Zielgültigkeit. Korrigiere die belegte Ursache und wiederhole dieselbe Route mit mehreren Wachen auf Stabilität und Aktualisierungskosten.

Ausführliche Dokumentation

Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.

Details…Weniger anzeigen

NPC AI Debugging and Tuning

Reproduce before changing behavior

Record scene, Unity/package versions, NPC configuration, initial state, actor count, player actions and random seed when controllable. Write the expected decision and the actual decision at a specific point in the scenario. Separate a behavior-design disagreement from an implementation defect.

Collect a compact trace of sensed facts, remembered facts and age, current state/action, transition reason, candidate scores, cooldowns, path status, motor ownership and interruptions. Prefer on-demand bounded traces over logging every NPC every frame.

Diagnose by layer

  1. Perception: verify sensor origin, range/FOV, layer/trigger filters, occluders and whether information was sensed or shared.
  2. Memory: check timestamp/expiry, stale targets, pooled actor identity and whether last-known positions are updated without perception.
  3. Decisions: inspect guards, normalized utility values, ties, invalid candidates, priority and fallback. Look for oscillation and unreachable exit conditions.
  4. Execution: check cancellation, action completion, reservations, cooldown/reset semantics and competing movement writers.
  5. Navigation: inspect baked surfaces, agent type, destination projection, pending/partial/invalid paths, link traversal and retry rate.
  6. Runtime budget: profile representative crowds and separate sensing, decisions, pathfinding, animation and rendering. Compare fixed scenarios before/after and inspect worst-frame spikes as well as averages.

Verify the correction

Add focused behavior checks when the environment permits: lost target, unreachable destination, interruption, death/pooling, zero valid choices and repeated transitions. Control randomness and clock inputs for reproduction without claiming the whole Unity simulation is deterministic.

Tune one behavior parameter against an explicit player outcome at a time. Preserve reaction limits, readable attack signals and difficulty rules rather than masking bugs with omniscience or inflated stats. Report what changed, why the trace supports it, what ran and what needs playtesting or target hardware.

References: project-version Unity Profiler, installed AI Navigation/Behavior documentation and the game's own acceptance scenarios. Do not start remote inference, paid training or broad architecture replacement as a debugging shortcut.

Enthaltene Dateien 1

  • SKILL.md