← Játékfejlesztők adatlapja

Skill · 1.0.0 verzió

Unity NPC-viselkedés

Érthető Unity-szereplőviselkedést tervez tudáshatárokkal, prioritásokkal és megszakítási szabályokkal. A szükséges legegyszerűbb döntési modellt használja, rejtett információk mindentudó követése nélkül.

unity-npc-behavior

Ezt a skillt használó csapattagok

Nézd meg, miben segít

Mikor hasznos?

Akkor használd, ha őrjáratot, harcot vagy nehézséget tervezel a mechanikánál nagyobb AI-keret hozzáadása nélkül.

Miben segít neked?

  • A mechanikához illő legkisebb döntési modellt választja.
  • Meghatározza az őrfeltételt, prioritást, megszakítást, célérvényességet és várakozást.
  • Elválasztja az érzékelt tudást a végrehajtástól mindentudó követés nélkül.

Például ezt kérheted

Készíts Unity-őrt, amely járőrözik, zajt vizsgál és látótávolság-vesztés után keres. Határozd meg az utolsó ismert hely emlékezeti idejét és a keresést megszakító támadást. Teszteld a fedezékbe bújást és cél megszűnését: az őr érvényes akcióra térjen vissza, a nem látott pozíció ismerete nélkül.

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 Decisions and Behavior

Choose the smallest decision model

Read project instructions, Unity/package versions, existing NPC code, movement/animation authority and networking rules. Define player-facing scenarios and what each NPC may know. Reuse the current architecture unless the task calls for replacing it. A small FSM is often sufficient; use behavior trees, utility scoring or planning when the actual decision complexity warrants them.

Decision contracts

  • Separate perception and memory from decision making, action execution, steering and locomotion. Actions consume known facts and issue motor commands instead of directly competing with the movement controller.
  • Specify states/actions, entry and exit behavior, guards, priorities, interruption, cooldowns and failure results. A task that never completes or cancels can stall an entire behavior tree.
  • For utility decisions, document considerations, normalization, invalid choices, tie handling and fallback. Add hysteresis/commitment where needed so small score changes do not cause rapid oscillation.
  • Give targets explicit validity and memory expiry. Handle death, despawn, pooling, scene changes and stale references. Cancellation must release reservations, subscriptions and motor commands.
  • Define fairness: reaction delay, line of sight, hearing, last-known position, attack telegraphs and permitted shared knowledge. Do not silently grant omniscient player tracking.
  • Bound decision frequency and expensive work. Check the intended crowd size and avoid synchronized spikes; optimize from traces, not assumptions.
  • Unity Behavior and other frameworks are optional dependencies. Check the installed version before choosing graph APIs; do not claim a graph exists or hand-edit its serialized representation without verified tooling.

Verify and explain

Expose current state/action, transition reason, known target, memory age and relevant scores. Exercise idle/patrol, detection, pursuit, attack, target loss, interrupted action and recovery. Use controlled randomness for reproduction; do not claim fairness or believability from compilation alone.

References: version-matched Unity Behavior, Craig Reynolds's action-selection/steering/locomotion model and Dave Mark's utility architecture overview. These are design references, not required libraries. Inspect relevant official Unity agent skills before proposing additional tools. LLM inference or ML training is a separate explicitly authorized feature, not a prerequisite for NPC AI.

Csomagban lévő fájlok 1

  • SKILL.md