Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[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. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I don't have an ETA for 2.3 yet.
     
  2. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    This is most likely an API update with that version of Unity. I will look into this and when I find a solution, I will let you know how to resolve it.
     
    ThePaceMaker and Aphelion78 like this.
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Emerald AI doesn't modify the AI's layer or tag and I have never seen this issue. The only thing it does modify is the Ragdoll's tags after the AI dies. What version of Unity and Emerald AI are you using?
     
  4. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    There isn't a separate sound list for run attack sounds, but you could use a custom Animation event to do so for each run attack animation you have. You could also use the PlayRandomSoundEffect function to play a random sound from the AI's Interact Sounds list. When I get the chance, I can add additional functions to choose the index of the sound to allow users to choose which sound is played for each attack animation.
     
    SickaGames1 likes this.
  5. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Using Unity 2019.1.0f2 and the latest Emerald 2.2x. But i think it was in Unity 2018x too.
    Why i am the only one who has always such crazy things in Unity :)
     
  6. ThePaceMaker

    ThePaceMaker

    Joined:
    Dec 18, 2016
    Posts:
    7

    Thanks bud, much appreciated
     
    SickaGames1 likes this.
  7. Aphelion78

    Aphelion78

    Joined:
    May 8, 2015
    Posts:
    8
    Hello folks!
    I'm trying to get Emerald AI and Invector TPC to work together. I've followed the integration tutorials but I can't seem to get the AI to interact with my character. Is there another tutorial someplace that goes into a bit more depth on how to properly set up the player and AI? I'm really running out of ideas. Thanks for reading!
     
  8. ThePaceMaker

    ThePaceMaker

    Joined:
    Dec 18, 2016
    Posts:
    7
    Once ive got the fix needed id be happy to help you out. Ive had success on other versions of unity just struggling with 2018. 2 key things to check is the tags and layers, emeralds setup pretty much does the rest for you
     
  9. kylewetton

    kylewetton

    Joined:
    Sep 6, 2018
    Posts:
    26
    Hey guys, my first post here. I've been having a lot of success with EAI so far, there is one thing I'm battling to get my head around however. My world scale is quite accurate with humans being approximately 1.7m tall.

    Any way, I'm battling with the settings Stopping Distance, Attack Distance and Too Close Distance

    What I'd ideally like, is for enemies to stop at approx 3 units from their target (player), and move in to attack, and then back off. If you imagine Assassins Creed enemies circling a player, all taking a turn (for the most part) to move 2 units in, attack and then back off into their circle, this is what I'm trying to achieve.

    Any ideas on how to achieve that behaviour from my enemy AI would be greatly appreciated.

    If stopping distance is any higher than attack distance, enemies attack in mid air and don't land damage to my player.

    Here's a video of what I've got so far, really early days yet.

    Thanks

     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I haven't found anything yet, but I will keep trying to see if I can recreate it. Are you using Emerald AI with any other asset that modify the layers and tags such as a complete project asset?
     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    There really isn't too much that needs to be done other than ensuring the tags and layers are setup correctly and that you've made the necessary code changes. Also, ensure that AI Attacks Player set to Always. This setting is located under the Tag Options and controls whether or not an AI will attack a player on sight.
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there,

    I have scaled AI with many different scales and never encountered any issue related to distance detection. I did notice that your animations don't seem to be properly utilizing Root Motion. This is why your AI snap back after using their attack animation.This may be throwing off the distance detection. Also, make sure that your AI's damage Animation Events are timed correctly.

    There currently isn't direct way to have the AI attack and then move back. What you can do is have the too close distance trigger after your AI attacks which will cause them to backup after they attack.
     
  13. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Only Emerald AI and RFPS in the Urban Underground Pack from the assetstore. Some spider and zombie models too.
     
  14. Aphelion78

    Aphelion78

    Joined:
    May 8, 2015
    Posts:
    8
    Well... I remade the scene and paid closer attention to the tags in the demo.. I *think* I know what I did different. Not 100% sure. The AI certainly sees my player now but no damage is being done. I added the animation events as instructed but the player still lives! We can't have that! Is there a script I should attach to the player?
     
  15. Room101_Studios

    Room101_Studios

    Joined:
    Apr 4, 2018
    Posts:
    5
    Any chance for uRPG or uMMORPG integration? This looks like wonderful kit. Reminds me of the old NPC Activities from Neverwinter Nights.
     
  16. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    How can we enable attached objects through animation events? I'm using the
    GameObject.SetActive function, but I'm not sure how to reference the actual game object. Does it have to be a prefab or can it just be a scene object?
     
  17. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Strange, there should be no reason for tags or layers resetting. Try setting the Ragdoll Tag to Flesh to see if this fixes your tag resetting problem.
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Try positioning your SendEmeraldDamge Animation Events to the center of your AI's attack animation. If it works after doing this, it's a bug with Unity's animation blending/transitions, which can be fixed by decreasing the transition time to 0.1. If this doesn't work, try enabling all the Debug Log Mode options, located under Docs at the bottom, to see the exact target that's being detected as well as what object may be obstructing the AI's sight.
     
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Yes, I have plans to integrate more assets such as uRPG and uMMORPG. These will be done through tutorial videos like I have done with the other integrations. I will be able to do this when I have finished the UniStorm 4.0 and Emerald 2.2.2 updates.
     
    Weblox likes this.
  20. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    What specifically are you trying to enable? There's a system dedicated to enabling and disabling objects that are present on the AI (not through prefabs). This is done by attaching the object to the AI's Items list, located under AI's Settings>Items. When you've done this, create a unique numerical id and use the Animation Event EnableWeapon passing the item's id as the Animation Event parameter (in the example below it's 10). If you want to disable a weapon, you can do so doing the same thing, but using DisableWeapon.

    EnableWeaponEvent.png
     
    Deckard_89 likes this.
  21. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    There is no ragdoll tag, only an ignore ragdoll tag ?
     
  22. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    @BHS Got it, thanks.
     
  23. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    anyone able to get sound going on this yet? Been baffling me for weeks. I have the animation events etc, but the sounds simply dont work. Weird thing is if Im miles away I can hear them sometimes, its like the sound is being played in the distance, rather than from the enemy.
     
  24. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    133
    Hi, BHS.

    I tried the script which you suggested and succeeded to change the tag.
    But the follower AI(companion) doesn't change its behavior.

    follow.jpg

    Do I need to edit something more script?

    Code (CSharp):
    1.  
    2.             if (isFollow)
    3.             {
    4.                 gameObject.GetComponent<EmeraldAI.EmeraldAISystem>().FollowTag = "Untagged";
    5.             }
    6.             else
    7.             {
    8.                 gameObject.GetComponent<EmeraldAI.EmeraldAISystem>().FollowTag = "Player";
    9.             }
    10.             isFollow = !(isFollow);
    11.  
     
  25. edub101

    edub101

    Joined:
    Jul 16, 2015
    Posts:
    43
    I'm thinking of purchasing Emerald AI. I see that the system can handle melee and ranged damage-type attacks, but what about other things, like a friendly NPC casting a healing spell on an injured ally? Or an AI selecting from different attack options based on an enemy's weakness (e.g. a wizard casts a fireball at an ice-golem, instead of attacking with his ice staff)? Or perhaps an AI selecting an enemy based on priority (e.g. A character might prioritize ranged attackers over melee, elves over humans, or the player over a player's companion)? In other works, can Emerald AI handle skills/spells/actions in addition to melee or ranged attacks?
     
  26. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    I am trying to test a scenario in which the Emerald AI is killed when the player enters a trigger. In the trigger I am calling the KillAI event. The AI successfully plays it's die animation, however when the animation is complete it reverts back to a T-pose. Is there something else I should do?
     
  27. jokers44life

    jokers44life

    Joined:
    Apr 13, 2018
    Posts:
    7
    Is it possible to have a AI that gathers? and did we get a good UCC integration yet?
     
  28. Troast

    Troast

    Joined:
    Mar 5, 2017
    Posts:
    11
    Hi, I fixed a bug in 2.2.1 where enemy attack sounds didn't come out. Need to place in AttackState() function of EmeraldAIBehaviors.cs.

    Code (CSharp):
    1. GetComponent<EmeraldAIEventsManager>().PlayAttackSound();
     
    radiantboy likes this.
  29. jaytwist28

    jaytwist28

    Joined:
    Jul 18, 2017
    Posts:
    50
    Hey, does 2.2 work with game kit controller? I know it was integrated in 2.0 but since things have changed a lot I was wondering if it was something that could still be easily done.
     
  30. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @BHS ,

    What next for Emerald AI?
     
  31. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Great man, can you tell me the exact line to add it to?
     
    combatsheep likes this.
  32. ZGoodwin

    ZGoodwin

    Joined:
    Jul 14, 2017
    Posts:
    31
    Apologizes for asking about the upcoming cover system when it may already be answered. Any news on it?
     
  33. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    Any new on integrating Malbers dragons
     
  34. MWray

    MWray

    Joined:
    Sep 27, 2018
    Posts:
    2
    I'm new to this forum, so please forgive me if I'm doing this wrong. I want to see if I can get some help figuring out why my animals no longer dynamicaly wander. I say no longer, because I had them wandering fine with Unity version 2018.2.17 and Emerald AI version 2.0, but now I've upgraded to Unity 2018.3.11 and Emerald AI 2.2 and none of the animals will dynamicaly wander. I have verified they are on the navmesh, so I don't believe that is the problem. Any suggestions for things to look at or try will be appreciated. I can send screen shots or setup details if necessary. Thanks.
     
  35. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Code (CSharp):
    1. using UnityEngine;
    2. using EmeraldAI;
    3.  
    4.  
    5. public class Jims_AIAttackSound : MonoBehaviour
    6. {
    7.     public EmeraldAIEventsManager emeraldAIEventsManager;
    8.     public EmeraldAISystem emeraldAISystem;
    9.  
    10.    
    11.     void Start()
    12.     {
    13.         emeraldAIEventsManager = GetComponent<EmeraldAIEventsManager>();
    14.         emeraldAISystem = GetComponent<EmeraldAISystem>();
    15.         if(emeraldAIEventsManager == null)
    16.         return;
    17.          if(emeraldAISystem == null)
    18.         return;
    19.  
    20.         emeraldAISystem.OnAttackEvent.AddListener(PlayAttackSound);
    21.     }
    22.  
    23.     void PlayAttackSound()
    24.     {
    25.         if(emeraldAIEventsManager == null)
    26.         return;
    27.         emeraldAIEventsManager.PlayAttackSound();
    28.     }
    29. }
     
  36. kylewetton

    kylewetton

    Joined:
    Sep 6, 2018
    Posts:
    26
    Hey guys,

    I'd like some help debugging an issue I'm having with Emeralds animations and Root Motion.

    I've got my animations and AI character set up, if I use a clean animation controller with her walk animation, she walks correctly. The animation preview shows her walking correctly via root motion too. She walks perfectly using root motion without Emerald involved.

    When I use the animation via Emerald AI however,

    • With Auto Enable Animate Physics enabled, she walks very, very slowly, with her feet skating. If I increase animation speed, she walks the same speed, but the animation speed is increased (has no affect on her actual in-world movement speed).
    • With Auto Enable Animate Physics disabled she simply walks on the spot.
    I have Movement Type set to Root Motion.

    What do you suggest I check to make this work? My rig is directly from Mixamo (FBX for Unity), and so is the animation. Again though I've already checked that it isn't an issue by using a clean animator controller and can see the character with her current settings moving correctly in the animation I give her.



     
  37. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    The T-posing happens after the "Seconds to Disable" has expired. Also, if I choose Ragdoll on Death, it just T-poses then starts sinking into the ground o_O
     
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    The Ragdoll Tag is located under AI's Settings>Combat>Combat actions at the very bottom. It is only available when Death Type is set to Ragdoll, which I'm assuming you are using ragdolls, correct?
     
    Duffer123 likes this.
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Have you adjusted the AudioSource settings at all? By default, they are set to a value that allows you to hear sounds from about 50 units away. Try adjusting these to see if you can get them working. Also, how did you setup your AI? An AI is supposed to have 3 AudioSources. 2 of them are applied on start and use the settings from the first one.
     
  40. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    @BHS Turns out it is Final IK that is causing the weird T-Posing thing. It's important though, even if it's just grounder for foot placement. Is there some integration instruction I have missed to allow Final IK on Emerald characters, and if not do you plan to include it at some point?
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You may need to clear the AI's target too as it still most likely has a reference to it. When you want to clear the target, use YourEmeraldAIComponent.CurrentFollowTarget = null; this should allow the AI to go back to its default state.
     
    combatsheep likes this.
  42. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Interesting, I haven't had any issues with Final IK. Here's a video tutorial on how to get it working:
     
    Deckard_89 likes this.
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    These features are not currently possible, however, with the 2.3 update, I will be redoing the way attacks are handled. This will make all attacks into abilities using scriptable objects that users can customize, which includes the ability to heal. I haven't thought about weaknesses, but I can certainly look into it while developing the abilities system.
     
  44. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    Almost done with your Unistorm and 2.2.2? Really looking forward to 2.3!
     
  45. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    Ah, that's it I think. All working now, thanks a lot.
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Not currently, but I can look into this feature for a future update. Not yet with UCC, I never received a response from the developer. I don't have a copy of UCC so there's no way I can make a tutorial for it until I do.
     
  47. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there,

    Attacks sounds aren't meant to be handled through code. They are intended to be done through a PlayAttackSound Animation Event. This is to allow the attack sound to be timed correctly for each of the AI's animation.
     
  48. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I will look into this feature while working on the 2.3 update. :)
     
  49. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Malbers dragons could work with Emerald AI now, but Emerald AI agents can't use height based flying. The flying asset I've mentioned would and supports obstacle avoidance while flying.

    Yes, I plan on submitting UniStorm 4.0 today. Then Emerald AI 2.2.2 within the next couple of days.
     
    SickaGames1 likes this.
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Strange, I have noticed that with the animations I use, having Animate Physics enabled makes the foot placement much more accurate. I was also using Mixamo's animations and models. Have you scaled your model at all?