← MonoGame · projekttervezési csomag adatlapja

Skill · 1.0.0 verzió

Unity NPC-hibakeresés

Az érzékelést, memóriát, döntést és mozgást külön követve magyarázza a Unity-szereplő furcsa viselkedését. Elavult adatot vagy versengő vezérlést keres a teljes döntési rendszer cseréje előtt.

unity-npc-ai-debugging

Ezt a skillt használó ügynökök

Nézd meg, miben segít

Mikor hasznos?

Akkor használd, ha ellenfél ingadozik, rosszul navigál vagy olyasmit tud, amit érzékelője nem figyelt meg.

Miben segít neked?

  • Külön követi az érzékelést, memóriát, döntést, végrehajtást és navigációt.
  • Ellenőrzi az elavult célt, ingadozó pontszámot és versengő mozgásírót.
  • Valósághű tömeget mér és javítás után újraellenőrzi az eredeti hibát.

Például ezt kérheted

Egy Unity-őr másodpercenként vált üldözés és járőrözés között. Minden váltásnál rögzítsd, mit lát, mire emlékszik és mit értékel, majd nézd meg a mozgás felelősét és a cél érvényességét. A bizonyított okot javítsd, és ugyanazon útvonalat több őrrel is teszteld stabilitásra és költségre.

Részletes dokumentáció

Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.

Részletek…Összecsukás

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.

Csomagban lévő fájlok 1

  • SKILL.md