Formations Pack - How to add/remove agents

kingboo

New member
Hello,

I have watched the tutorial series on BD, but there isn't one covering the Formations pack, which is where I would like to start learning from. Any guidance on the below to get me started would be much appreciated.

I have units in a scene that I can add/remove from a list when I click on them and I can send them orders to move using A*. When I have multiple units in my list, I would like them to move using a BD formation.

How can I add/remove units to this formation on them being added to my list? How should I set my target destination? And how would you recommend I set this up in my scene (e.g. have one singular behaviour tree or one on each unit?)

Any advice is appreciated.
 
I recommend taking a look at the demo scene for an example. The agents are added to/remove from the formation when the task starts. The leader can be set dynamically using the SharedVariable system. Each agent will need their own behavior tree.

If you are just getting started with behavior trees I do recommend taking a look at the "Behavior Tree Basics" videos as that provides a good overview of how behavior trees work.
 
I've watched the first 10 youtube tutorials on BD, they are really well explained. However, I'm still unsure how a new agent is added to the formation/leaves the formation.

Do I just enable/disable the formation decision tree on the agent? Does the formation always 'exist' I'm just adding agents/a leader to it? And how would I approach having 2 of the same type of formations with different agents?

In the demo scene, I see how they decision trees are set up, but still unsure how to add new agents/remove them.

Many Thanks
 
I've watched the first 10 youtube tutorials on BD, they are really well explained. However, I'm still unsure how a new agent is added to the formation/leaves the formation.

Do I just enable/disable the formation decision tree on the agent? Does the formation always 'exist' I'm just adding agents/a leader to it? And how would I approach having 2 of the same type of formations with different agents?

In the demo scene, I see how they decision trees are set up, but still unsure how to add new agents/remove them.

Many Tha
I recommend taking a look at the demo scene for an example. The agents are added to/remove from the formation when the task starts. The leader can be set dynamically using the SharedVariable system. Each agent will need their own behavior tree.

If you are just getting started with behavior trees I do recommend taking a look at the "Behavior Tree Basics" videos as that provides a good overview of how behavior trees work.
I've had a think and I understand better... Could I have a bool that is set to 'true' when the unit is selected, then this would run my chosen 'formation' task. Would I have the decision tree constantly evaluating the bool or is there a way to 'trigger' the event?
 
The formations will only run when the task is active. The agents included in the formation will be based on what task is running. If you have a formations task running then the leader must be specified if it is an agent which follows another agent. In the demo scene Agent 1 is the leader and it tells the other agents where to move.

Hopefully that clears things up!
 
Thanks, that did help and I've been able to set up a formation to move now. However, the 'leader' only initiates movement when I have their behaviour tree window open. The followers will fall into position straight away.. I'll have a look again tomorrow but if you know the immediate answer let me know ? thanks
 
Thanks, that did help and I've been able to set up a formation to move now. However, the 'leader' only initiates movement when I have their behaviour tree window open. The followers will fall into position straight away.. I'll have a look again tomorrow but if you know the immediate answer let me know ? thanks
Nvm, adding a repeating onto the leader behaviour made him move. Not sure why it didn't work before, as I had the 'Restart when completed option ticked'.
 
Top