Tactical Pack for Behavior Designer Pro
Adding a New Group
Add Task to your Behavior Tree
- In your behavior tree, right-click and select Add Task.
- Navigate to the Tactical Pack category or type the name of the formation task that you want add.
- Choose one of the available tactical types.
Configure the Formation Base Settings
Formation Group Settings
- Is 2D: Is this task being used in a 2D space?
- Formation Group ID: Integer that defines which group this agent belongs to.
- Force Leader: When enabled, this agent will be forced as the leader of the group.
Leader Settings
- Formation Direction: How the formation should be oriented:
- Transform Direction: Uses the leader’s forward direction.
- Movement Direction: Uses the direction from current position to target.
- Specified: Uses a custom vector you define.
- Specified Direction: Forward direction if using “Specified” orientation.
- Move To Initial Formation: If enabled, agents first create the formation before moving.
- Fail On Agent Removal: If enabled, the task fails if any agent leaves the formation.
- Update Unit Locations On Agent Removal: If enabled, formation positions update when agents leave.
Formation Settings
- Rotation Speed: Degrees per second agents rotate.
- Rotation Threshold: Angle threshold for stopping rotation.
- Out Of Range Distance Delta: Distance at which an agent is considered out of range.
- In Range Distance Delta: Distance at which an agent is considered back in range.
- Out Of Range Speed Multiplier: Speed adjustment for out-of-range agents.
- Stuck Duration: Time with zero velocity before agent is considered stuck.
- Stop On Task End: Whether to stop movement when the task ends.
Tactical Settings
- Targets: The target GameObjects that should be attacked.
- Attack Delay: Specifies when the attack should be delayed:
- None: Attack immediately when possible.
- Arrival: Wait until the agent arrives at their position before attacking.
- GroupArrival: Wait until all agents in the group arrive at their positions before attacking.
Configure Tactical-Specific Settings
Interfaces
Each project is going to have a different definition of what it means to attack or take damage. To account for this the Tactical Pack requires two interfaces to be implemented in order for the agents to actually act. These interfaces have already been implemented you are using the Ultimate Character Controller or Playmaker integration.
IAttackAgent
public interface IAttackAgent { // Properties float MinAttackDistance { get; } // Minimum distance required to attack float MaxAttackDistance { get; } // Maximum distance the agent can attack from float AttackAngleThreshold { get; } // Maximum angle from target to agent for attack // Methods void RotateTowards(Vector3 direction); // Rotate agent towards specified direction void Attack(Transform targetTransform, IDamageable targetDamageable); // Perform attack }
IDamageable
public interface IDamageable { bool IsAlive { get; } // Whether the object is currently alive void Damage(float amount); // Take damage by the specified amount }
Integrations
You can download the Tactical Pack integrations from this page using your Tactical Pack invoice number.
A* Pathfinding Project
The Tactical Pack agents can traverse using the A* Pathfinding Project. After importing the A* Pathfinding Project integration select the AstarAI Pathfinder within the Tactical Pack task.
Ultimate Character Controller
Ultimate Character Controller characters can both attack and receive damage with the Tactical Pack. Add the CharacterAttackAgent component to your character controller in order to attack, and the DamageableAgent component in order for the character to take damage.
Playmaker
The Tactical Pack tasks can use Playmaker to attack and receive damage. To have an agent attack use Playmaker, add the AttackBridge component to your agent. This component allows you to specify which Playmaker event should be triggered when an attack should take place. Optionally a GameObject may also be specified which indicates the target that the agent should attack.
Receiving damage with Playmaker is similar to attacking. Add the DamagableBridge component to any GameObject that can receive damage, and the Damage Event will be triggered when the GameObject should take damage. The Damage Amount and Health Variable Names are required. These variables map to a Playmaker variable which specify how much damage was received and the total health that the GameObject has left.