Skip to content

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.


patternLists
└── PatternList [multiple]
├── id
└── patterns
└── Pattern [multiple]
├── default, minHpRatio, maxHpRatio
├── normalMode
│ ├── tension (attackTension, cooperationTension, shorttermTargetTension)
│ └── incline (attackProb, moveProb, avoidProb, ...)
└── angerMode
├── tension
└── incline

Top-level container for a set of patterns.

PropertyTypeSinceDescription
idintv92Pattern list identifier

Each pattern defines an HP range and behavior configuration for normal and anger modes.

PropertyTypeSinceDescription
defaultboolv92Is the default pattern (used when no HP range matches)
minHpRatiodecimalv92Minimum HP ratio for this pattern to activate
maxHpRatiodecimalv92Maximum HP ratio for this pattern to activate

Each pattern has two mode containers: normalMode and angerMode. Both share the same structure containing a tension and incline block.


Selects which tension ID to use from each combat subsystem.

PropertyTypeSinceDescription
attackTensionintv92Tension ID to use from Attack tensionList
cooperationTensionintv92Tension ID to use from Cooperation tensionList
shorttermTargetTensionintv92Tension ID to use from ShorttermTarget stTensionList

Probability weights for each combat behavior type. The engine normalizes these values to determine which behavior is selected each tick.

PropertyTypeSinceDescription
attackProbdecimalv92Weight for attack behavior
avoidProbdecimalv92Weight for avoidance behavior
cooperationProbdecimalv92Weight for cooperation behavior
moveProbdecimalv92Weight for movement behavior
shorttermTargetProbdecimalv92Weight for short-term targeting
socialProbdecimalv92Weight for social behavior

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