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. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    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.
  2. metaldc4life

    metaldc4life

    Joined:
    Sep 26, 2014
    Posts:
    179
    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
     
  3. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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
  5. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Malbers wolf would work no?
     
  6. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    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.
  7. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    That’d be great, thanks.
     
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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.
  9. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    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?
     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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);
     
  11. metaldc4life

    metaldc4life

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

    metaldc4life

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

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I just need the portion that handles the collision and sending the damage.
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    @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.
     
  16. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    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.
  17. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    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.
  18. magique

    magique

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

    BHS

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

    huntersteeger

    Joined:
    Dec 27, 2017
    Posts:
    19
    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:

  21. metaldc4life

    metaldc4life

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

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @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.
     
  23. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    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.
     
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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:

    closetgeekshow and huntersteeger like this.
  25. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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.
     
  27. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    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
  28. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    122
    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
     
  29. metaldc4life

    metaldc4life

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

    metaldc4life

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

    Thank You Once Again! =)
     
  31. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    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
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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.
     
  33. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    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
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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.
     
  35. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    122
    Hi,

    Cool, Thanks for the update!

    John
     
    BHS likes this.
  36. zKici

    zKici

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

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    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
  38. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    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...
     
  39. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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
     
  41. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    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
  42. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
  43. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    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
     
  44. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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.
     
  45. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    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.
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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.
     
  47. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    But it continually keeps attacking after it finishes its attack, it makes it look funny like try to reach for something it cannot?

    Is there an option to stop attacking after it realizes the distance from the target is too far?
     
  48. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    It shouldn’t keep attacking after the target has exceeded the AI’s attack distance. It should attempt to get within range of the attack distance and attempt another attack. What is the AI’s Weapon Type?
     
  49. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Weapon type set to melee, and yes it shoulnd't thats why i was confused :p its like reaching for something it'll never get lol
     
  50. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Has anyone got death sounds to work? They are not working here. Have three animals here with death animations and death sounds but they are not playing.