Multiple attacks

Hamesh

New member
I am trying to learn more about behavior designer and how I could potentially use it. I have watched the UCC integration video and noticed that the behaviour tree appears to have a single attack behavior which is using the equipped weapon. How would I go about expanding this to use multiple weapons, each under different circumstances eg. player is less than 1m away use knife, player is between 1-5m away use pistol, player is more than 5m away use rifle etc?

Also for melee weapons that may have multiple attack animations (eg. short range knife stab, long range knife slash etc) how are you able to call one animation instead of the other for a single weapon, again based on specific circumstances?

Thank you.
 

Justin

Administrator
Staff member
I am trying to learn more about behavior designer and how I could potentially use it. I have watched the UCC integration video and noticed that the behaviour tree appears to have a single attack behavior which is using the equipped weapon. How would I go about expanding this to use multiple weapons, each under different circumstances eg. player is less than 1m away use knife, player is between 1-5m away use pistol, player is more than 5m away use rifle etc?
The included integration tree only has a single enemy/weapon but the Deathmatch AI Kit had a wide variety. While the asset is currently deprecated the docs that described the tree are still live at:


Also for melee weapons that may have multiple attack animations (eg. short range knife stab, long range knife slash etc) how are you able to call one animation instead of the other for a single weapon, again based on specific circumstances?
Yes, with the Start Stop Use task you could call a different use ability which calls a different attack.
 

Hamesh

New member
Ok sure. I have had a look at the attack part of the behavior tree and it looks like the determine weapon weapon part is what decides the appropriate weapon. Just curious exactly how the conditions of this determining is set?
 

Justin

Administrator
Staff member
It has been awhile since I looked at that task but from what I remember it was a combination of the distance, a curve based on some factors, and whether or not a weapon was considered special (such as a rocket launcher).
 

Hamesh

New member
Ah ok I just wanted to see how configurable it was, for example able to check if the player is crouching or behind cover. Are any of the tasks from Deathmatch AI not in the currently available Behavior Designer?
 

Justin

Administrator
Staff member
It did have a cover check, but not one for if crouching.

Are any of the tasks from Deathmatch AI not in the currently available Behavior Designer?
Yes, there were a decent amount of tasks specific to the Deathmatch AI Kit. These tasks don't work with the current version of UCC but hopefully sometime we'll be able to rerelease it.
 

Hamesh

New member
Sorry I have another question about this. Is there a way for the AI to choose one of several attacks based on a probabilty eg. if player is crouching, Attack 1 is 50% likely, Attack 2 30% likely and Attack 3 20% likely? So the AI would choose at random between the 3 attacks but some are more likely than others.
 

Justin

Administrator
Staff member
Yes, for that case I would probably create a new task that chooses the target based on a probability from a list of possible targets.
 

Hamesh

New member
Ok sure I will have a look into how to create new custom tasks. Are there any tutorials/documentation on this at all?
 
Top