Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Behavior Designer - Tactical Pack

Discussion in 'Assets and Asset Store' started by opsive, May 21, 2015.

Thread Status:
Not open for further replies.
  1. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    Behavior Designer - Tactical Pack
    Available on the Asset Store

    big_tactical.png
    Requires Behavior Designer

    Behavior Designer - Tactical Pack contains 13 different behaviour tree tasks focused on tactical situations using Unity's NavMesh or Apex Path.

    Attacking is unique to each game. The Tactical Pack uses interfaces so you can implement your own attack and damage logic that fits your game. In addition, the Tactical Pack can use Playmaker or the Third Person Controller to handle the attacking and damage.

    Each task is well commented and written in a generic and clean way making it very easy to integrate into your own project. This pack will continue to grow as we hear new task suggestions from the community.

    The following tasks are included:
    • Attack
    • Charge
    • Marching Fire
    • Flank
    • Ambush
    • Shoot and Scoot
    • Leapfrog
    • Surround
    • Defend
    • Hold
    • Retreat
    • Request Reinforcements
    • Reinforcements Response
     
    Last edited: Dec 16, 2019
    John-G and boysenberry like this.
  2. MotuProprio

    MotuProprio

    Joined:
    Sep 24, 2013
    Posts:
    144
    Really interesting!
     
    opsive likes this.
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    I just heard back from the Asset Store but unfortunately they declined this package. Their reasoning was that the package had errors. They didn't send a stack trace with it so I can only guess that the errors were because Behavior Designer wasn't first imported. I sent them a reply asking some follow up questions so hopefully we can get this package released soon!
     
  4. Horrible_Unicorn

    Horrible_Unicorn

    Joined:
    Jan 26, 2015
    Posts:
    2
    Any update on when the Tactical pack will go live?
     
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    I got in contact with Unity support and they gave me the address of the lead Asset Store reviewer but unfortunately I haven't heard back from him. I resubmitted it immediately after it was denied so that means it is probably another week before they review it again (and I hope it gets through this time).

    In the meantime I setup a page where you can purchase it through PayPal. You'll receive a unique download link and this link can be used for all future updates. You can optionally also receive an email whenever the package has been updated.

    Edit: link removed, asset is live
     
    Last edited: Jun 17, 2015
  6. Horrible_Unicorn

    Horrible_Unicorn

    Joined:
    Jan 26, 2015
    Posts:
    2
    Ah awesome. Thanks for the update. :)
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
  8. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Can these agents' behavior easily be adapted to actual mecanim characters that run and shoot weapons/reload etc.?

    And can they also patrol and wander in groups?

    If so, it would essentially give the same sort of behavior as RAIN's Advanced Warfighter AI right? Thank you
     
  9. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    Can this be used for non navmesh AI, for example ships on a large scale ocean.
     
  10. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    If you are using root motion you can sync it with a NavMeshAgent by following this guide. With the initial version the shooting is done with a basic demo script which is derived from the IAttackAgent interface. This means that in order to shoot you'll need to have your current weapon/character component subscribe to that interface.

    One of the more difficult decisions that I had to make with this pack was how much of the attacking to implement. I wanted it to be extremely generic so any type of game which has agents who attack can use it. This is why I settled on using interfaces - the actual tasks don't know how they are attacking, they just know that they need to attack. In the next release I am going to add some more components which subscribe to the IAttackAgent interface so you can use it even if you don't want to do any scripting. This includes adding the ability to attack using another behavior tree or Playmaker FSM.
    Not in this version but it makes sense to add it. I'm not sure if this fits better in the Tactical or Formations Pack but I'll add it to one of them. The only reason that I am saying this is because the Formations Pack is better setup to handle continuous movement, whereas the Tactical Pack is more focused on just getting to the attack point.
    I haven't actually tried the Advanced Warfighter asset but have seen the video and read the description. Based off of that I think that it does, it's just that the Tactical Pack does it in a more generic way.

    Not in the current version but that's a good idea. All of the tasks derive from a single class so it should be pretty easy to switch out - it'll be in the next update along with more attacking implementations :)
     
    Last edited: Jun 18, 2015
    eridani and John-G like this.
  11. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Also, how flexible is flanking? If the target changes position, will the attacking units intelligently re-flank? Thank you
     
  12. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    It has some intelligence to it. There are up to three groups of flank: the center, right, and optionally the left group. The center group moves to the front of the target and waits for the left and right groups to arrive. The left and right groups don't go directly to the attack position. They instead first move to an offset and then to the attack position. This allows the agents to sneak up on the target. If the target changes position the agents will adjust as long as they are not in position. Once they are in position they are waiting for all of the other groups to arrive and then will start to attack. You can also specify a delay so the left and right flank groups will attack shortly after the center group attacks. In the web demo you'll see the center group start to attack about a second before the left and right group and it is because of this offset.
     
  13. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    @John G. -

    I just got done adding a non-pathfinding version of all of the tasks. The steering behavior is done by setting the position of the transform using Vector3.MoveTowards. I could add an option to use a Rigidbody just as easily. I'm not sure when I'll be submitting the next version but if you want this ahead of time I can send it to you.
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    Version 1.1 of the Tactical Pack has been sent to opsive.com purchases and released on the Asset Store. You can see the full release notes here. This release contains a lot of integrations:

    Apex Path
    ApexPath.png

    Playmaker
    Playmaker.png

    Third Person Controller
    ThirdPersonController.png

    And from @John G.'s suggestion, you can now move without any pathfinding at all by using basic steering behaviors.

    SteeringBehavior.png
     
    John-G likes this.
  15. insominx

    insominx

    Joined:
    Jan 23, 2012
    Posts:
    32
    Hi, I have yet to really dig into the details of your package but I've just imported it and tried to to run the scene in Behavior Designer Tactical/Scene/Scene and get the following errors (for every agent):

    Failed to deserialize
    UnityEngine.Debug:Log(Object)
    BehaviorDesigner.Runtime.DeserializeJSON:Load(TaskSerializationData, BehaviorSource)
    BehaviorDesigner.Runtime.BehaviorSource:CheckForSerialization(Boolean, BehaviorSource)
    BehaviorDesigner.Runtime.BehaviorManager:EnableBehavior(Behavior)
    BehaviorDesigner.Runtime.Behavior:EnableBehavior()
    BehaviorDesigner.Runtime.Tactical.<EnableBehavior>c__Iterator0:MoveNext() (at Assets/Behavior Designer Tactical/Scripts/Demo/BehaviorSelection.cs:236)

    The behavior "41747461636b" on GameObject "Agent 1" contains no root task. This behavior will be disabled.
    UnityEngine.Debug:LogError(Object)
    BehaviorDesigner.Runtime.BehaviorManager:EnableBehavior(Behavior)
    BehaviorDesigner.Runtime.Behavior:EnableBehavior()
    BehaviorDesigner.Runtime.Tactical.<EnableBehavior>c__Iterator0:MoveNext() (at Assets/Behavior Designer Tactical/Scripts/Demo/BehaviorSelection.cs:236)

    Using Unity 5 (5.1.2f1) and Windows 10.
     
    Last edited: Aug 3, 2015
  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    Are you updating from a previous version? I just tried it within a fresh 5.1.2 project and all of the tasks worked. This update had a few file changes so if you are updating you can try to delete the original Tactical Pack directory first and then importing again.
     
  17. insominx

    insominx

    Joined:
    Jan 23, 2012
    Posts:
    32
    Not sure how I got into that state but I redownloaded and reimported BD and BD Tactical (in that order) and it is now working as expected. Thank you for the quick reply!
     
    opsive likes this.
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    Version 1.2 of the Tactical Pack has been sent to opsive.com purchases and will be available on the Asset Store soon. You can see the release notes within this thread. The theme of this release was to make it easier to switch between a leader and a follower with the same task. As a result the Follow Orders task has been removed and you'll instead specify the leader within the tactical task.
     
  19. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    Public service announcement to other Tactical pack users... if you simply Update the pack in an existing project you will get errors. Apparently the "SteeringBehavior" files were removed in this update.

    Removing the entire "Behavior Designer Tactical" folder and re-importing it fixes the problem.

    Have a nice day. :D
     
  20. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    Thanks for pointing this out :) You're right - you'll want to completely remove the Tactical Pack folder when updating to ensure there aren't any left over files from the previous version.
     
  21. Sujeto

    Sujeto

    Joined:
    Jun 30, 2015
    Posts:
    11
    Hello! I been learning how to use designer behavior for some time now and I just found a bug or something, when I try to use -Shoot and Scoot- the units go around the player but shot in a diferente direction. I would really appreciate help with this, thanks!



    Btw- i am using playmaker (with the last package available in the website).
     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    Hmm, it looks like the target position is being set incorrectly. Are you able to tell me how to reproduce it from the demo scene within a fresh project?
     
  23. Sujeto

    Sujeto

    Joined:
    Jun 30, 2015
    Posts:
    11
    Hey! thanks for the quick reply! here are my steps:
    -Create new project
    -import playmaker
    -import behavior designer
    -import tactical pack
    -import behavior designer/playmaker integration
    -import tactical pack/playmaker integration
    -open behavior designer tactical example scene
    -bake navmesh
    -agent 1 works, all the others don’t
    Captura de pantalla 2017-05-17 a la(s) 14.16.15.png
    -Change attack to shoot and scoot
    Captura de pantalla 2017-05-17 a la(s) 14.17.54.png
    -press play

    and is the same result as my other project, where did I go wrong? D:
     
  24. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    Thanks for the steps. It looks like I forgot to update the Playmaker sample scene with the previous Tactical Pack changes. I just updated the integration and now you should be able to use it as a base.

    I also had to reduce the Attack Angle on the Attack Bridge component to a smaller value (this will fix the characters shooting in the wrong direction).
     
  25. Sujeto

    Sujeto

    Joined:
    Jun 30, 2015
    Posts:
    11
    Works amazing now! thank you!
     
  26. adilsondias2017

    adilsondias2017

    Joined:
    Apr 22, 2017
    Posts:
    4
    Hi, does your Tatical Pack supports building surrounding? I mean, I want something to use on a sort of MOBA game where the AI will have to attack buildings and of course find a empty spot around the building to able to do so...
     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    It does - the tasks use the IDamageable interface in order to determine how much health the target has left. This allows the attacking objects to be anything that you'd like - whether it is a character or building :)
     
  28. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    359
    Hello.

    Whenever i attempt to use the sorround action i get an error:

    NullReferenceException: Object reference not set to an instance of an object
    BehaviorDesigner.Runtime.Tactical.Tasks.Surround.OnUpdate () (at Assets/Behavior Designer Tactical/Scripts/Tasks/Surround.cs:71)
    BehaviorDesigner.Runtime.BehaviorManager.RunTask (BehaviorDesigner.Runtime.BehaviorTree behaviorTree, Int32 taskIndex, Int32 stackIndex, TaskStatus previousStatus)
    BehaviorDesigner.Runtime.BehaviorManager.Tick (BehaviorDesigner.Runtime.BehaviorTree behaviorTree)
    BehaviorDesigner.Runtime.BehaviorManager.Tick ()
    BehaviorDesigner.Runtime.BehaviorManager.Update ()

    It seems that the variable: tacticalAgent is null however i have no idea why?

    DO i need to add a script to my NPC's in order to make them tactical agents?

    Also do you have any video tutorials on the tactical package in general?
     
  29. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    That is exactly it. This isn't a video but take a look at this:

    http://opsive.com/assets/BehaviorDesigner/Tactical/documentation.php?id=16

    You'll need to add a component which implements the IAttackAgent interface. From the demo scene the Shootable component implements this interface so you can use that as an example.
     
  30. leds87

    leds87

    Joined:
    Jul 16, 2017
    Posts:
    1
    Hi, I am asking about third person controller integration with tactical pack BD. Once I imported the asset it says missing assembly, and I check using BehaviorDesigner.Runtime.Tasks.ThirdPersonController; that's the error. Can you help me? the integration is not working without the bridge I think.
     
  31. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    It looks like you're missing the Behavior Designer / Third Person Controller integration (not the Tactical Pack integration). You can download this on this page (sixth image down).
     
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    The Tactical Pack has been updated with A* Pathfinding Project integration. After you download the update you can then get the integration from this page.

    AStar.png
     
    lawsochi likes this.
  33. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,535
    Do you have an updated link to get this integration please?
     
  34. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,535
    So I went back to very old behaviour designer, almost all issues went away, just one left..

    Assets\Deathmatch AI Kit\Scripts\AI\DeathmatchAgent.cs(12,36): error CS0246: The type or namespace name 'BehaviorTreeAgent' could not be found (are you missing a using directive or an assembly reference?)

    ideas?
     
  35. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    373
    All links in this thread to Documentation are dead... might be worthwhile updating them here.

    Are there any tutorials on running a tree with Tactics / Movement / Formation packs ?
     
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,021
    Thanks for the heads up. I'm thinking that I'll as a mod to close this thread and instead use the main Behavior Designer thread for all add-ons.

    I don't have any tutorials which cover all three add-ons into one, but I have made a note for it. If you're having any problems combining all three feel free to make a post on the opsive forum.
     
Thread Status:
Not open for further replies.