AIData: Patterns
Part of CombatState. The pattern system allows NPCs to switch between different behavior profiles based on their HP ratio. Each pattern selects which tension sets (from Attack, Cooperation, ShorttermTarget) are active and how combat inclines are weighted.
Structure
Section titled “Structure”patternLists└── PatternList [multiple] ├── id └── patterns └── Pattern [multiple] ├── default, minHpRatio, maxHpRatio ├── normalMode │ ├── tension (attackTension, cooperationTension, shorttermTargetTension) │ └── incline (attackProb, moveProb, avoidProb, ...) └── angerMode ├── tension └── inclinePatternList
Section titled “PatternList”Top-level container for a set of patterns.
| Property | Type | Since | Description |
|---|---|---|---|
id | int | v92 | Pattern list identifier |
Pattern
Section titled “Pattern”Each pattern defines an HP range and behavior configuration for normal and anger modes.
| Property | Type | Since | Description |
|---|---|---|---|
default | bool | v92 | Is the default pattern (used when no HP range matches) |
minHpRatio | decimal | v92 | Minimum HP ratio for this pattern to activate |
maxHpRatio | decimal | v92 | Maximum HP ratio for this pattern to activate |
Mode Containers
Section titled “Mode Containers”Each pattern has two mode containers: normalMode and angerMode. Both share the same structure containing a tension and incline block.
PatternTension
Section titled “PatternTension”Selects which tension ID to use from each combat subsystem.
| Property | Type | Since | Description |
|---|---|---|---|
attackTension | int | v92 | Tension ID to use from Attack tensionList |
cooperationTension | int | v92 | Tension ID to use from Cooperation tensionList |
shorttermTargetTension | int | v92 | Tension ID to use from ShorttermTarget stTensionList |
PatternIncline
Section titled “PatternIncline”Probability weights for each combat behavior type. The engine normalizes these values to determine which behavior is selected each tick.
| Property | Type | Since | Description |
|---|---|---|---|
attackProb | decimal | v92 | Weight for attack behavior |
avoidProb | decimal | v92 | Weight for avoidance behavior |
cooperationProb | decimal | v92 | Weight for cooperation behavior |
moveProb | decimal | v92 | Weight for movement behavior |
shorttermTargetProb | decimal | v92 | Weight for short-term targeting |
socialProb | decimal | v92 | Weight for social behavior |
DSL Example
Section titled “DSL Example”Default pattern plus an HP-gated enrage phase:
ai: create: - huntingZoneId: 9001 id: 500 name: "boss_with_patterns" combatState: enable: true checkInterval: 1000 attack: workList: - id: 1 normalBehaviorId: 1001 normalBehaviorType: "skill" angerBehaviorId: 1002 angerBehaviorType: "skill" - id: 2 normalBehaviorId: 2001 normalBehaviorType: "skill" angerBehaviorId: 2002 angerBehaviorType: "skill" tensionList: - id: 1 infos: - workId: 1 prob: 0.7 - workId: 2 prob: 0.3 - id: 2 infos: - workId: 2 prob: 1.0 patternLists: - id: 1 patterns: - default: true normalMode: tension: attackTension: 1 incline: attackProb: 0.6 moveProb: 0.2 avoidProb: 0.1 socialProb: 0.1 angerMode: tension: attackTension: 1 incline: attackProb: 0.8 moveProb: 0.1 avoidProb: 0.1 - minHpRatio: 0.0 maxHpRatio: 0.3 normalMode: tension: attackTension: 2 incline: attackProb: 0.9 moveProb: 0.1 angerMode: tension: attackTension: 2 incline: attackProb: 1.0