Search Unity

[RELEASED] Emerald AI 3.2 (New Sound Detection) - The Ultimate Universal AAA Quality AI Solution

Discussion in 'Assets and Asset Store' started by BHS, Jun 26, 2015.

  1. verteom

    verteom

    Joined:
    Oct 26, 2018
    Posts:
    48
    Is LifeLink Stop function is more than like stop everything except recevie damage or trigger some animation?It will be so cool~
     
  2. verteom

    verteom

    Joined:
    Oct 26, 2018
    Posts:
    48
    Like hit animations, is will over than six in the future? :)
     
  3. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    It stops the AI in such a way so that LifeLink can be in control. However, if the AI takes damage then it stops doing LifeLink things and lets EmeraldAI control it to do battle. Then it resumes LifeLink tasks afterwards.

    You can see this in action in the following demo video:
     
    julianr, BHS, verteom and 2 others like this.
  4. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I have added sounds to the Attack Sounds section but when the AI is attacking the sounds do not play. Is there any reasons for this?
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    You need a PlayAttackSound animation event on all your attack animations in order to hear the sound.
     
    gearedgeek likes this.
  6. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Gotcha, I added the death sounds and they worked without the event. I didn't realize that it needed the event to play the attack sounds. Thank you for that helpful info. ;)
     
  7. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Very Cool :D
     
  8. verteom

    verteom

    Joined:
    Oct 26, 2018
    Posts:
    48
    cool~ I want it to combine with love & hate, it will let npc more like human than before
     
    HeadClot88 and magique like this.
  9. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I plan on bringing this back after the next update which will be version 2.6.
     
    indie_dev85 and SickaGames1 like this.
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Have you tried using the Debug Tools (https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Enabling-an-AI's-Debug-Tools) and enabling raycats to see where the AI's raycast is hitting your player? This is only visible within the Editor tab. Does your player's collider change size?
     
  11. SIV

    SIV

    Joined:
    May 7, 2014
    Posts:
    219
    Hello,

    Did you added Astar A* pathfinding or still not yet ?, we have terrains that load at runtime (200 tiles) and we are using Astar for dynamic navmesh.
     
  12. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Hi, BHS,
    There is a critical flaw in Unity's NavMesh system and I have to use Pathfinding Project.
    I suppose it's been request few times and I was wondering if you have plan to support it soon.
    Right now, I'm jugi going to make a quick patch but I would like an official version..
    I would appreciate if you do.
    Thanks.
     
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    What is the critical flaw that you are referring to?
     
  14. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    upload_2020-5-2_11-6-23.png
    Hi, here is the setup.

    A middle object, the orange color is a tall ledge and normal NavMesh generator will not generate a path, thus I excluded it from the path generation and there is a hidden NaveMesh underneath it so that NavMeshAgent can move through it. The expected behavior is that the agent will stay on top of the ledge while it's moving through the ledge, but the NavMeshAgent will always put the agent directly on top of the NavMesh, therefore it will go through the ledge object (it ignores the collision between the agent and ledge object).

    Pathfinder Project, however, it will put the agent on top of the ledge while going through(it respects the collision between the agent and the ledge object)
     

    Attached Files:

  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    That's not a flaw. It's doing exactly what you told it to. You need to understand navmeshes better and set yours up so that the ledge is also navigable and that an agent can go from the lower mesh to the higher one. That is all possible, but you need to set it up correctly with off mesh links and jump and drop heights.
     
  16. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    I know it's possible to jump up the ledge using the mesh link but it involves too much manual work.
    Another flaw is that when NavMeshAgent cannot find path, it just sits whereas Pathfindng Project is trying to move toward to the target as far as it can.

    Anyway, having the Pathfinding Project integrated would be a good thing. It's much easier to work with it.
     
  17. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Well, you said it was a critical flaw. Not wanting to do the manual work to get it working is a different thing.
     
  18. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Didn't say it was a bug. Forcing navagent to have a direct contract to navmesh is a critical flaw to me. The mesh link is not even part of the standard navmesh component and it's an overkill and a kludge for what I need to do.

    Using Pathfinding Project, you don't need a special setup, you just need to add some animation when moving up/down the ledge. It works beautifuly in my setup.
     
  19. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Yeah, I'm all for better solutions. But EmeraldAI only uses NavMesh so far so not really much you can do.
     
  20. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @BHS I hope you are well. Where is the documentation regarding EmeraldAIObjectPool.cs?
    It was my understanding that EmeraldAI supported object pooling for spawning. How do I use this script?

    Thanks.
    Mark
     
  21. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    In my opinion, NavMesh should be optional. AI needs to move toward the target without NavMesh. Currently, AI is useless if it can't find the path. For instance, when a player jumps up a ledge or whereever there is no NavMesh and the AI will just sit and idle instead of moving toward the players. This is one of the other reasons I needed Pathfinding Project.

    Yeah, it took me an hour to integrate Pathfinding Project and it works. What you need to do is to abstract the interface. I'm sure you can figure it out without taking too much of your time, unless of course if it's on your todo list. ^^
     
  22. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    will this asset work with final ik quadground fitter?
     
  23. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I've used EmeraldAI with FinalIK grounder and it works great.

    [EDIT]
    here is a video example of it.

     
    BHS and Deckard_89 like this.
  24. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    @magique Me too, final ik grounded working just fine for me. @BHS has a script to disable final ik as a death event too.
     
  25. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Yeah, you definitely have to disable on death. I have a disable behaviors on death feature in LifeLink that I am using.
     
  26. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Getting an issue with an AI Generic Rig walking animation - it keeps resetting after the animation is complete. As in, he will complete the walking animation, then teleport back to where he was at the start of the walk animation to start it again - the animation is set to loop, and Root Motion is being used.

    Edit: I also can't get emotes to play on this guy.
     
    Last edited: May 6, 2020
  27. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Okay, I fixed the walking issue - it was related to specifying the root node on the character import, this is always a nightmare for me in Unity haha.

    Anyway, I still can't get Emotes to play on this character. I am trying to call the play emote event through the event manager, which works on my other characters, but not this guy for some reason.
     
  28. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I'm planning on delving into Emerald more next week. Is there an AI heal another AI option? I could only see EventsManager.InstantlyRefillAIHeath(); - looking to seek out nearest AI to damaged AI, then walk up to that AI and heal it.
     
  29. verteom

    verteom

    Joined:
    Oct 26, 2018
    Posts:
    48
    HI~ magique~ Has a tutorial video about how to combine A* Pathfinding Project and root motion ? I watched the tutorial about Final Ik , it works very well for me.
     
  30. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Are you asking if I have such a tutorial? I do not. I never used A* pathfinding before.
     
  31. verteom

    verteom

    Joined:
    Oct 26, 2018
    Posts:
    48
    Thanks reply.~Alright~~ I will try it by myself~
     
  32. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Hi, is there a roadmap for EmeraldAI? I'll appreciate if you can share it if you have. It will help with planning. Thanks.
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    No, A* pathfinding support hasn't been added yet.
     
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I'm not sure if it will help, but Unity does have a runtime navmesh extension that may help: https://learn.unity.com/tutorial/5c515372edbc2a002069505f#5c7f8528edbc2a002053b491
     
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Emotes only work when an AI is not in combat. How are you trying to trigger an emote? Are you using this API? https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Emerald-AI-API#animation-api
     
    Deckard_89 likes this.
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Not currently, but I do have plans to be able to have AI heal nearby Friendly AI. This will be done through additional options within an Ability's settings.
     
    julianr likes this.
  38. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
  39. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    65
    Hi

    Regarding waypoints, could you add a feature to the AI that it would collect waypoint objects marked by layers and tags? I'm using Dungen to generate dungeons and Dungen uses room based approach to generate. I can place waypoints into the room prefabs but I'd need AI to collect them.
     
  40. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    That would be a good feature addition. Thanks.
     
  41. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    my ai companions will follow me into the water but wont follow me out that just stay in the same spot swimming any ideas what could be causing this?
     
  42. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    Hello,

    I have a few questions that I haven't been able to figure out. How do you disable the Emerald AI collider on death so that the player can pass through it? Also i've been trying to set up a kill zone for ai but I can never get it working. Is there a way to damage ai that collide with a trigger?
     
  43. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    You can add a function to use on the Death Event, something like this...
    change LAYER_NUMBER to a new layer that doesn't interact with the Player Layer

    Code (CSharp):
    1.  
    2. public void Awake()
    3.     {EmeraldAI.DeathEvent.AddListener(DeadEvent);}
    Code (CSharp):
    1.  
    2. public void DeadEvent()
    3.     {EmeraldAI.AICollider.gameObject.layer = LAYER_NUMBER;}
    or disable the Collider
    Code (CSharp):
    1.  
    2. public void DeadEvent()
    3.     {EmeraldAI.AICollider.enabled = false;}
     
    Bioman75 likes this.
  44. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    Thank you for the information would you also know how to send damage to an ai when it touches a collider?
     
    llJIMBOBll likes this.
  45. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Try This :)
    Code (CSharp):
    1. public int Damage = 5;
    2.     public float DelayNextDamage = 2.5f;
    3.     protected float LastDelay;
    4.  
    5.  
    6.     protected void Start()
    7.     {
    8.         //Cache Delay Time
    9.         LastDelay = DelayNextDamage;
    10.     }
    11.  
    12.     protected void OnTriggerStay(Collider col)
    13.     {
    14.         //Don't Damage if Ai is Dead!
    15.         if (col.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>().IsDead)
    16.             return;
    17.  
    18.         //Delay Next Damage
    19.         if (col.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>())
    20.         {
    21.             LastDelay -= Time.deltaTime;
    22.             if (LastDelay <= 0f)
    23.             {
    24.                 col.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>().Damage(Damage);
    25.                 LastDelay = DelayNextDamage;
    26.             }
    27.         }
    28.     }
     
    Bioman75 likes this.
  46. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    Thank you yet again for your help :)
     
    llJIMBOBll likes this.
  47. WickedRabbitGames

    WickedRabbitGames

    Joined:
    Oct 11, 2015
    Posts:
    79
    Just getting started with Emerald. I'm following the tutorial and I'm stuck trying to figure out where to find the AI Faction Relations screen. I've set up the various factions I want, but the only thing I see under Detection & Tags/Tag & Faction Options/AI Faction Relations is a button to Open Faction Manager. Below that I see a header that says:

    AI Faction Relations
    List is Empty

    I don't see any options to add to the list. What am I missing?
     
  48. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    anyway to allow ai companions to wander around instead of staying next to the player?
     
  49. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    It is a little tricky at first, but you were in the right place.
    Look under
    Detection & Tags
    Tag & Faction Option
    Faction Options
    scroll down to bottom under Player Relations and you will see
    AI Faction Relations
    click on '+' sign and it will pop up with the drop down menus.

    A piece of cake ;)
    Good luck!
     
  50. WickedRabbitGames

    WickedRabbitGames

    Joined:
    Oct 11, 2015
    Posts:
    79

    So here's the screen that I see. As you'll note, the AI Faction Relations shows no + to add to the list. In fact, this entire page seems to run off the right side of the screen, whether maximized or minimized. Other pages show the same thing, but some pages, for example the Items tab under AI Settings does show a + where you can add to the Item Object list.

    I wonder if this log note when I reopened my project today may be related. It reads:
    Code (csharp):
    1. The editor layout could not be fully loaded, this can happen when the layout contains EditorWindows not available in this project UnityEditor.WindowLayout:LoadDefaultWindowPreferences()
    This apparently has been observed by others for several years. It is currently listed in the Unity Issue tracker for 2020 versions of Unity. [https://issuetracker.unity3d.com/is...d-message-is-shown-when-the-project-is-opened]

    FWIW, I'm using 2019.3.7f1. I have reset my layout using Window/Layouts/Revert Factory Settings, but that didn't fix the problem. I've tried some other suggestions discovered via the Google, but no luck there either. Fortunately, I've got time and plenty of other work to do on my project.

    EDIT: Update, I found it. But I had to squeeze the Inspector window to it's minimum size and the + showed up. If I widen the Inspector window the + falls out of the right side of the screen and disappears again. The same behavior can be see in the AI Settings/Combat/Damage Settings page.
     

    Attached Files:

    Last edited: May 17, 2020