Skip to content

AIData

VersionStatus
v92Full
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.


Entity: ai Operations: create, update, delete, upsert Key attributes: huntingZoneId, id (composite key)


spec:
version: "1.0"
schema: v92
ai:
create:
- huntingZoneId: 9001
id: 100
name: "basic_melee"
peaceState:
enable: true
checkInterval: 3000
combatState:
enable: true
checkInterval: 1000
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.0
spec:
version: "1.0"
schema: v92
ai:
update:
- huntingZoneId: 9001
id: 100
changes:
name: "updated_melee"
combatState:
targetLostDelay: 15000
spec:
version: "1.0"
schema: v92
ai:
delete:
- huntingZoneId: 9001
id: 100
spec:
version: "1.0"
schema: v92
ai:
upsert:
- huntingZoneId: 9001
id: 100
name: "upserted_melee"
peaceState:
enable: true
checkInterval: 3000
combatState:
enable: true
checkInterval: 1000

PropertyTypeSinceDescription
huntingZoneIdintv92Hunting zone identifier (used for file partitioning)
idintv92Unique AI template identifier within the zone
namestringv92Internal AI behavior name
ElementTypeDescriptionReference
peaceStatenestedIdle/peace behavior configurationPeaceState
cautionStatenestedAlert/caution behavior configurationCautionState
combatStatenestedFull combat behavior treeCombatState
eventListlistEvent triggers and actionsEvents

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]

  • Zone partitioning: AI entries are stored in zone-specific files. The huntingZoneId determines which file is modified. Creating an AI in zone 9001 creates/modifies AIData_9001.xml.

  • Composite key: AI entries are identified by both huntingZoneId AND id. Two AI entries in different zones can share the same id.

  • NpcData cross-reference: The aiid property on an NPC template in NpcData references the id of an AI entry in the same hunting zone. Both must share the same huntingZoneId.

  • 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 attack or combatState, the entire subtree is replaced. You cannot update a single Work entry — you must provide the complete workList.

  • Deep nesting: AIData supports 6 levels of nesting (root → combatState → attack → tensionList → tension → infos → info). Use the sub-pages for detailed property references.