t1k:unity:dots-ai:bdp-formations-pack
| Field | Value |
|---|---|
| Module | dots-ai |
| Version | 2.1.7 |
| Effort | high |
| Tools | — |
Keywords: AI movement, BDP, formations, tactical
How to invoke
Section titled “How to invoke”/t1k:unity:dots-ai:bdp-formations-packBDP Formations Pack
Section titled “BDP Formations Pack”Reference for Behavior Designer Pro — Formations Pack add-on by Opsive. Provides 15 built-in NavMesh group formation tasks, extensible via FormationsBase.
Related skills:
behavior-designer-pro(BDP core) ·agents-navigation(NavMesh bridge) ·dots-rpg(RPG library) ·bdp-tactical-pack(companion add-on) Related agents:dots-implementer
When This Skill Triggers
Section titled “When This Skill Triggers”- Using
Opsive.BehaviorDesigner.AddOns.FormationsPack.Runtime.Tasksnamespace (formation TASK classes — Column, Wedge, etc.) - Using
Opsive.BehaviorDesigner.AddOns.Shared.Runtime.Tasksnamespace (theFormationsBaseBASE CLASS — moved to Shared in BDP 3.0.x) - Implementing group movement: Column, Wedge, Diamond, V formation, Echelon, Skirmisher, etc.
- Working with
FormationsBase,CalculateFormationPosition,FormationGroupID - Formation leader/follower assignment (
ForceLeader) - Bridging MonoBehaviour formation logic to ECS via
AgentNavigationBridgeSystem
Available Formations
Section titled “Available Formations”15 built-in patterns — → See references/formations-catalog.md for shapes and use cases.
| Formation | Shape | Best For |
|---|---|---|
Column | Single file | Narrow corridors |
Line / Row | Straight / horizontal | Defensive front |
Wedge / V | Arrow-point / V-shape | Assault, flanking |
Diamond | Diamond | All-round defense |
Circle | Ring | Encirclement |
Arc | Curved line | Partial encirclement |
Grid | Rectangular | Large groups |
Square | Square ring | Escort protection |
Echelon | Diagonal stagger | Flanking advance |
Triangle | Triangular | Small assault |
Skirmisher | Dispersed spread | Recon/skirmish |
Swarm | Loose cluster | Mob AI |
Established | Keep current offsets | Preserve spread (renamed from Existing in BDP 3) |
Shared Settings
Section titled “Shared Settings”Formation Group Settings (must match across all agents in same group):
Is2D— Enable for 2D NavMesh (XY plane)FormationGroupID— Integer ID linking leader + followersForceLeader— Force this agent as permanent group leader
Leader Settings (leader entity only):
TargetPosition— Destination for the leaderFormationDirection—Transform/Movement/SpecifiedSpecifiedDirection— Used whenFormationDirection = SpecifiedMoveToInitialFormation— Wait for all agents to reach slots before advancingFailOnAgentRemoval— Fail task if any agent leaves groupUpdateUnitLocationsOnAgentRemoval— Recalculate slots on agent removal
Formation Tuning:
RotationSpeed/RotationThreshold— Rotation smoothingOutOfRangeDistanceDelta/InRangeDistanceDelta— Slot hysteresisOutOfRangeSpeedMultiplier— Catch-up speed boostStuckDuration— Seconds before stuck detection triggersStopOnTaskEnd— Stop NavMesh agent when task ends
Custom Formation
Section titled “Custom Formation”Extend FormationsBase to create a new pattern:
using Opsive.BehaviorDesigner.AddOns.Shared.Runtime.Tasks; // FormationsBase (BDP 3 — moved from FormationsPack to Shared)using UnityEngine;
public class MyFormation : FormationsBase{ public override bool AssignOptimialIndicies => true;
public override Vector3 CalculateFormationPosition( int index, int totalAgents, Vector3 center, Vector3 forward, bool samplePosition) { float spacing = 2f; float angle = (360f / totalAgents) * index * Mathf.Deg2Rad; return center + new Vector3( Mathf.Cos(angle) * spacing, 0f, Mathf.Sin(angle) * spacing); }}samplePosition = true→ returned position is NavMesh-sampledAssignOptimialIndicies = true→ pack minimizes total travel distance to slots (Hungarian algorithm)
BDP 3 namespace note:
FormationsBasemoved from the FormationsPack add-on to the Shared add-on (Opsive.BehaviorDesigner.AddOns.Shared.Runtime.Tasks) in BDP 3.0.x. Formation TASK classes (Column, Wedge, etc.) remain inFormationsPack.Runtime.Tasks— only the BASE CLASS moved. Updateusingdirectives in any custom formation classes when migrating from BDP 2.
DOTS / ECS Integration
Section titled “DOTS / ECS Integration”Formations Pack runs on MonoBehaviour NavMesh agents, not pure ECS:
- Formation task sets destination on NavMesh agent (MonoBehaviour side)
AgentNavigationBridgeSystemreadsNavigationTarget(ECS) → writesAgentBody.Destination- To use formations with DOTS entities: create ECS authoring wrapper that maps formation output to
NavigationTarget
Formation tasks set NavMesh destinations — they do NOT move agents directly. Movement is handled by Agents Navigation (AgentBody, AgentLocomotion).
Gotchas
Section titled “Gotchas”FormationGroupIDmust be identical across all agents in the same group — mismatched IDs = agents treated as independentForceLeaderon multiple agents in one group → undefined behaviorEstablishedformation captures world-space offsets at task start — not baked static offsets (renamed fromExistingin BDP 3)AssignOptimialIndiciesuses Hungarian algorithm — disable for groups 100+ if CPU cost matters- Formations Pack and Tactical Pack both consume
FormationsBasefrom the Shared add-on — single base class, two add-ons depending on it - BDP 3
FormationsBasenamespace moved — base class is now inOpsive.BehaviorDesigner.AddOns.Shared.Runtime.Tasks(wasFormationsPack.Runtime.Tasksin BDP 2). Custom formation classes need an updatedusingdirective
Reference Files
Section titled “Reference Files”| File | Content |
|---|---|
| formations-catalog.md | All 15 formations — visual shapes, parameters, use cases |