| ... | ... | @@ -2,26 +2,26 @@ On this site, you get more insight on how to set up agent formations in combinat |
|
|
|
|
|
|
|
## Setting up Formations
|
|
|
|
|
|
|
|
In order to set up a formation you need a couple of VH in the scene that shall walk together in formation. You only need to set up one VH that will be the parent of the group.
|
|
|
|
In order to set up a formation you need a couple of VH in the scene that shall walk together in formation. You only need to set up one VH that will serve as the parent of the group.
|
|
|
|
|
|
|
|
In the Details panel of the parent VH select the *VHMovement* component. Under the header *Group Movement* you can see three parameters:
|
|
|
|
In the details panel of the parent VH select the *VHMovement* component. Under the header *Group Movement* you can see three parameters:
|
|
|
|
|
|
|
|
| Name | Details |
|
|
|
|
| Parameter| Details |
|
|
|
|
|------|---------|
|
|
|
|
| Child VH | A Map containing a VH as key and a float that represents the offset from the current VH as value |
|
|
|
|
| Group Formation | Currently only 2 formations are supported. Walking in line and abreast |
|
|
|
|
| Draw Debug Spheres | toggle to show debug spheres|
|
|
|
|
| Child VH | A Map containing a VH actor as key and a float that represents the offset from the current VH as value. |
|
|
|
|
| Group Formation | Currently only 2 formations are supported. Walking in line and abreast. |
|
|
|
|
| Draw Debug Spheres | Show navigation points used by the children. See [How it works](#How it works)|
|
|
|
|
|
|
|
|
For every VH that should walk alongside the parent, provide an entry in the *Child VH* Map. As key you provide other VHs and as value an offset that specifies the distance the child will have from the parent. Depending on the selected formation the offset will change its behavior. E.g. if you select *InLine* a positive offset will be behind the parent and a negative offset will be in front of the parent. If you select *Abreast* a positive offset will be to the left of the parent and a negative to the right.
|
|
|
|
For every VH that should walk alongside the parent, provide an entry in the *Child VH* Map. As key you provide a VH actor and as value an offset that specifies the distance the child will have from the parent. Depending on the selected formation the offset will change its behavior. E.g. if you select *InLine* a positive offset will be behind the parent and a negative offset will be in front of the parent. If you select *Abreast* a positive offset will be to the left of the parent and a negative to the right.
|
|
|
|
|
|
|
|
Don't forget to set up the Waypoint Movement (selecting a Waypoint Group and order). You only need to set up the parent, as all settings (Waypoint and Group Movement) will be forwarded to the child (all VHs specified in the *Child VH* Map) when the game starts.
|
|
|
|
Don't forget to set up the Waypoint Movement (selecting a Waypoint Group and order). You only need to set up the parent, as all settings (Waypoint and Group Movement) will be forwarded to the children (all VHs specified in the *Child VH* Map) when the game starts.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
## How it works
|
|
|
|
|
|
|
|
If you enable *DrawDebugSpheres* you will see additional points that are calculated for every child around every waypoint, depending on last and next waypoint, group formation and offset.
|
|
|
|
The parent will simply traverse all the Waypoints, but for the children we need to create additional points for navigation. If you enable *DrawDebugSpheres* you will see additional points that are calculated for every child around every waypoint, depending on last and next waypoint, group formation and offset.
|
|
|
|
|
|
|
|
#### Abreast
|
|
|
|
|
| ... | ... | @@ -32,7 +32,7 @@ For abreast formations and also arbitrary formations in the future, we have to d |
|
|
|
If a child is on the outside path the Algorithm creates the following points:
|
|
|
|
|
|
|
|
|
|
|
|
| Name | Details |
|
|
|
|
| Parameter| Details |
|
|
|
|
|------|---------|
|
|
|
|
| SpeedUpPoint | On the outside path the child needs to walk a greater distance than the parent, therefore we introduce a point at which the child starts to walk faster than the parent. The walking speed is raised accordingly, so that the child arrives at *FirstPointOfNextPath* at the same time the parent arrives at the Waypoint. This value is however bound to only be a certain amount higher than the parents walking speed to prevent big jumps in speed. |
|
|
|
|
| LastPointOfCurrentPath| Last point in the current walking direction |
|
| ... | ... | |
| ... | ... | |