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

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    A little script that I made for one of my escort quests that spawns waves of Emerald AI NPCs
     
    dsilverthorn likes this.
  2. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84

    Thanks BHS! I had not looked into the transition itself, and indeed the exit time was still enabled. Thanks again!
     
  3. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    573
    Do emerald ai have the ability to crouch, take cover etc?
     
  4. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
  5. marketxu

    marketxu

    Joined:
    Oct 30, 2012
    Posts:
    14
    how can i make headshot in emerald?
     
  6. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    The location damage script
     
  7. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    when changing my confidence level through said code on api, if i change it to coward and have the enemy faction as enemy my coward wont run away ?
     
  8. timerace

    timerace

    Joined:
    Feb 27, 2019
    Posts:
    27
    @BHS Companion AI is not working (not getting or damaging other AI even in demos).

    There are some bugs as well, in the detection tab if you choose the line of sight and first detected in the next option. AI failed to give damage to the invector controller.
     
    Last edited: Apr 20, 2021
  9. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS any idea what the next update is? Also there have been a lot of legit folks saying you aren't getting back with them? Are you abandoning your asset. You haven't been as active as you once were.
     
  10. Felixsg

    Felixsg

    Joined:
    Jul 5, 2018
    Posts:
    26
    I already buy and I like to know if posible update the outline and the other shaders for use with URP
    thanks
     
  11. beowulfkaine

    beowulfkaine

    Joined:
    Apr 3, 2014
    Posts:
    185
    Does anyone know how to reset an AI after death? I created a makeshift pooling system spawning agent but after they get turned off then on again, they seem to not do anything?
     
  12. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    EventsManager.ResetAI();
     
  13. Roger_Odonnell

    Roger_Odonnell

    Joined:
    Sep 6, 2020
    Posts:
    4

    Is there a way just to make a passive animal ai without needing to put in combat animas and all
     
  14. beowulfkaine

    beowulfkaine

    Joined:
    Apr 3, 2014
    Posts:
    185
    Do I send that message to the AI? I tried doing that and it basically did nothing. Is this described in the manual somewhere I tried looking and I found nothing
     
  15. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    @BHS hi! People over here using UCC have big issues with AI detecting and chasing but not attacking, something is obstructing the AI raycast.. the capsule collider wich handle damage and keeping the character grounded and gravity is tag : Player Layer: Character as it should. Have tried many different things..won't work.. also the rest of the character is on a layer that the AI is ignoring... Still don't work... And it finds the target , wich is the capsule collider, but also complains that it obstruct the sight... Please , have a look at this!
     
  16. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
  17. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Is there an issue with combat events? Neither On Start Combat Event () nor On Attack Event () seem to be firing. It is very clear that the AI is in Combat and Attacking.
     
  18. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS is there a way to pause the AI from attacking for a specific amount of time and then resume? Also is there a way to substitute via code an attack? For example, instead of doing offensive ability 1 do specific Scriptable Object... aka ABC Combat asset stuff. I know you must be busy, but you should really integrate this product and make it an asap item. You will sell a ton more if people could use it with Emerald.
     
    Last edited: Apr 24, 2021
  19. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    use the event on kill target to cleartarget and wander
     
  20. rivanavur

    rivanavur

    Joined:
    Jun 21, 2020
    Posts:
    4
    how can i make the ai being idle in the middle of combat? (kinda injured so we can attack them freely)
     
  21. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    For anyone interested, I've updated my Opsive integration to include Emerald AI's new location based damage system. I've also consolidated all versions into a single script and now have the integration in a Unity package. You can download the package from my website:

    http://box5641.temp.domains/~magiquep/unity-assets/
     
    Bioman75 likes this.
  22. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    Uh so I updated from the prior version of Emerald AI to the most recent one and now my ai does this. The AI just spawns face down in the ground and freaks out when agro. There are no errors with Emerald AI so I'm not sure what went wrong. Whats weird is that the demo ai doesn't do this.



    Edit: I actually am getting an error its:

    Code (CSharp):
    1. UnassignedReferenceException: The variable AIBoxCollider of EmeraldAISystem has not been assigned.
    2. You probably need to assign the AIBoxCollider variable of the EmeraldAISystem script in the inspector.
    3. UnityEngine.BoxCollider.set_size (UnityEngine.Vector3 value) (at <9b956647017d4dc1b8d3d25eef012467>:0)
    4. EmeraldAI.LocationBasedDamage.Awake () (at Assets/Emerald AI/Scripts/Components/LocationBasedDamage.cs:41)
     
    Last edited: Apr 26, 2021
  23. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    A built in way would be to call UpdateAIAttackSpeed on the EmeraldAIEventsManager component and set the min and max to the highest possible value. That gives you 8 seconds to play with. If you need more than that, you can make a few small modifications to the EmeraldAICombatManager as follows:

    Add the following code at the top of the class:

    Code (CSharp):
    1. static bool _paused = false;
    2.  
    3. public static void Pause(bool value = true)
    4. {
    5.   _paused = value;
    6. }
    Then in GenerateMeleeAttack, GenerateMeleeRunAttack, GenerateOffensiveAbility, GenerateSupportAbility, and GenerateSummoningAbility add the following code at the top of the function:

    Code (CSharp):
    1. if (_paused) return;
    When you want to pause the AI from attacking, call EmeraldAICombatManager.Pause();

    When you want to Unpause the AI, call EmeraldAICombatManager.Pause(false);

    Unless you want to handle some of them differently then you'll have to do more work. I haven't tested this myself yet, but I believe it should work. I would ask @BHS to provide this sort of pausing capability in a future version as well.
     
    MonstaManly likes this.
  24. Pho3niX90

    Pho3niX90

    Joined:
    Mar 26, 2014
    Posts:
    10
    Was the herd/pack featured removed? Cannot seem to find it
     
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Thanks for the bug report. I will look into this.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I just released an update last month. I'm not abandoning any of my assets and I have plans for more features including strafing, AI stats, and adding back in the breeding system. Devs can't take a break without people thinking we're abandoning our assets :)
     
    Tretiak likes this.
  27. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I'm working on simplifying this so the combat options will be hidden if users just want a basic passive AI.
     
  28. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I would be more than happy to make an official UCC integration guide, but the UCC developers have refused to respond to me several times (maybe they're just busy). If they want to reach out to me, I would be more than happy to make an official guide on the Emerald AI Wiki.

    If a collider is obstructing the AI's line of sight, you need to add the layer to the Obstruction Ignore Layers.

    ObsturctionIgnoreLayers.png
     
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I just tested both events and they are working on my end. Are you using the most recent version of Emerald AI? What are you trying to do with these events? Have you tried a simple test such as a Debug.Log message to the Unity Console?
     
  30. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    As I reported on Discord, this obstruction ignore layers is not working as advertised. If you set to Nothing then everything is blocking because you are inverting the mask in your raycast check. You currently have to set to Everything to get no obstructions.
     
    mattis89 likes this.
  31. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    is emerald AI compatible with mirror?
     
  32. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    That one is fixed but you have to set it to everything.... Crux should btw not spawn the emerald AI inside the crux parent object.. makes it not fire on death events etc. And UCC damage not working if the ai is inside a gameobject...same thing if you use puppet master, it dosent get the colliders ..
     
  33. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    If AI are in a parent object it wont work, neither damage.
     
  34. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Using location based damage
     
  35. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    486
    @BHS Just a thought. Maybe you could create a Discord server so the community can help each other out, talk out solutions, etc. It's just a little more responsive. This asset has a big following and to see everyone interact on Discord would be great.
     
  36. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    It ls already there https://discord.gg/UNmmyNBU. Will @BHS doesn't answer there.
     
  37. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Here is What I was doing: I rigged a deer stag with Emerald 2-4-1-1 in a project of Unity 2018.4.25f1. I attached a new GO to each antler and added a trigger collider, and a damage dealer script from Stats Cog. The Stag AI has always performed correctly and still does today. I wanted to use Emerald Events to switch the trigger colliders on and off. Using On Attack () event or On Start Combat () event to turn them on. The first thing I noticed is that on play the trigger colliders were deactivated. OK, I paused and manually switched them on. However, On Attack () and On Start Combat events were not firing, nor were the damage dealers working. In contrast On Take Damage () event does work. I tested and verified the events with Audio Source.PlayOneShot. Then I considered whether the Cog components were causing a conflict. So, I deactivated them. No change. Then I deparented them from the stag, completely. No change. Now the stag only contains the original Emerald setup. Still, On Attack () and On Start Combat () do not fire my one shot audio test, but On Take Damage () works fine. I would really like to use the Cog damage dealers and the Emerald events. Can you help?
     
    Last edited: Apr 29, 2021
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    This looks like this is related to a couple of bugs. I'll get right on fixing these.

    In previous versions, Emerald AI applied a Rigidbody component to AI. Remove this Rigidbody component from your AI as it's no longer needed.

    To fix the error, open up the LocationBasedDamage script and change the line:
    Code (CSharp):
    1. private void Awake()
    To:
    Code (CSharp):
    1. private void Start()
     
    Bioman75 likes this.
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Thanks, I'll get the description updated.
     
    SickaGames1 likes this.
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    It doesn't have built-in support, but I have had other users integrate Emerald AI with Mirror themselves. So, it is possible.
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I'll look into the issue with Crux. I have plans to add support for Puppet Master soon.
     
    mattis89 likes this.
  42. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    How do you make an AI stop in the middle of a combat. I want to hook the AI into the ABC Combat ability. The asset owners email is: DiceLockStudio@gmail.com
     
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I have a bug fix update I'm working on and I'll get this fixed as well.
     
    mattis89 likes this.
  44. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS So what is next on your update docket :)
     
  45. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Thank you!!
     
  46. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Nudge for advice on my post above, from yesterday.
     
  47. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    I can't wait to see what Will is going to get done. He said that he was on a bit of a break for a while and will start up regular updates like the old Emerald used to do! Plus Honor AI is going to start catching up ;)
     
  48. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Bioman75 and SickaGames1 like this.
  49. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I plan on adding strafing with the next major update. I'm trying to focus on one major feature at a time, which will allow quicker updates. After that, most likely some type of stats system for the AI to use.
     
    SickaGames1 likes this.
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    The OnStartCombat event is only invoked once at the start of combat. It is only invoked again once an enemy has left its combat state and it then re-enters it.

    I've been wanting to rework the OnAttack event as it is essentially the same thing as the OnDoDamage event, minus actually dealing damage. What I could do is make OnAttack event OnAttackStart and have this invoked when the current attack animation starts and then invoke a new event called OnAttackEnd once the AI's attack has concluded. The problem with all this is that it can all be handled with an Animation Event. I guess this would make it easier as it wouldn't require making Animation Events for every animation and it could offer some added functionality. I tested this though and it was able to reliably enable and disable a collider as you were trying to do. I think the problem was that OnStartCombat is only called once.