Approach & Surround¶
Overview¶
Approach And Surround is the default chase-and-distribute behavior. Instead of every agent steering to the exact target center, each agent receives a deterministic offset around the target and tries to reach that distributed point.
In motion, this creates a horde that closes on the player, spreads into a ring or band, and slides into nearby open surround slots once agents are close enough. It is the foundation of swarm feel: pursuit pressure without a single-point pileup, and a crowd silhouette that reads clearly.
Use it for survivor-like games, zombie hordes, melee crowds, and any swarm that should chase while occupying space around the target.
Three subgroups, two pages
The Approach And Surround runtime behavior has three inspector subgroups. This page covers the Approach And Surround pursuit fields (weight, arrival, trailing). The ring size and shape fields live in Surround Shape under Crowd Spread. The lost-target recovery fields live in Out-of-Sight Fallback under Lost Target Behavior.
How it works¶
The diagram below shows what the three fields on this page actually do. The target moves with a velocity arrow. Each agent has an assigned surround slot; the slot is biased behind the target when Trail Behind Moving Target is non-zero. The steering vector toward that slot is scaled by Approach Weight, and it starts easing off as the agent enters the Arrival Distance ring around the slot.
Trail Behind Moving Target. The agent's steering arrow toward the slot is scaled by Approach Weight and tapers off as the agent enters the dashed Arrival Distance ring.Inspector at a glance¶
1
2
3
4
Runtime LOD Note¶
The runtime uses two gates to decide whether an agent runs the expensive adaptive surround slot solve.
Distance gate: when Use Out-of-Sight Fallback is on, agents outside Sight Distance fall back to lost-target leader following; agents within sight that are outside the near-target band use a cheap deterministic surround point. When the toggle is off, every agent is treated as in-sight and the distance gate never trips.
Importance LOD gate: adaptive slot solving only runs for Full-tier agents — those closest to the target. Reduced and Cheap tier agents reuse their cached slot or fall back to the cheap surround point.
Reassign Threshold, Slot Stickiness, and local occupancy checks only affect agents that pass both gates.
Parameter Reference¶
Simple Parameters¶
Start here — most projects only need these
-
Approach Weight
Higher values make agents commit harder to their surround slot.
Details
- Visible effect — Higher values make agents commit harder to their slot. Lower values let other behaviors (Personal Space, Close-Range Pressure, Orbit Style) steer more.
- Gameplay effect — More aggressive chase pressure versus more blending with spacing and orbit behaviors.
- Increase when — Agents feel sluggish or separation is overpowering pursuit.
- Decrease when — Agents shove through spacing, orbit, or close-range queueing too strongly.
- Pitfalls — Very high values dominate blended steering before the manager clamps the final result. A weight of
0is not the same as disabled — the behavior still runs internal bookkeeping. - Technical effect — Scales the unit steering vector toward the assigned surround point by this value before blending. Also scales surround drift contribution and the lost-target seek bias, but not the leader-follow weight.
Advanced Parameters¶
Power-user knobs — leave at defaults unless you have a reason
Arrival Distance¶
- Visible effect — Larger values create softer stops before the slot. Smaller values make agents drive closer to their exact slot position before easing off.
- Gameplay effect — Larger values feel heavier and less jittery near the target; smaller values feel more hungry and precise.
- Increase when — Agents overshoot, vibrate, or constantly micro-correct near the target.
- Decrease when — Agents stop too early or leave too much open space around the slot.
- Pitfalls — Setting this to
0removes arrival easing entirely. Very large values can make the crowd feel soft and affect whether an agent is counted as occupying a nearby slot for adaptive surround choices. - Technical effect — When the agent is within this distance of its assigned point, the steering force scales linearly from full down toward zero. Outside this radius the force is unscaled. Also used in the debug state machine and adaptive occupancy checks.
Trail Behind Moving Target¶
- Visible effect — The crowd forms a trailing wake behind a moving player instead of spreading evenly around them.
- Gameplay effect — Creates zombie-horde chase feel and makes kiting more legible to the player.
- Increase when — You want enemies to feel like they are pouring after the player.
- Decrease when — You want interception, flanking, or a clean all-sides surround.
- Pitfalls — Only applies when the target has velocity. High values make kiting easier because agents prefer the rear arc. Combining a high value here with high
Look-Ahead Timein Predictive Catch-Up sends mixed signals. - Technical effect — Adds
trailingDistanceworld units in the direction opposite to the target's planar velocity to each agent's assigned surround offset. For near-target agents in the adaptive solver, also penalizes candidate slots that are not aligned with the trailing direction when scoring.
Practical Usage Guidance¶
Use this behavior for the main enemy archetype in survivor-like games, zombie hordes, melee crowds, and any swarm that should chase a target while occupying space around it.
It works well with Personal Space for dense crowds and with Close-Range Pressure when enemies need to queue and take turns near the player. Predictive Catch-Up can be added for faster units, but too much prediction paired with high trailing distance sends mixed signals: one pulls ahead while the other biases behind the target.
Avoid relying on this alone for strafing enemies, orbiting hazards, or enemies that should keep a strict minimum distance. In those cases, combine lightly with Orbit Style or use a lower approach weight.
Gameplay Interpretation¶
Strong approach weight and low combat standoff (configured in Surround Shape) make enemies feel aggressive. High trailing distance makes the horde feel like a chase wave, which tends to make kiting easier but reads more clearly to the player.
Because the adaptive slot solver is concentrated near the target, far agents read more like a broad distributed chase wave than a fully negotiated surround ring. In most scenes that preserves the silhouette while keeping simulation cost down.
Quickstart — tune in this order
- Enable the behavior and adjust
Approach Weightuntil pursuit pressure feels right against the movement profile. - Tune the ring size in Surround Shape — set
Combat StandoffandSurround Widthfirst. - Adjust
Arrival Distanceonly if agents overshoot or stop too early near their slots. - Add
Trail Behind Moving Targetfor horde-chase feel; keep it low if you want flanking. - Enable Out-of-Sight Fallback only if the game needs limited awareness or recovery behavior.