Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Emerald AI 2.4.1 - The Ultimate Universal AAA Quality AI Solution

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

  1. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    LifeLink has a Stop and Resume function as well. ;)
     
    verteom likes this.
  2. verteom

    verteom

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

    verteom

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

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    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.
  5. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    188
    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?
     
  6. magique

    magique

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

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    188
    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. ;)
     
  8. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Very Cool :D
     
  9. verteom

    verteom

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

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,295
    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?
     
  12. SIV

    SIV

    Joined:
    May 7, 2014
    Posts:
    194
    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.
     
  13. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    691
    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.
     
  14. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    What is the critical flaw that you are referring to?
     
  15. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    691
    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:

  16. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    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.
     
  17. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    691
    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.
     
  18. magique

    magique

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

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    691
    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.
     
  20. magique

    magique

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

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    430
    @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
     
  22. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    691
    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. ^^
     
  23. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    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.
  25. Deckard_89

    Deckard_89

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

    magique

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

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    284
    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
  28. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    284
    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.
     
  29. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,152
    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.
     
  30. verteom

    verteom

    Joined:
    Oct 26, 2018
    Posts:
    46
    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.
     
  31. magique

    magique

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

    verteom

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

    chrisk

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

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,295
    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
     
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,295
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,295
    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.
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,295
    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.
  39. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    284
  40. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    19
    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.
     
  41. julianr

    julianr

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

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    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?
     
  43. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    37
    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?
     
  44. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    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.
  45. Bioman75

    Bioman75

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

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    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.
  47. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    37
    Thank you yet again for your help :)
     
    llJIMBOBll likes this.
  48. CodexofRome

    CodexofRome

    Joined:
    Oct 11, 2015
    Posts:
    42
    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?
     
  49. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    514
    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!
     
unityunity