Search Unity

Behavior Designer - Behavior Trees for Everyone

Discussion in 'Assets and Asset Store' started by opsive, Feb 10, 2014.

  1. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    So I love the asset for the most part but the main thing I always find myself fighting against are the trigger branches. Typically I just want to use these to set a bool of some sort, and need it executing parallel to the main logic. I usually have a selector with a few sequence children that repeat, and I was wondering what would be the best way to run the trigger entering logic in parallel to this?

    I've included a picture that shows what I'm trying to do. I essentially just want any trigger handling to be kept separate from the main AI logic, and to simply utilize the states set by the triggers within the main logic portion of the BT

    BTSetup.PNG
     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Glad you are enjoying the asset. For support requests can you please post on the opsive forums? This allows me to track each request better :)
     
  3. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    opsive likes this.
  4. KutlayMD

    KutlayMD

    Joined:
    Jul 2, 2017
    Posts:
    5
    Hi opsive

    I have two playable character for playing at the same time so while player is playing first character,enemies should seek him(attack him) but if the player plays with the second character,enemies should seek second character. how can i do this?or Can i get bool variable from a script that attached to an object on scene?
     
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hello,

    For support please post on the opsive forums so I can track each request better :)
     
  6. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi opsive after I install behavior designer I get these errors. Type or namespace error vector2Int, 3Int could not be found
     
  7. ohbado

    ohbado

    Joined:
    Aug 13, 2014
    Posts:
    37
    Hello.
    I have imported Behavior Designer 1.61 into Unity 2018.2.20.
    However, when importing to Unity 2018.2.20, Behavior Designer Editor will not work.
    This issue can also be confirmed in a newly created project.
    Do you have a good idea?
     
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    If you can post on the opsive forum for support that would be great so I can track it better. When you post if you can also post the steps to reproduce from a from a fresh project that would be great. Also make sure you've removed Behavior Designer from the Asset Store download location before updating to ensure the Asset Store updates to the correct Unity version of Behavior Designer.
     
    Last edited: Jan 28, 2019
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hello - can you post on the opsive forum with the steps to reproduce and the error that you are receiving? I am not able to reproduce the error. Also make sure you've removed Behavior Designer from the Asset Store download location before updating to ensure the Asset Store updates to the correct Unity version of Behavior Designer.
     
    Last edited: Jan 28, 2019
  10. mammothrider

    mammothrider

    Joined:
    Sep 21, 2017
    Posts:
    5
    Hi opsive,
    I'm currently working on an old project, using BD 1.5.2 on Unity 5.6.4, and I want to upgrade it to newest BD version and Unity 2018.

    When I try to upgrade it from 1.5.2 to 1.5.7, I found that all disabled tasks in the internal trees are enabled. Is it some kind of bugs, or I have to delete all disable tasks?

    Due to I do not personally owned BD asset (my company purchase it), I can't registry on your forum. Sorry for that.

    Update:
    Manage to update to version 1.5.5, everything is good. But still can't update to 1.5.7 from 1.5.5. The disabled task will become enabled.
     
    Last edited: Jan 30, 2019
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hello,

    Behavior Designer is in the Editor Extensions category so it is one license per seat. If you can get your company to purchase an individual license for you then you'll be able to register for the forum :)

    Also, 1.5.7 was released before Unity 2018 so it wasn't built to work with that version of Unity - the most recent version is 1.6.1 which supports Unity 2017.1 - Unity 2018.3.

    Justin
     
  12. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    I am a beginner in unity and can barely code. Anyway I managed to get my game environment (a 2D sidescrolling shooter) working, including a endless scrolling routine.
    What I am missing is a proper enemy behavior.

    In my humble opinion the best 2D enemy behaviour in an action shooter ever created is from the williams defender arcade machine.

    My question is..
    Can I use behaviour designer to implement this?

    Basically there are 6 different behaviours in the williams defender arcade game:

    1. Bomber..does flying only and leaves some bombs on their way
    2. Lander ..Is the most interesting behaviour..appears out of thin air and does flying mostly near the ground and shoots at the player (not precise).. BUT suddenly captures a human in a random moment and tears it to the sky ..in that phase the player can shoot the lander and rescue the human in the air ..but when the lander with the captured human reaches the sky it becomes a mutant.
    3. mutant ..is the most aggressive enemy.. it flies directly to the player (in a little zig zag to avoid the player fire) and tries to collide with the player, also it shoots at the player at the same time
    4. Pod ..does nothing but when hit it releases 4 to 5 swarmers
    5. Swarmer.. is part of a enemy group (the swarmers) which all only can go together in one direction, they can change direction but only when they long passed the player
    6. Baiter ..this guy is very nasty because it appears out of thin air when you are not fast enough in clearing up the level. It is not part of the level..it is only there to terrorize you.. it is faster than you, you can not escape.. you have to shoot it, it goes in a zig zag with impulse like direction changes ..and there is no limit in the amount of them appearing.

    Not to forget that the enemies can calculate your position when you are moving and are firing in front of you to hit you (this alone is fantastic)

    All this has be be lightning fast.. It has to run on a mobile phone with max android kit kat on it.

    I post a youtube video to illustrate this special behaviour.


    Thanks!

     
  13. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for taking a look at Behavior Designer @captnhanky!

    From a pure flow perspective Behavior Designer can accomplish what you are going for, but it will likely take some new tasks in order to implement. If you have Playmaker or Bolt you can use that integration to create the actual logic, while Behavior Desginer determines when to play that logic. One of the reviews for Behavior Designer had a great analogy:

     
  14. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Ok I understand.. thank you for clarifying!

    My biggest concern is to not being able to achieve proper speed and fluidity in the game with all these tools attached to it.
     
    Last edited: Feb 3, 2019
  15. tonOnWu

    tonOnWu

    Joined:
    Jun 23, 2017
    Posts:
    83
    Hi guys. Unity gave me a voucher to purchase your asset. As you may know, when you get a voucher you don't receive an Invoice Number. The problem is that I need to download the integration content -from your website- and I need the Invoice Number (that I don't have). I spoke to Unity representatives, and they suggest me to talk with you. I appreciate your help. I love the package, but there are many examples that I wish to check on detail.
     
  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    In the past when this has come up Unity support has been able to help by getting the invoice number. Were you talking to support@unity3d.com? That is the email address that seems to work for getting invoices.
     
  17. TRuoss

    TRuoss

    Joined:
    Dec 5, 2012
    Posts:
    85
    Hi, I created two SharedVariables and added them in the Editor Window under Variables. Now I want to delete one, but after a sec or two, it is listed again. Even if I change the name or change the type. It resets after a sec to the default value.

    Do I have to kill my tree and make a new one, is it stuck?

    Edit:
    Found the issue. I was in View Mode because I changed it into a prefab.
     
    Last edited: Feb 6, 2019
  18. tonOnWu

    tonOnWu

    Joined:
    Jun 23, 2017
    Posts:
    83
    Yes. I already talked to them. The problem is that they don't emit an invoice number when they gave an asset with a voucher (as a gift for the annual subscription to Unity). That's why they send me to talk to you.
     
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I talked to my web developer to see if we could handle this case better and I think that you should be able to download the integrations now. If it doesn't work please send me a PM with your order number.
     
  20. bitwise2342

    bitwise2342

    Joined:
    Nov 22, 2014
    Posts:
    2
    Hi,

    I'm really interested in Behavior Designer and its extensions, but I have a doubt on whether it can help in my project.

    Could the movement pack could handle a NPC airplane's movement so it does not crash with obstacles?

    Could the formation and tactical packs apply to a group of NPC airplanes moving in the air?

    Thank you very much in advance.
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for taking a look at Behavior Designer. This relates to 3D pathfinding and you're right in that the current pathfinding implementations that Behavior Designer is integrated with only do 2D pathfinding. I've written about some workarounds on this page.
     
  22. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hi,

    I have a behavior tree that repeats forever, my NPC go from idle -> patrol -> idle -> patrol, now Im wondering what is the best way to "break" that cycle when you get a quest from the NPC and go to another branch that makes the NPC follow the player or reach a specific destination (only during the quest) ?
     
  23. jontaguse

    jontaguse

    Joined:
    Nov 28, 2014
    Posts:
    3
    Hey, i'm having issues when building for Mobile, the behaviors don't seem to work at all but they work fine on PC.
    is there something obvious i'm missing that need to be changed for mobile?
     
  24. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    For support can you please post on https://www.opsive.com/forum? This will allow me to track the requests better.
     
  25. jontaguse

    jontaguse

    Joined:
    Nov 28, 2014
    Posts:
    3
    Will do, Thanks!
     
  26. westryder907

    westryder907

    Joined:
    Dec 28, 2016
    Posts:
    61
    Please help!

    I've purchased TPC,UCC(TPC) and plan on purchasing UCC-FPC here soon along with my latest purchase Behavior Designer.

    I've used other AI assets before and even made a rudimentary AI script to make my own AI zombies but I'd like to use Behavior Designer to do this now.

    I'm having the hardest time getting my zombie to wander, if they see the enemy pursue, if they're far away to pursue(walk) and if close pursue(run) towards the target(player).

    This asset seems very complicated to me and I can't wrap my head around all the different conditionals etc...

    I've gone through the tutorials and read documentation but it just feels like this assets overly complicates something it should make easier?

    I just want dumb zombies! lol

    Can we get some enemy NPC behavior tutorials that focus on these kinds of things?
     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for your purchase - zombie AI should be no problem :) For support can you please post on the opsive forums at https://opsive.com/forum? This allows me to track each request better and also it has a more focused search. If you can include a screenshot of what your tree looks like right now that would also be helpful.
     
  28. vampir26

    vampir26

    Joined:
    Mar 29, 2010
    Posts:
    108
    I downloaded the A* pathfinding project integration pack from your site (https://opsive.com/integrations/?pid=1092), but I can't import it, because unity says "pack is already imported". I get the same message, if I try it to import in a completely blank project. How can I fix it?

    Thank you :)
     
  29. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Are you using Firefox? If so try using a different browser and it should work. For further support if you can post on the forums at https://opsive.com/forum that would be great.
     
  30. vampir26

    vampir26

    Joined:
    Mar 29, 2010
    Posts:
    108
    Yes, you are right. I will try it. Thank you.
     
  31. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I am prepping the next Behavior Designer release and this version should reduce the amount of time it takes within the deserialization process. I'm looking for some people to test it to ensure everything still works - if you want to try it out early please send me a PM with your Behavior Designer invoice number and what version of Unity you are using. Thank you!
     
  32. VagabondOfHell

    VagabondOfHell

    Joined:
    Sep 17, 2013
    Posts:
    15
    Hi Justin

    I am looking to use Has Received Event for when the NPC hears a sound from my sound manager. Unfortunately I can't seem to get the Has Received Event to return true.

    I've structured a sample like so:

    upload_2019-3-12_21-0-12.png

    And added some debug statements inside the Has Received Event. The Registered is called, but RECEIVED is never called.

    upload_2019-3-12_21-1-47.png

    Registering to the event in another script works fine however. I get the received message and the desired vector

    upload_2019-3-12_21-2-41.png

    Do you have any suggestions for determining why the ReceivedEvent of the Conditional Task isn't working?

    Thanks for your time

    Adam
     
  33. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I responded to your post on the opsive forum :)
     
  34. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    I found a bug in your MovementUtility.WithinSight code that is used by the CanSeeObject task.
    Here is the problem:
    In line 94 in MovementUtility.cs you have the following line:
    var direction = targetObject.transform.TransformPoint(targetOffset) - transform.TransformPoint(positionOffset);
    Then in line 104, you do the following distance check:
    if (direction.magnitude < viewDistance && angle < fieldOfViewAngle * 0.5f)

    The problem with this logic is it does not take into account the size of the targetObject because targetObject.transform is always going to be in the center of the targetObject. So your viewDistance has to be greater than the distance between the center of the targetObject to the center of the behavior character. Instead of using the center of the targetObject, it should be using the renderer edge(renderer bounds). In other words, as soon as the renderer bounds of the targetObject falls within viewDistance of the Behavior character, the targetObject should be withing sight. If my targetObject is unusually large, it's transform center may be a long ways away from it's collider/renderer edge so my behavior character will never "see" the targetObject because the viewDistance is not large enough to get all the way to the center of the targetObject.

    It's easy to test, just create a sphere object and scale it to 6. Then set that sphere as the Target Object in your CanSeeObject task. Now set the View Distance to 2 and move your character towards the sphere. Your character will never see the sphere even though the sphere is within the View Distance. But if you increase the view distance so it extends to the center of the sphere, then your character will finally see it.

    Thanks
    Allan
     
    Weblox likes this.
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    That's an interesting use case - it's more of a collider check rather than a strict distance check. I will look at adding it as an option to a future Movement Pack version but I'll want to keep the default as a distance check since that'll be a quicker computation. There's also no easy way to get the distance away from a mesh collider without doing a decent amount of calculations.
     
  36. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    Hi,

    I've read the documentation on Dynamic Variables, but can't yet figure out how to use them properly.

    Clicking the small white circle in the Inspector of a shared variable in a custom Action task, selecting "Dynamic", and then and entering a name was fine. However, I can't set the value of this variable from anywhere I've tried, e.g. inside OnAwake() of this custom task where the shared variable gets declared. Consequently, I can't test/learn the usage of the set variable in a sibling task by using the same dynamic variable name.

    I'd really appreciate if you could point me to any existing examples, or give me some step-by-step instructions on creating a behavior tree and relative code to test the usage of dynamic variables.

    Thank you.
     
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    For support can you post on the forum at https://opsive.com/forum? This allows me to track each request better and also has a search to make it easier to find previously asked questions.

    Thank you!
     
  38. pako

    pako

    Joined:
    Nov 21, 2012
    Posts:
    111
    OK, done! In the new post I made some modifications after I corrected some mistakes, and also added some screenshots.
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
  40. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    214
    still no news when i can update all my opsive assets and be able to use the deathmatch ai kit?
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Deathmatch will hopefully be making a return within the next few months.
     
    Weblox and blacksun666 like this.
  42. joaobsneto

    joaobsneto

    Joined:
    Dec 10, 2009
    Posts:
    152
    I getting this error with Unity 2018.3.9f1 when I open the Variables tab:

    ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
    System.Reflection.Assembly.GetTypes () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
    BehaviorDesigner.Editor.VariableInspector.FindAllSharedVariableTypes (System.Boolean removeShared) (at <0f49ef0acdbd44f8a5303100d11f8912>:0)

    Then that interface does not draw and I receive a lot of Editor GUI errors.

    I didn't had that problem before, but I believe it has to do with my SharedVariable implementations that are in Assembly that I created. Has anyone had this problem?

    Thanks!
     
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    For support if you can post on the opsive forums that would be great. This allows me to track each request better and makes it easier to search :)
     
    joaobsneto likes this.
  44. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    opsive,

    Is there any way to have headers in the Behavior Tree inspector for our custom tasks. (ie. [Header("Climbing System")]

    It sure would help organize things.
    Annotation 2019-04-05 104411.jpg Annotation 2019-04-05 104411.jpg
     
  45. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hello,

    For support can you please use the forum at https://opsive.com/forum? This will allow me to track each request better.

    Thanks,
    Justin
     
  46. loliconest

    loliconest

    Joined:
    Sep 21, 2015
    Posts:
    31
    Hello,

    I've never used Global Variable before. I try to make a Global Variable that stores the player's transform, and let enemy unit read that Global Variable for their Movement Behaviors.

    However after I created a Global Variable, I don't see the "Globals" from the dropdown menu like the one showed in the official tutorial (https://opsive.com/support/documentation/behavior-designer/variables/global-variables/), all I can see is "(None)" and "(Dynamic)".
     
  47. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Hello,

    For support can you please use the forum at https://opsive.com/forum? This will allow me to track each request better.

    Thanks,
    Justin
     
  48. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Does this not ship with any demo scenes? im trying to integrate with UFPS.. and hopefully using the defunct deathmatch AI.. no idea why thats defunct btw, criminal really
     
  49. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    So yeah, if there is a sample scene that has a proper 3d ai going around using htis, id love to grab it. I dont want to design one as such yet I just want to see it working in my game before I dive into it, but I find no examples anywhere... im using ufps but it doesnt matter really I can do integration myself.
     
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @radiantboy - for support if you can use the opsive forum that would be great as it allows me to track requests better and also improved searching. The Deathmatch AI Kit was deprecated when version 2 of TPC was released because we haven't had a chance to update it yet with the new version - we don't have an ETA but we hope to be able to rerelease the Deathmatch AI Kit this year. All of the samples are on this page.