AIData
Version Support
Section titled “Version Support”| Version | Status |
|---|---|
| v92 | Full |
| v90 | - |
| v86 | - |
AIData files define NPC AI behavior: peace/caution/combat states, attack patterns, cooperation, and event handling. Each hunting zone has its own file using the naming convention AIData_{huntingZoneId}.xml. The aiid property on an NPC template in NpcData references an AI entry by its id within the same zone.
DSL Support
Section titled “DSL Support”Entity: ai
Operations: create, update, delete, upsert
Key attributes: huntingZoneId, id (composite key)
Quick Recipes
Section titled “Quick Recipes”Create (minimal)
Section titled “Create (minimal)”spec: version: "1.0" schema: v92
ai: create: - huntingZoneId: 9001 id: 100 name: "basic_melee" peaceState: enable: true checkInterval: 3000 combatState: enable: true checkInterval: 1000Create (with combatState)
Section titled “Create (with combatState)”spec: version: "1.0" schema: v92
ai: create: - huntingZoneId: 9001 id: 100 name: "melee_attacker" peaceState: enable: true checkInterval: 3000 randomMove: probMove: 0.6 moveRadius: 300 moveMinDistance: 100 moveMaxDistance: 300 combatState: enable: true checkInterval: 1000 combatEndDelay: 5000 targetLostDelay: 10000 attack: workList: - id: 1 normalBehaviorId: 1001 normalBehaviorType: "skill" angerBehaviorId: 1002 angerBehaviorType: "skill" tensionList: - id: 1 infos: - workId: 1 prob: 1.0Update
Section titled “Update”spec: version: "1.0" schema: v92
ai: update: - huntingZoneId: 9001 id: 100 changes: name: "updated_melee" combatState: targetLostDelay: 15000Delete
Section titled “Delete”spec: version: "1.0" schema: v92
ai: delete: - huntingZoneId: 9001 id: 100Upsert
Section titled “Upsert”spec: version: "1.0" schema: v92
ai: upsert: - huntingZoneId: 9001 id: 100 name: "upserted_melee" peaceState: enable: true checkInterval: 3000 combatState: enable: true checkInterval: 1000Properties Reference
Section titled “Properties Reference”Top-Level Attributes
Section titled “Top-Level Attributes”| Property | Type | Since | Description |
|---|---|---|---|
huntingZoneId | int | v92 | Hunting zone identifier (used for file partitioning) |
id | int | v92 | Unique AI template identifier within the zone |
name | string | v92 | Internal AI behavior name |
Nested Elements
Section titled “Nested Elements”| Element | Type | Description | Reference |
|---|---|---|---|
peaceState | nested | Idle/peace behavior configuration | PeaceState |
cautionState | nested | Alert/caution behavior configuration | CautionState |
combatState | nested | Full combat behavior tree | CombatState |
eventList | list | Event triggers and actions | Events |
XML Structure
Section titled “XML Structure”AIData files use a zone-partitioned structure with deeply nested combat behaviors:
AIData_{huntingZoneId}.xml└── AIData (huntingZoneId) └── AI (id) [multiple] ├── name ├── PeaceState │ ├── Scalar properties │ ├── RandomMove │ │ └── Social [multiple] │ └── Buff [multiple] │ └── Skill [multiple] ├── CautionState │ └── ActiveMove [multiple] ├── CombatState │ ├── Scalar properties │ ├── Idle │ ├── Move │ ├── Avoid │ ├── Social │ ├── AggroChangeAttack │ ├── MonsterFlee │ ├── MonsterSummon │ ├── CounterFlee │ ├── Attack │ │ ├── Work [multiple] │ │ └── Tension [multiple] │ │ └── Info [multiple] │ ├── Cooperation │ │ ├── CooperationWork [multiple] │ │ ├── Tension [multiple] │ │ │ └── Info [multiple] │ │ └── ReceiveOrder [multiple] │ ├── ShorttermTarget │ │ ├── StWork [multiple] │ │ └── StTension [multiple] │ │ └── StInfo [multiple] │ ├── AbsolutelyAttack │ │ ├── Work [multiple] │ │ ├── CutAllBehavior [multiple] │ │ └── CutNextAttack [multiple] │ └── PatternList [multiple] │ └── Pattern [multiple] │ ├── NormalMode │ │ ├── Tension │ │ └── Incline │ └── AngerMode │ ├── Tension │ └── Incline └── Event [multiple]Common Pitfalls
Section titled “Common Pitfalls”-
Zone partitioning: AI entries are stored in zone-specific files. The
huntingZoneIddetermines which file is modified. Creating an AI in zone 9001 creates/modifiesAIData_9001.xml. -
Composite key: AI entries are identified by both
huntingZoneIdANDid. Two AI entries in different zones can share the sameid. -
NpcData cross-reference: The
aiidproperty on an NPC template inNpcDatareferences theidof an AI entry in the same hunting zone. Both must share the samehuntingZoneId. -
Structural defaults: Many nested elements have engine defaults that apply when omitted. Only specify elements you need to override.
-
Element replacement on update: When updating nested elements like
attackorcombatState, the entire subtree is replaced. You cannot update a singleWorkentry — you must provide the completeworkList. -
Deep nesting: AIData supports 6 levels of nesting (root → combatState → attack → tensionList → tension → infos → info). Use the sub-pages for detailed property references.