Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[50% OFF] 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,758
    Unity 2021 (as required by the Asset Store's new guidelines)
     
    Last edited: Nov 29, 2023
  2. FatsAndRoses

    FatsAndRoses

    Joined:
    Dec 24, 2022
    Posts:
    21
    Hi, I'm having one issues with EmeraldAI and root motion: the character slides when it walks around
    I tested the same character without Emerald and it works fine. It seems that the nav agent still moves the character, because the turn animation starts with a brief period of idle, and at that point the character starts spinning.

    Am I missing any settings/tweaks?
     

    Attached Files:

    Last edited: Nov 24, 2023
  3. timerace

    timerace

    Joined:
    Feb 27, 2019
    Posts:
    27
    @BHS I think you should rename it to emerald 2024 now, 2023 will create a year behind impression on new customers, I have both versions and I know it will going to be great. Just a small suggestion.
     
    julianr and iChuy like this.
  4. FatsAndRoses

    FatsAndRoses

    Joined:
    Dec 24, 2022
    Posts:
    21
    @BHS I have a few questions:
    1. when my AI detects an enemy and the enemy hides behind a wall, for example, the AI seems t never de-agro and follows the player even if it's not visible. Is there any settings for this? For example make the AI go to the last known point where the player was seen and de-agro after a few seconds?
    2. Is there a way for me to create a new state? For example: I want to create a new "alert" state when the AI "sees" a light like a flashlight, so it sets off to investigate
    3. I'd like my AI to perform actions like opening doors while patrolling. Is this possible?
    Thanks in advance
     
    Last edited: Nov 25, 2023
    iChuy likes this.
  5. DrInternet

    DrInternet

    Joined:
    Apr 6, 2014
    Posts:
    106
    Is this a hard requirement? I'm stuck with 2019.4 and I cannot upgrade to 2020. Is there a chance it will work on 2019.4 with some minor changes or do you use some 2020 exclusive features and there is no way it will work without major rewriting?
     
    Last edited: Nov 26, 2023
  6. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,690
    Sup guys! Got a problem and question. Im using 2021 LTS, Invector Controller, EAI 3.0, and Dialogue System For Unity, no other systems. I have hundreds of models but out of the 30 planned i can only use like 8-10, because any model set up with EAI acts like theres no collider and you can walk through the AI/model.

    Ive tried every solution/workaround possible (including custom scripts to re-enable colliders, etc.), im begining to think its a compat issue with EAI and 2021 (or just 2021's fault). Theres no way it should happen with over 30+ models. Ive been using EAI exclusively since it came out and know it more than well.

    Ive never seen this happen with EAI, any model setup in EAI functions fine, but you can just walk right through the AI like theres no collision at all. Even thought it was the Invector controller, nope cause with some models everything is fine. Now i made the exact setup in 2019 and didnt have 1 problem. Any ideas, workarounds, or info is greatly appreciated...

    Video example of prob:

     
    Last edited: Nov 27, 2023
  7. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,690
    First time i only hear crickets..., lol. I love, support, and promote EAI. For me, until its updated for 2021 (which the upcoming update adds support for 2020.3) i have no choice but to use a different AI solution for now. But as soon as its updated/works with 2021, im switching back to EAI.

    EAI is the best AI system available, and i understand BHS dealing with compatibility with so many versions of Unity, is the biggest PITA, lol. Rock on, ill be back...
     
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    Hey there, can you please post a video of the issue? Are you using stationary turn animations? Using moving turn animations can cause issues like this.
     
  9. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    I had the same thought and I am already doing this. Thanks for the suggestion.
     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    1. There’s an included script called AdvancedLineOfSight included with Emerald AI 3.0 that allows an AI to give up after a target has been obstructed for a set amount of seconds. Just add this script to your AI. The new version of Emerald AI has this functionality built-in.
    2. The Sound Detector component has similar functionality through the Attract Modifier script, but this works with noises. You could modify this to work for additional functionality, which would then trigger customizable actions through Reaction Objects. With the new version, I plan having customizable non-combat actions, but this will come after the initial release.
    3. This will be possible with the non-combat actions I mentioned above, but for now, you could write a simple script with a trigger collider that pauses an AI’s movement and opens a door when entering the collider area. The AI can then resume movement after a second or so.
     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    I actually was mistaken, the minimum required version is 2021. There isn’t much I can do about this as the Asset Store’s new guidelines require a minimum Unity version 2021 to submit a new asset. This is all likely due to 90% of Unity users using version 2021 or higher.

    As for modifying things to make it compatible with 2019, I’d have to look into that, but don’t have time at the moment.
     
    DrInternet likes this.
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    That’s incorrect :)

    The minimum version is 2020.3, but the Asset Store requires a minimum version of 2021. So the minimum version will actually be 2021.

    With that being said, every higher version (2022, 2023, etc.) is fully supported. When Unity 6 is released, that will also be supported.
     
    Mark_01 likes this.
  13. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    My guess is that you likely have references to the incorrect mesh renderer, which can happen if you copied the Emerald AI component and you have the optimization feature enabled. If you do, try disabling the optimization feature or assigning the correct mesh renderer.

    If this isn’t the case, ensure that the box collider on your AI is the correct size as it’s auto generated from the largest bounds of the skinned mesh renderer found within your AI. It’s possible that bounds found were really small which would make the AI’s box collider small.
     
  14. timerace

    timerace

    Joined:
    Feb 27, 2019
    Posts:
    27
    @BHS how much time will it take to release eai 2024?
     
  15. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,690
    @BHS Big thnx for the suggestions, but neither worked. Dont want to be a PITA, so best thing is to give the best info i can:
    • Using 2021.3.27f1 (LTS), EAI 3.0 (tried both 2.0 and 3.0), Invector Melee controller 2.6.3 (and even tried the shooter version 2.6.3).
    • Example model https://assetstore.unity.com/packages/3d/characters/humanoids/humans/pirate-character-pack-229976 and this is only 1 out of many.
    • Model sets up correctly in EAI (box collider is correct (per bounds of skinned mesh renderer), it all works perfect (animation, waypoints, root animation support).
    • Ive tried shutting off optimization, changing mesh renderer, custom collider re-enable collider scripts, taking a working model, and just changing/replacing out the base model, hell i even tried adding a collider to the canvas above his head, but its a child object, so EAI shuts it off, lol, etc. Nothing works, i can walk through the AI.
    • Doesnt matter if the model has LOD's, seperate/single mesh, or modular design.
    • If i set the model up in say Invector's enemy AI system (FSM), it works and i cant walk through the AI (active collider).
    • I understand how EAI works and shuts off any added collider within the parent object (besides the needed box collider), and why.
    Ive also set up a 2019 (LTS) project to test (just tonight), and i get the same result. I also have the ability to add/remove LOD's to any object, or convert any animation to root animation from static/in-place animation, so you can imagine the testing ive done.
     
    Last edited: Nov 30, 2023
  16. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    Have you checked the Emerald character layers and player layers have collisions enabled with each other in the physics matrix?
     
    salex1 likes this.
  17. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,690
    @Deckard_89 you nailed it bro! big thnx!. Now i dont know what changed the physics matrix settings an import maybe, but still weird that some models worked but most didnt, as they all have the same layers and tags.

    Once again, thnx to you and BHS for the help :)
     
    Deckard_89 likes this.
  18. ganzsergi

    ganzsergi

    Joined:
    Mar 27, 2022
    Posts:
    13
    @BHS Hello. Another request regarding future demo scenes - make a simple controller for the player character (from first person or third person), so that it would be intuitively clear how damage from the player to the AI is recorded. On the forum and in discord, people often ask how exactly this works.
     
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    Great to hear you figured it out!
     
    warthos3399 likes this.
  20. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    I totally agree. Unfortunately, I don't have time to create a custom character controller so I will be adding this with an update after the initial release. There are currently two examples that damage an AI though. Emerald AI 2024 improves the way damage is handled by using an interface script, which should makes everything much easier than previous versions. I also covered these sections on the new wiki with much more information compared to the last version.
     
  21. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,267
    How much longer in the queue?!
     
  22. HengQAQ

    HengQAQ

    Joined:
    Apr 27, 2020
    Posts:
    1
    I want to make a flying boss, how do I use Emerald AI to make it?
     
  23. hamzahameedtarar1

    hamzahameedtarar1

    Joined:
    Aug 22, 2022
    Posts:
    3
    How to Emerald Ai Detect Malbers Animal Controller in unity Ai Does not Detect Player
     
  24. hamzahameedtarar1

    hamzahameedtarar1

    Joined:
    Aug 22, 2022
    Posts:
    3
    How to Emerald Ai Detect Malbers Animal Controller in unity Ai Does not Detect Player
     
  25. hamzahameedtarar1

    hamzahameedtarar1

    Joined:
    Aug 22, 2022
    Posts:
    3
    Hi Everyone Emerald Ai Does Not Detect Malber Animal Controller in unity 3d and enemy does not attack in Player Controller. I dont understand how can solve this issue i change tag and layer but still not working
     
  26. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,267
    Because they are not integrated. You would need to make that yourself.
     
  27. Rogue_Snake

    Rogue_Snake

    Joined:
    Jun 9, 2022
    Posts:
    2
    I can't get the materials in the demo scenes to convert to URP because they all have custom shaders. How do I get it to work in URP?
     
  28. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    Just assign a standard UPR shader to the materials that can't be converted.
     
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    julianr, salex1 and ImminentWaffle like this.
  30. ganzsergi

    ganzsergi

    Joined:
    Mar 27, 2022
    Posts:
    13
    @BHS Thank you for your work! I'm looking forward to the end of the working day so I can sit down and study the asset.
    312312.jpg
     
  31. Stigym

    Stigym

    Joined:
    Mar 31, 2022
    Posts:
    7
    Amazing! Thank you. I can't wait to try it. Does the new Emerald 2024 already work with some previous integrations? (I am referring in particular to STP Survival Template PRO and NeoFPS)
     
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    You’re welcome, thanks for the purchase!
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    I will be adding support for various assets as soon as possible. The way this is handled is much easier than with the previous version. For a quick solution, you can add an GeneralEmeraldTargetBridge script to your player that will allow AI to target, detect, and damage any object as covered here: https://black-horizon-studios.gitbo...g-started/setting-up-a-player-with-emerald-ai

    If you wanted to try the integration out yourself, you can see this section which covers a general process for integration: https://black-horizon-studios.gitbook.io/emerald-ai-wiki/api/damaging-a-custom-character-controller
     
    Stigym likes this.
  34. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    It's the update I've been waiting for! Thanks BHS for your hard work on this, purchased today and cannot wait to try it out.

     
  35. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    32
    Will puppetmaster be integrated in Emerald AI 4.0?
     
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    Thanks for the purchase and you are welcome!
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    Yes, I plan on adding PuppetMaster support to Emerald AI 2024 as soon as possible.
     
  38. Wuyan_ren

    Wuyan_ren

    Joined:
    May 8, 2020
    Posts:
    16
    Hello, before installing the version 2024 , is it necessary to delete version 3? Can these two versions coexist?
     
  39. Wuyan_ren

    Wuyan_ren

    Joined:
    May 8, 2020
    Posts:
    16
    I briefly tested the shooter AI demo and encountered two issues.

    1. I found that the AI does not choose the nearest enemy to attack. For example, if I increase the distance between the shooter and the enemies to 50 meters and increase the enemies' health so they won't die from a single shot. When the game starts, both shooters target the same enemy, even though two other enemies have run up to them, they won't switch targets until the first enemy is dead. What's more bizarre is that when the two shooters are 10 meters apart and each is being attacked by diffent enemies, They do not attack the enemies beside them, but instead attack the enemies near their teammates 10meters away.

    2. Is it possible to set the shooter's accuracy, or say, the gun's spread?
     
    Ben2390 likes this.
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    Yes, they are not compatible.
     
  41. ganzsergi

    ganzsergi

    Joined:
    Mar 27, 2022
    Posts:
    13
    @BHS
    Hello. Thank you again for your work - we continue to study this asset with great pleasure.

    There are two questions:
    1. Where did the healing ability go? To be honest, I thought that mass treatment would be added, but then self-treatment was taken away. I'm confused because I've often given this ability to AI. Do you plan to at least regain the ability to heal yourself?
    2. As I wrote earlier, Asset really lacks a simple scene with approximately an player attack to AI. How this works through the API is a little unclear. Do you still plan to make a simple scene with the player character recording damage to AI?
     
  42. Tretiak

    Tretiak

    Joined:
    Jan 22, 2018
    Posts:
    49
    This 50% sale for AI 3 owners is time limited or I can buy it anytime with that discount ?
     
    profuzzy likes this.
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    Hey there, you’re welcome.

    1. The healing ability was removed as I completely rewrote how abilities work. I unfortunately didn’t have time to add it back in time for Emerald AI 2024’s release. However, I plan on adding it back in as soon as possible. There will even be a group healing ability.

    2. With the 1.0.3 update, I added an example of how AI can damage a player object. It’s called Player Damage Demo. I'm still working on getting a playable character example.

    All damage is now handled through the IDamageable interface script. With a reference to your object hit, however that is done with your character controller (trigger, collision, raycast, etc.), you just call the IDamageable's Damage function using that object hit.
    Code (CSharp):
    1. //Damages an AI to the YourTargetReference object
    2. if (YourTargetReference.GetComponent<EmeraldAI.IDamageable>() != null)
    3. {
    4.    YourTargetReference.GetComponent<EmeraldAI.IDamageable>().Damage(DamageAmount, transform, 400);
    5. }
     
    ganzsergi likes this.
  44. ganzsergi

    ganzsergi

    Joined:
    Mar 27, 2022
    Posts:
    13
    @BHS

    Hello, I have a question about AbilityAction - in particular Dodge (since I think the block works on the same principle) :)

    The AI does not notice the player's weapon and does not do anything to dodge (it dodges against another AI).

    I found the interface in the API - IAvoidable.
    I made a Script with its implementation and attached a “weapon analogue” in the form of a cube in front of the player. But the AI still doesn’t see the weapon and doesn’t try to dodge. I tried different things but nothing helps.

    Example script.
    public class PlayerWeaponDetection : MonoBehaviour, IAvoidable
    {
    Transform CurrentTarget;

    public Transform AbilityTarget { get => CurrentTarget; set => CurrentTarget = value; }

    private void OnValidate() //Start, Awake, OnEnable work simular
    {
    CurrentTarget = gameObject.transform;
    }
    }

    Please tell me how to implement this.

    P.S. That's why I talked about the need to implement a Demo scene for Player vs. AI. ;)
     
    Last edited: Dec 20, 2023
  45. Wuyan_ren

    Wuyan_ren

    Joined:
    May 8, 2020
    Posts:
    16
    Hi, did you see my last message about two problems of the "shooter AI demo"?
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    There are two ways you can trigger a dodge:

    The first way is to using IAvoidable. Refer to the script below as an example. A collider is needed in order for the AI to detect the IAvoidable component (this can be implemented however you want, as long as there is a collider on the projectile object). Use Initialize to assign the target the projectile is intended for.

    Ensure that this projectile has the same layer as your Dodge's Projectile Layer.
    DodgeProjectileLayer.png


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. namespace EmeraldAI
    6. {
    7.     [RequireComponent(typeof(BoxCollider))]
    8.     public class EmeraldDodgeExtension : MonoBehaviour, IAvoidable
    9.     {
    10.         Transform m_Target;
    11.  
    12.         void Awake ()
    13.         {
    14.             //Get the box collider, set it relatively small, and set it to trigger so it doesn't interfere.
    15.             BoxCollider m_BoxCollider = GetComponent<BoxCollider>();
    16.             m_BoxCollider.size = Vector3.one * 0.1f;
    17.             m_BoxCollider.isTrigger = true;
    18.         }
    19.  
    20.         /// <summary>
    21.         /// Initializes the avoidable object with an intended target.
    22.         /// </summary>
    23.         public void Initialize(Transform Target)
    24.         {
    25.             m_Target = Target;
    26.         }
    27.  
    28.         /// <summary>
    29.         /// The AbilityTarget is used to determine which target the ability is intended for.
    30.         /// </summary>
    31.         public Transform AbilityTarget { get => m_Target; set => m_Target = value; }
    32.     }
    33. }

    The second way is to assign a bool to the IsAttacking function for when your player is attacking. This is dependent on your character controller and how they attack.

    The below example is how I achieved this with the Invector character controller, which has an isAttacking variable that is triggered when the player attacks. When this function gets set to true, it triggers a dodge to any nearby AI who have the player as their current combat target.

    The IsAttacking function is from the ICombat interface. You can see the included TestPlayerBridge for an example of a script derived from the PlayerBridge class.

    Code (CSharp):
    1. /// <summary>
    2. /// Used for detecting when the Invector player is attacking (can be modified as needed).
    3. /// </summary>
    4. public bool IsAttacking()
    5. {
    6.    return m_vMeleeCombatInput.isAttacking;
    7. }
     
  47. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,758
    1. This might be a bug as the AI is supposed to attack the closest target. I'll look into this and get it fixed as soon as possible.

    2. For now, you can use the General Projectile as it has a spread module. I'm in the process of adding a spread modifier to the Bullet ability.
     
  48. kristof2000

    kristof2000

    Joined:
    Oct 15, 2016
    Posts:
    36
    could this work in multiplayer games ? thanks
     
  49. Zymes

    Zymes

    Joined:
    Feb 8, 2017
    Posts:
    118
    Will this package support ECS/DOTS or is there a new package being developed that will?
     
  50. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    65
    Nice update! Going to buy it soon. Want to ask a question about performance. Have it been improved or the asset became more heavy? I want to have about 25 - 30 AI characters on screen. Will this asset provide me with good performance if i use it with 25-30 characters ? Just simple zombie behavior, maybe some of them will throw something at you, but overall nothing too complicated. Once in a while more complicated boss will appear.