Search Unity

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

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

  1. DespairBear

    DespairBear

    Joined:
    Nov 1, 2013
    Posts:
    214
    Hey loving the asset so far. So I'm adding emote animations, and it says there's no cap, but after I add 3 the + symbol disappears, preventing me from adding more. Is there a reason for this?

    Also I saw in one update you put a minimum wander distance, I'm not seeing a setting for this anywhere. Where is this located? Couldn't find it in the documentation
     
    Last edited: Sep 18, 2019
  2. UDN_68a3a08d-b184-416c-8d9f-f1f5b1bedf54

    UDN_68a3a08d-b184-416c-8d9f-f1f5b1bedf54

    Joined:
    Jul 29, 2018
    Posts:
    4
    Hi there, Best AI ever a lot of versatility with amazing behaviors. I'm facing an issue with sounds, i'v setup events in walk animation and also assigned sound in FootstepSound tab, still i cannot hear any footsteps and same issue with attack sounds. However, Die sound is working perfectly. What could be the case.
    Sometimes footstep sound plays once or twice while attacking but that's it. Maybe something with distance. Btw i follwed the footstep sounds tutorial you provided.
     
  3. attaway

    attaway

    Joined:
    Nov 12, 2014
    Posts:
    34
    I'm interested in this as well. Taking advantage of Emerald AI's complete system while using Behavior Designer for more specific behaviors seems perfect. I'll try it out at some point and let you know if there's any bugs.
     
    SickaGamer likes this.
  4. attaway

    attaway

    Joined:
    Nov 12, 2014
    Posts:
    34
    Has anyone had a chance to use Final IK & Puppet Master with Emerald AI instead of the default ragdoll setup? I haven't had a chance to try it out myself yet, but I plan to soon.
     
    Deckard_89 likes this.
  5. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    736
    I am hoping he adds something like this to 2.4. I want complex boss fights which do include complex attacks and movement patterns and targeting logic.
     
    metaldc4life likes this.
  6. metaldc4life

    metaldc4life

    Joined:
    Sep 26, 2014
    Posts:
    59
    Hi!
    I need help on my game to add the ufps bow and arrow asset with emerald AI
    It's driving me crazy lol
    Can anyone help?
    Here is the link for the bow asset:
    I have it to where it can shoot but not give damage to the NPC....
    All I want it to do is have the arrow shot from the bow to damage the npc…
    https://assetstore.unity.com/packages/3d/bow-for-ufps-82035
     
  7. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    Hey, great to hear you’re enjoying Emerald AI.

    The no cap limit was from a previous version of Emerald AI when it used an Override Controller. The Override Controller caused cut animations so it had to be removed, but I will be adding more animations to all states soon.

    The minimum wander distance is located under the Temperament tab.
     
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    Hey there. Thanks :) Have you tried increasing the volume of the footsteps? This is located above where you put the footstep sounds. By default, they’re set to be pretty quite. You also need events for the run animation as well as the turning movement animations (walk left, walk, right, run left, and run right).

    As for attack sounds, these also need an Animation Event. This allows the sound to perfectly match the frame you want it to play. A tutorial for this can be found here: https://docs.google.com/document/d/...2njM7Jx9pYlqgbtM8/edit#heading=h.gavxpr3vf5ty
     
    Last edited: Sep 18, 2019
  9. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    265
    Malbers wolf would work no?
     
  10. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    265
    Going back in the forums, herds and packs have been coming in for a very long time (like since 2015ish?)BHS. Lol. Just sassing ya . Love the asset.
     
    metaldc4life likes this.
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    That’d be great, thanks.
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    I had a customer get Puppet Master integrated so I know it’s possible, but I haven’t had the chance to test it out myself. I own it so I’ll try to put a guide together sometime soon.

    As for using Final IK with Emerald AI, there’s a tutorial here:
     
    attaway, Deckard_89 and metaldc4life like this.
  13. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    265
    I was gonna test this in a couple hours, but how optimized is emerald ai? Has anyone ever pushed to see how many AI can run at once?
     
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    I don't own this asset so I can't do an integration for it, but you just need to call the same function as you did with the UFPS weapon. You would just need to use the target hit with the arrow instead:
    Code (CSharp):
    1. YourHitTarget.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>();
    2.                 EmeraldComponent.Damage((int)ArrowDamageAmount, EmeraldAI.EmeraldAISystem.TargetType.Player, YourHitTarget.transform, 400);
     
  15. metaldc4life

    metaldc4life

    Joined:
    Sep 26, 2014
    Posts:
    59
    Where exactly would I place that code snippet though??
    Thanks For The Help I Need Too!
     
  16. metaldc4life

    metaldc4life

    Joined:
    Sep 26, 2014
    Posts:
    59
    I would be glad to send it to you though.. (the asset I am using.)
     
  17. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    I can't say for sure as I can't see the code. Find the portion of code that causes damage with the arrow system and add the snippet above, using the proper variable names.


    I can't accept a paid asset, but I can try to reach out to the developer to see if I can get a copy to help you out.
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    I just need the portion that handles the collision and sending the damage.
     
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    @metaldc4life It looks like that script is for damaging the UFPS player. There's no references to the object hit which means there's no way to apply damage to Emerald AI agents.
     
  20. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    265
    Hahaha, Emerald is pretty optimized. Was able to run 400 AI. Pretty easy. With my own AI system i can only run about 150. So then i flicked on GPU instancer with crowd animations. Baked the emerald ai. And ran 600 fully functioning AI. Using gpu instancer crowd system, mecanim control. ( literly just flip 1 switch for set up). And ran 600 AI in a dense forest with dense grass. 100 fps. lol
     
    attaway likes this.
  21. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    265
    BHS, you should intergrate with gpu instancer crowd system. To run the full crowd system, i bet you could run thousands of AI at once lol
     
    attaway likes this.
  22. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,575
    You realize you're posting source code to someone's asset publicly?
     
    Last edited: Sep 18, 2019
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    I was hoping that wasn't the actual source code, but I guess it is. @metaldc4life Please remove the code you posted.
     
  24. huntersteeger

    huntersteeger

    Joined:
    Dec 27, 2017
    Posts:
    13
    I'm using the Unistorm AI Schedule you posted and having some problems. My AI is moving to the destination but does not play his set animation for the time. I looked in the animation controller and the idle anim index is on 1 and is not being updated for each destination, also the Idle active bool isn't activating( I don't know if that is used in this situation but I assumed it was) I'm using 2.3 now so I don't know if anything has changed that has made the schedule script break. Some help would be awesome!
     

    Attached Files:

  25. metaldc4life

    metaldc4life

    Joined:
    Sep 26, 2014
    Posts:
    59
    I'm just trying to get help !
    By the way.. I removed it....
     
  26. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,575
    @BHS I started debugging the issue with my deer not aligning to the terrain and I found the problem. It was completely skipping the alignment because the Physics.Raycast was failing. When I looked at the code, I saw that you were using localPosition instead of position in your raycast. This was the cause of the failure. Once I changed to position, the alignment proceeded and worked correctly. So now I'm wondering how this is working for anybody.
     
  27. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    384
    Just grabbed the update and started building my first zombie AI with the new system. I like to start clean with such a major update. I'm using the free zombie (PxlTiger) from the Asset Store.

    Is anyone having any challenges with LOD? I use Simple_LOD to combine meshes and to create consistent LOD groups. After running through Simple_LOD and applying EAI to the character, it only seems to animate LOD_0. As soon as the LOD switches to any of the lower LODs, the character appears to lay on its back -=OR=- just stop animating altogether. Zoom the editor in, or get close in game window, and it changes to LOD_0 and starts working as expected.

    I will try it with a different model this weekend.
    Mark

    EDIT: Tried with no LOD, works a charm.
     
  28. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    There was a bug with the idle animation index that I corrected through the UniStorm AI Schedule script, but version 2.3 fixed this issue so the correction is no longer needed.

    Attached are the updated versions for you, and anyone else, who might need them.
     

    Attached Files:

    huntersteeger likes this.
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    I emailed the developer for the Bow for UFPS asset. If he can respond and get me a copy of the asset, I'll create a tutorial for you.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    Oops, good catch. I never noticed any issues with the 30+ models I tested so that's probably why it went unnoticed. I'll have a fix for it with the next minor update.
     
  31. DespairBear

    DespairBear

    Joined:
    Nov 1, 2013
    Posts:
    214
    WanderMinimum..PNG

    I'm not seeing the wander minimum. I see radius, but nothing about a minimum distance from the agent. Maybe it's something obvious I'm not seeing...

    Also just curious, what's the best way to go about updating the code so that NPE's don't get thrown after adding states to an AI's animator? I'm using this for town villagers who have things like "sitting", "eating", etc
     
    Last edited: Sep 19, 2019
  32. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    114
    Hello,

    I’m trying to follow the directions on integrating Ootii Motion Controller, but I believe the guide is not current with Emerald AI 2.3. I'm unable to locate “Emerald_AI” in step 7. I have many Emerald_AI scripts listed, and I am unsure which one to edit.

    Thanks,
    John
     
  33. metaldc4life

    metaldc4life

    Joined:
    Sep 26, 2014
    Posts:
    59
    Oh Thank You So Very Much! =D
     
  34. metaldc4life

    metaldc4life

    Joined:
    Sep 26, 2014
    Posts:
    59
    Please keep me posted on it too!! @BHS

    Thank You Once Again! =)
     
  35. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    404
    Hi, my projectiles are all flying to short. They are never reaching the player in a long distance. Where can i change this? Thank you.
    Edit: nvm. Got it working.
     
    Last edited: Sep 20, 2019
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    My apologies for the confusion. The minimum amount is hard coded, but I can certainly make it adjustable.

    Adding states is not currently possible because the Animator Generator looks through each state and applies the animations from the AI’s animation lists. I can look into altering this to ignore states that have been manually added.

    Idle animations can be used for things like eating and sitting. See the AI Schedule script for an example. It allows you to specify the index of the idle animation you want to play at the given location.

    I plan on adding a list of schedule states soon that will allow users to have actual schedule animations with transitions in and out.
     
  37. DespairBear

    DespairBear

    Joined:
    Nov 1, 2013
    Posts:
    214
    Awesome, thanks for the help! Where is the AI Scheduler script? Not seeing it either

    I'm getting an issue when I use the API to change the WanderType to Destination and set the destination, where the DestinationReached event will fire long before the AI reaches the destination. I added a check to the Unity NavMeshAgent in my code to ensure the path isn't still pending to prevent this, which seems to have solved it. Is there somewhere I should be setting the destination? As in should it be part of a coroutine somewhere? Is there anything I should be aware of as for setting order or tweaks I should make to the AI code to prevent this?

    I'm also not seeing the "Destination Animation" that's mentioned on page 2 of the general documentation
     
    Last edited: Sep 20, 2019
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    Hey John,

    The Ootii integration tutorial needs to be updated with the namespace changes so the instance of Emerald_AI need to be EmeraldAI.EmeraldAISystem . I’ll try to have it updated by tomorrow.
     
  39. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    114
    Hi,

    Cool, Thanks for the update!

    John
     
    BHS likes this.
  40. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    218
    Definitely make the wander and any useful variable min/max adjustable... Thank you
     
  41. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    218
    Can you please organized your asset, so that ALL of the demo/example files are inside a demo/example folder, that way we don't have to pluck out what we dont need to import...

    Few questions:

    1. This used to work, whats the proper way now?

    Emerald_AI EmeraldAIReference;
    EmeraldAIReference = GetComponent<Emerald_AI>();
    EmeraldAIReference.ResetAI();

    2. Likewise

    Emerald_AI emerald;
    emerald.DamageEvent.AddListener(Attacking1); // no longer exist
    emerald.DeathEvent.AddListener(OMGWeDiedHere); // no longer exist
    emerald.Damage(2, Emerald_AI.TargetType.Player);

    If you can help out convert the old to new scripts :) much appreciated

    Thank you
     
    Last edited: Sep 19, 2019
  42. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    265
    Ya, player damaging AI broke for me... (using playmaker). Before i could get componet and send damage, now it wants 4 things, and no way to do that with play maker. I can fake it by using the emerald weapon script and making the calculated hit public, then toggling that on and off, but thats not ideal...
     
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    Alright, I'll add this with the next minor update.

    I can move the demo and example files are in the demo folder. :)

    Emerald AI changed the script name from Emerald_AI to EmeraldAISystem and added namespaces. It also moved all API to the EmeraldAIEventsManager script.

    To call the Emerald AI script, you would use:
    Code (CSharp):
    1. EmeraldAI.EmeraldAISystem EmeraldAIReference = GetComponent<EmeraldAI.EmeraldAISystem>();
    To call the EmeraldAIEventsManager script, you would use:
    Code (CSharp):
    1. EmeraldAI.EmeraldAISystem EmeraldAIEventsManagerReference = GetComponent<EmeraldAI.EmeraldAIEventsManager>();
    2. EmeraldAIEventsManagerReference.ResetAI();
    Lastly:
    Code (CSharp):
    1. EmeraldAI.EmeraldAISystem EmeraldAIReference = GetComponent<EmeraldAI.EmeraldAISystem>();
    2. EmeraldAIReference.DamageEvent.AddListener(Attacking1);
    3. EmeraldAIReference.DeathEvent.AddListener(OMGWeDiedHere);
    4. EmeraldAIReference.Damage(2, EmeraldAI.EmeraldAISystem.TargetType.Player);
    For a list of all of Emerald AI's API, see the doc here: https://docs.google.com/document/d/1ns8m7Ol_gaKeYJ3YbaRjDy09xG98UoIXKCaWLGJeg74/edit
     
  44. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    Please see my post here for a guide on how to access the Damage function with PlayMaker: https://forum.unity.com/threads/rel...ality-ai-solution.336521/page-69#post-4703873
     
  45. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    218
    Thank you for the previous response,

    1. Can we chose how many attack/dead etc animations we have rather than a maximum of 3?

    2.As requested before, Chase distance, can we please have an option after X amount of distance from its patrol, or waypoint, station or a "point" from to stop chasing?

    3. What about the characters I have with the animations separately, that do not have the option for Events? Is there a way to convert them or what do we do in that scenario? (Some are non humanoid)

    4. Some more options on the wondering, like reach a point min/max delay then continue, etc?

    5. When the player goes to a spot where the navmesh does not rich, the AI NPC just stands at the end where it can reach at distance over 4+ and keeps attacking the air, the attack distance is 2.1, at that point it should give up since it can't reach, and why is it attacking for no reason?
     
    Last edited: Sep 20, 2019
  46. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    265
  47. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    265
    it threw a bunch of errors about ambigious random between system random and unity random, I ran through the script and changed all the Randoms to Unityengine.random and everything is working fine atm, and damaging the AI
     
  48. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    1. For now, there's a maximum of 3. I plan on expanding this to 6 soon.

    2. This is already a feature. Set your Distance Type to Starting Position (Located under the Detection Settings). This will have the AI stop chasing its target once the Max Chase Distance is met from its starting position/wandering position.

    3. You should be able to use the Animation Events like in the tutorial video, but for some reason if your animations don't support this, you can use this method instead: https://docs.unity3d.com/540/Documentation/Manual/animeditor-AnimationEvents.html

    4. This is also already a feature. You can control how long an AI waits at their waypoint by adjusting the minimum and maximum Wait Time Seconds (Located under the AI's Settings>Movement Settings).

    5. I wasn't aware of this. I'll look into it and correct things if needed.
     
  49. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    218
    Gotcha sorry about those misses.

    Thank you for the clarification,

    #5 seems to continue attacking sometimes when the NPC is attacking, I run for a bit then stop prior to finishing its attack, then it continues to attack even though I am not within the attack distance?

    Attack Distance is set to 2, too close to 1.5
    Run attack is set to 2.1 and im assuming its using the too close from Attack distance above as I cannot see another one for it.
     
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,955
    If you’re near an AI and it triggers an attack, but you leave the attack radius, and the AI continues its attack, is by design. It allows users to dodge attacks. No damage should be applied if you are not within the AI’s attack distance. There’s even a distance check to prevent damage from being sent to the target if they are too far away.