| ... | ... | @@ -12,10 +12,12 @@ In the details panel of the parent VH select the *VHMovement* component. Under t |
|
|
|
| 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 be part of the formation, 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.
|
|
|
|
For every VH that should be part of the formation, provide an entry in the *Child VH* Map of the parent. As key 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 children (all VHs specified in the *Child VH* Map) when the game starts.
|
|
|
|
|
|
|
|
An example implementation can be found on the *GroupMovementTest* Map.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
| ... | ... | @@ -29,7 +31,7 @@ For abreast formations and also arbitrary formations in the future, we have to d |
|
|
|
|
|
|
|
**1. Outside Path**
|
|
|
|
|
|
|
|
If a child is on the outside path the Algorithm creates the following points:
|
|
|
|
If a child is on the outside path the algorithm creates the following points, that the child will traverse in the following order for every Waypoint:
|
|
|
|
|
|
|
|
|
|
|
|
| Parameter| Details |
|
| ... | ... | @@ -46,12 +48,12 @@ On the inside path the Algorithm just creates the *LastPointOfCurrentPath* and a |
|
|
|

|
|
|
|
|
|
|
|
**Big angles**
|
|
|
|
TODO If the angle from the last Waypoint towards the next Waypoint is very large (close to 180 degree).
|
|
|
|
If the angle from the last Waypoint towards the next Waypoint is very large (close to 180 degree), the children will change sides. So instead of walking around the waypoint to stay on the e.g. left side of the parent (in walking direction), the child will just turn around and be then on the right side of the parent (in walking direction).
|
|
|
|
|
|
|
|
TODO The Movement of childs is always triggered by the parent. In combination with the speed adjustments of the child VHs, it is guaranteed that the formation is always maintained.
|
|
|
|
In general the movement of children is always triggered by the parent. In combination with walking speed adjustment, it is guaranteed that the formation is always maintained. It can for example happen, that a child on the outside path cannot reach the last point on its current walking path, which would be *FistPointOfNextPath*, due to movement speed restrictions (speed is restricted because it would look bad if the child suddenly starts running while the parent walks normally). Therefore, the parent would trigger walking to the next Waypoint upon arriving at the current. The child would then abort the current path and would start to walk to its corresponding points for the next Waypoint.
|
|
|
|
|
|
|
|
#### InLine
|
|
|
|
TODO This formation is handled in a very simple way so far. The only additional points that are calculated for the child are around the first Waypoint. Then every child will walk towards the next Waypoint. Therefore, the formation is only formed once around the first Waypoint. Distances between child VHs will not be strictly maintained.
|
|
|
|
This formation is handled in a very simple way so far. The only additional points that are calculated for the child are around the first Waypoint. Then every child will walk towards the next Waypoint. Therefore, the formation is only formed once around the first Waypoint. Distances between children and parent will not be maintained strictly.
|
|
|
|
|
|
|
|
## Future implementations
|
|
|
|
|
| ... | ... | @@ -61,7 +63,7 @@ Expand the *Child VH* Map to allow 2 float parameters. The offset in x- and y-di |
|
|
|
|
|
|
|
**2. Automatically spawn child VHs**
|
|
|
|
|
|
|
|
If no VH is specified as key in the *Child VH* Map automatically spawn one at the specified offset.
|
|
|
|
If no VH actor is specified as key in the *Child VH* Map, automatically spawn one at the specified offset.
|
|
|
|
|
|
|
|
##
|
|
|
|
An example implementation can be found on the *GroupMovementTest* Map.
|
| ... | ... | |
| ... | ... | |