Combat Aggro, Home Leash & Click Targeting
Wildlife chase limits, player targeting, threat tables, and ranged pursue bands.
Decisions
| Topic | Rule |
|---|---|
| Leash | Home/spawn based. If the NPC or its focus is farther than leash_radius_m from home while in alert/chase/combat, drop threat and return to patrol. |
| Acquire | aggro_radius_m is detection only (and soft return re-aggro near home). |
| Ranged min range | Keep range_min_m as an ability dead zone (classic bow). Auto-pursue does not backpedal; it holds and auto-attack skips until in band. |
| Focus | Highest threat among alive players wins. Tank foundation for parties. |
Auto-pursue band
Slot-1 auto-attack with auto-pursue uses the mainhand weapon ability’s range band.
- Too far (
dist > range_max_m − margin): advance toward target. - In band or inside
range_min_m: hold. Geometry still rejects shots closer thanrange_min_m. - Forced backpedal is not used — player WASD / weapon swap own positioning.
Content: bow_shot / arrow_shot use range_min_m: 3.0 in assets/combat/abilities/ranged.yaml.
Home leash + return to patrol
Predator FSM (plugin_id: predator_fsm — wolf, goblin, shadow stalker, and similar):
Fields (npc.combat in YAML / content-admin NPCs tab):
| Field | Meaning |
|---|---|
aggro_radius_m |
Acquire / see prey |
leash_radius_m |
Max distance of NPC or focus from home while fighting. 0 → derive as max(aggro×2, 12) |
Examples: wolf 14 / 28, goblin 12 / 24, shadow stalker 16 / 32.
On leash break: clear threat table, clear target, path to home_x/home_y, resume idle wander or path waypoints.
Click / SHIFT+click targeting (gfx)
| Input | Result |
|---|---|
| Left click on attackable NPC | Set T1 (primary) target |
| SHIFT+left click on candidate | Set T2 (secondary) target |
| Left click empty ground | Auto-nav walk (unchanged) |
| Tab / Shift+Tab | Cycle T1 / T2 (unchanged) |
Pick radius ≈ 1.75 m world. HUD empty-slot hint: Tab / click · Shift+click T2.
Threat / aggro table
- Runtime:
WildlifeAiState.threat: HashMap<EntityId, f32>. - On damaging hit:
threat[attacker] += damage * aggro_modifier(floor tiny amount so zero-damage hooks can still register later). - Each predator tick: retarget to
top_threat_targetamong alive players. - Pack assist: allies get a fraction of that threat toward the damaging player.
- Full clear on
reset_wildlife_combat/ begin return.
Ability field aggro_modifier (default 1.0) in ability YAML / content-admin Abilities tab. Melee swords sample at 1.5 (short_sword.yaml) so tanks can out-aggro raw DPS with modifiers + sustained hits.
Healer threat from heals and full party hate UI are not in this revision.
Designer notes
- Set
leash_radius_mon hostile NPCs (or leave0for 2× aggro default). - Tune
aggro_modifieron tank / taunt skills higher than 1; optional lower on glass-cannon skills. - Keep bow
range_min_mif you want a dead zone; players must step back or switch to melee — the client will not auto-kite for them. - Edit via content-admin (
http://127.0.0.1:7386) NPCs + Abilities tabs; publish content when ready.
Related pages
- Complete Combat System — full combat reference
- Status effects — on-hit and DoTs
- NPC lifecycle & ground loot — death and respawn