Multiple attacks

Hamesh

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.
 
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.
 
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?
 
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).
 
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?
 
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.
 
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.
 
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.
 
Ok sure I will have a look into how to create new custom tasks. Are there any tutorials/documentation on this at all?
 
I have been looking into this more and wanted to ask about the following approach.

Let's assume the player will have a script with many booleans (10-20) which will keep track of what the player is doing eg. crouching, blocking, atacking etc. I am wondering how efficient it would be to essentially create one sequence task per boolean and start each with a boolean comparison. These would then get stepped through one by one until the boolean set to true is found, and then that sequence would continue with activating the attack in the sequence. So in essence the AI would be "choosing" an attack based on what the player was currently doing.

What I am concerned about though is the performance of running through all these sequences all the time to determine what the AI needs to do. Of course it would only go as far as the boolean that is set to true but still. Especially considering that this will only be the combat part of the tree, and there will be locomotion and other parts in this as well.

Would I for example keep the combat as a separate tree and the locomotion as the default and switch between? Or would it not be a performance issue worth worrying about?
 
10-20 booleans isn't that bad - I've seen trees with hundreds upon hundreds of nodes. I would get the tree working and then profile it to check the performance.
 
Top