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

    cheesee09

    Joined:
    Mar 30, 2018
    Posts:
    35
    Its a Secret
     
    Pandur1982 likes this.
  2. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Due all respect, I just wanted to help and let you know my current information about Multiplayer support, thats why I posted "as I am aware of". That has nothing to do with trolling or what so ever. I am a happy customer of Emerald AI and have nothing against you or the question regarding multiplayer / Photon integration. On contrary I would like to know the answer as well...
    So sorry if I offended you that wasn't my intention. Ofc the asset creator or other users can and should answer your question from their side and correct my post if its wrong, misleading etc.

    Best regards
    Ronny
     
    Last edited: Dec 4, 2018
    Mojo-Game-Studio and Pandur1982 like this.
  3. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    When atacking 1, 2 or 3 is chosen? Randomly or driven by some rules?

    Ant another question, I have done the integration with invector and everything works fine, I can recieve damage and apply damage to the IA.
    BUT..... even when the Emerald NPC's are always following the player (I have the tags and layers ok) most of the times the Emerald NPC doesn't launch any atack to the invector player. Is chasing him correctly but only launches an attack let's say 1 of every 20 times. Some IAs even never attack to the player (They follow him ok).
    What can be the reason? It's driving me crazy with lots of hours testing.
     
  4. cheesee09

    cheesee09

    Joined:
    Mar 30, 2018
    Posts:
    35
    Make sure you use the setup wizard and the layers correctly. I had encountered that problem but I also fixed it by reading carefully the integration manual. If you want your AI to attack faster just out 0 in min and max attack speed and in min and max chase
     
  5. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Thanks, solved. Finally it was a child layer inside the player that had the layer "player" also, where all must be default to avoid conflicts... :)
     
  6. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Is it possible to add custom sounds on specific times on the animators clips also on the "attacks" animations? (As in footsteps ) ? I mean to have better control and fine tunning than start playing the sound on the start's clip...
    Thanks,
     
  7. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I thought his response was an honest attempt to help you. Yours is an annoying and incredibly rude response.
     
  8. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Delay timing on the animations for applying damage is measured in:
    1.seconds or
    2.% or
    3. frame ?

    Thanks,
     
  9. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hey bro take a look at this video, it's pretty easy and powerful to add events on your animations

     
    radiantboy likes this.
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I can't remember exactly, but I thought you could fix it with applying a NavMesh Obstacle to your player. I can't remember whether or not it was using carve or not, but this should work.


    Switchable melee and ranged combat, based on distance or health, will be coming with the 2.3 update.


    It should be sometime this month.


    I haven't worked out exactly how schedules will be handled. UniStorm integration is easy because I'm the developer of it. I'm not sure how Enviro's time of day events are handled, but when I'm ready to start 2.3, I will look into it further.

    I am taking full advantage of Unity's Animation Events. I have already added an "General Sounds" list that can be customized for each AI. This sound list allows users to add sound clips along with an ID so they can be called with an Animation Event and using its int parameter. This can be used wherever needed.

    Attack sounds will also be called using Animation Events that will be random. Animation Events are best for this so they are always triggered consistently.

    I've also added a new "Item List" for each AI that allows them to enable and disable items. This can be useful for quests, enabling and disabling weapons or other usable items, and even having an AI interact with objects such as removing an item from a plant so an AI can farm. I have a demo video of all this coming within the next couple of days.

    Emerald AI already has support for both Dialogue System and Quest Machine. I will make sure version 2.2 is supported before it's released.


    I will look into network support after 2.2 is released. It's tricky because Photon isn't built-in to Unity like Unet was. Depending on how difficult it is, maybe I could make a tutorial for it.


    They are played in order of 1, 2, and 3. With 2.2, you will have the option to play randomly or in order.


    This was happening because you AI saw the player as obstructed. If you need to ignore a layer, you can use the AI's Obstruction Detection Layers. If there's anything in front of the player that's not on the Detection Layers, the AI will consider its target obstructed so it needs to be ignored.



    Yes, footstep Animation Events can currently be used. You just have to enable the option in the Sounds Option. See the tutorial here to add footstep sounds through Animation Events: https://docs.google.com/document/d/...s2njM7Jx9pYlqgbtM8/edit#heading=h.aisc1wq6w60

    Other custom sounds and attack sounds for Animation Events will come with version 2.2.


    The attack delay is measured in seconds. So, if you set your delay to 0.5, it will not trigger damage or a projectile for a half a second even though the animation is playing.

    With version 2.2, attacks will be triggered with Animation Events so you can trigger an attack at the exact frame that's needed regardless of the animation's speed.
     
    RonnyDance likes this.
  11. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Once 2.2 is ready, updating from actual version do you keep all the AI params or do you have to start from scratc for every NPC? Thanks,
     
  12. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    Yeah I was wondering this as well. Do we have to rebuild the AI controller and everything from scratch or will the update just be seamless plug and play?
     
  13. UnityCSharpNoob

    UnityCSharpNoob

    Joined:
    Jul 29, 2016
    Posts:
    2
    Would be nice to see the release of 2.2 soon. Still waiting!
     
    erichey likes this.
  14. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    63
    Hi @BHS ,

    I am having an issue with a character and an npc collider, whereby the player ends up on top of the ai head.

    I've narrowed it down to the rigidbody and navmesh agent - I also found that when using a rigidbody and nashmesh agent, you must have the option Is Kinematic on, otherwise a race condition occurs, that information is in the unity documentation. (this does not work though with Emerald ai ).

    So, I have a few questions.

    1) When setting up Emerald AI v2 with a brand new ai prefab, the setup creates the box collider, rigid body and navmesh agent on its own - but your setup does not tick the Is Kinematic option..\are you guys aware of this ? and that you have to have this on ?

    2) Even if I tick the option Is Kinematic for emerald ai v2 ai's it does not work - I tested and it works on another ai asset i have, its just it does not work with emerald ai v2 - player character ends up on top of ai model head due to colliders having a race condition - is there away around this ?

    Its a show stopper for sure, your hitting an NPC AI, and suddenly your on top of its head. lol I dont know why the Is Kinematic option fails to work for emerald ai.

    Regards

    Carme
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I tried my hardest to keep the variables the same and most things should be able to transfer over. However, I didn't want to limit myself so somethings where changed and renamed. Most animations will need to be reassigned as well as generating a new Animator Controller. The good news is that there are now about 50 animations total that can be used for each AI.

    The Damage function will not need to be updated as I added optional parameters. However, if users want to utilize the new features, such as ragdoll deaths, you will want to update the Damage function. I will provide update information on the documentation when version 2.2 is released.


    Animator Controllers will need to be regenerated and animations will need to be reapplied. There are now about 50 animations total that can be used on each AI.


    I'm working as quickly as I can. I'm rigorously testing version 2.2 for a flawless release. The improvement between version 2.1 and 2.2 is significant. A lot of the system was rewritten and improved.


    You can also try adding a NavMesh Obstacle to your AI.

    1) IsKinematic is set to true on Start with the Emerald_AI script. This is done just in case a users sets it to false while in the editor.

    2) Try adding a NavMesh Obstacle to your AI as I've suggested. It should stop the AI from being able to be on top of your player. I can't remember if you're supposed to have Carved set to true or not. Also, make sure your AI's box collider isn't too large and the stopping distances isn't set too small. These can both cause this issue to happen.
     
    hoodoo, SickaGames1 and llJIMBOBll like this.
  16. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    @Carmexx

    I found having carve on and carve only stationary off makes the ai try to walk around you, but if you have carve only stationary on the ai will walk into you.
     
  17. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello @BHS

    Im using this in a VR project and Im using Final IK & Puppetmaster to fight pedestrians in my neighbourhood... The question is that Im only using Emerald for navigation and love/hate intergration.. But the death should be handled with emerald, where to send that functions?
     
  18. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    How to make both AI's feet snap to the terrain and not one of them like flying when walking on a slope terrain? Thanks
     
  19. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    63
    thanks @BHS, I'll try adding a navmesh obstacle to the player, (I tried it once but did not like the way the player can now push ai around) - but yes is should not end up on ai's head due to collider collision.

    and thanks @llJIMBOBll I'l check carve options.
     
  20. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    I'm not sure if i've just noticed or its just started to happen but all my animal AI are sliding at the end of the walk animation. It seems Emerald carries on moving them after the animation stops. Any idea what is causing this and what can be done to fix it @BHS ? Thanks Andy
     
  21. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    use final ik
     
  22. C_p_H

    C_p_H

    Joined:
    Nov 24, 2014
    Posts:
    153
    Final IK or Moveen.
    :cool:
     
  23. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    426
    @BHS Is there a recommended way to debug an AI?

    I've found that some of my AIs move as expected (wander type dynamic) and attack the player, while others don't. They stay in the same place, stuck on their idle animation. As far as I can see I've set the exact same settings on all the NPCs, just some work while others don't.

    Any obvious gotchas, or anything I could do to find out why some aren't working/moving?
     
  24. cheesee09

    cheesee09

    Joined:
    Mar 30, 2018
    Posts:
    35
    Use navmesh if they aremt moving or add a nav mesh agent component to the ones that doesn't move. Make sure you also has a nav mesh baked into the scene
     
  25. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    426
    @cheesee09 Thanks but navmesh is baked and all AI have navmeshagent components. They all do. Just some move around and work correctly while others don't.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Custom death functionality can be added by utilizing the OnDeath event located under AI's Settings>Events. This allows you to call any custom function when an AI dies.


    This can happen if your AI's NavMesh Radius is too large or if the AI's Stopping Distance is too small.


    I can't think of anything that would be causing this. I don't believe I have ever encountered this issue. The only thing I can think of is that the AI's Stopping Distance is too large or their NavMesh Radius is too large. Also, make sure your Wander Radius isn't set too low. Maybe the AI isn't generating waypoints far enough out to move to them.
     
  27. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    426
    @BHS I'm really struggling with this, and it's doing my head in. Been on it for hours. Sometimes the setup works, sometimes it doesn't. I've tried duplicating a working AI and changing the Animation Controller with a new Override Controller (and new animation clips) and that never seems to work. I've redone the same GameObject a number of times and sometimes it works and sometimes it doesn't.

    Settings like Stopping Distance, NavMeshRadius, Wander radius are all identical to all NPCs and within sensible values.

    The one thing I do know is that when it works, the AI's Animation Controller (the mechanim tree) starts with the Idle1 bool parameter set to true (ticked), then from there the parameter values change to animate the AI. With the broken AIs, the initial Idle1 parameter never gets ticked - it's never gets set to true.

    Is there any way of debugging why the initial setting of this state is broken?
     
  28. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    Does the update fix the issue where there's no audio cooldown for the get-hit sound an AI can make? Second question, how generic are melee / ranged attacks in 2.2? I've implemented some basic spellcaster enemies through ranged attacks plus other script components but I'm curious how much that sort of thing is supported natively in 2.2 (either through allowing script invocations as cast attack actions, or other means).

    Thanks for your hard work on the asset, it's amazing!
     
  29. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Okay thats good. But I really was wondering how to send custom damage to emerald component to kill the AI?
     
  30. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    63
    Hi @mattis89

    Set the health in Emerald, I set100; really does not matter to what as long as you call enough damage to go past its max life.

    EmeraldAIScript.Damage(101, Emerald_AI.TargetType.AI);
     
    mattis89 likes this.
  31. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Off topic go troll elsewhere
     
  32. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Thanks very much for your direct and very helpful reply - this sort of interaction is what makes the Unity community great!
     
  33. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    lol totally
    Has anyone successfully integrated photon into Emerald 2.0 - if you did - how did you do it?
     
  34. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Has anyone successfully integrated photon into Emerald 2.0 - if you did - how did you do it?
     
  35. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    63
    No idea on photon server.

    Pun was easy enough, just do what you normally would, add a photon view, transform & animation view, config the views as to your liking - InstantiateSceneObject on prefab. You already know the Emerald product has no networking inbuilt, so you need to use your own custom damage/health+bars (or whatever you need to network on your game) scripts; that are networked via rpc's or .stream.SendNext / stream.ReceiveNext to sync params across clients.

    (Essentially your using emerald to move AI and run animations, shame but heres hoping to full network support in the near future).
     
    BryanO likes this.
  36. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Does anyone know how to make the warning samples work ? Also I would like to add an event when the character sees me, do I need to code that myself? If so anyone got any hints as to where.. Seems a shame to hack up every asset I get (especially when new version comes out) but also seems to be the best way to really customise them.
     
  37. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    I think that is coming in either 2.2 or 2.3? @BHS can answer that better.
     
  38. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I'm having an issue with the AI using ranged not being able to damage the UFPS player. I have followed the tutorial and changed the Y offset but that didn't work.
     
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Are you using the Emerald Setup Manager? Also, if you are duplicating AI, you will need to clear the Animator Controller and create a new one. What may be happening is, the Emerald system may be referencing the previous Animator Controller instead of the new one. I have redone and fixed all of this with version 2.2, but I will look into this for you to see if that's what's happening.


    A secondary Audio Source is added with 2.2 that automatically detects whether or not the primary Audio Source is playing. If the primary is playing, it will use the secondary to ensure all sounds are reliably playing.



    With version 2.2, I have an entire script dedicated to events that are able to be called both programmatically and through Animation Events, with Warning Sounds being one of them. I have also added a Unity Event for OnWarning, as well as an OnFlee, OnAttack, and OnStartCombat.


    Did you make sure you unchecked "Has Collision Trigger" as mentioned in part 6? This is usually why the AI cannot see the UFPS player. Also, ensure that your tags are correct.
     
    radiantboy likes this.
  40. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    @BHS , I have unchecked the "Has Collision Trigger". The default skeleton melee AI is working and can damage the UFPS player. I created a new AI that uses ranged attack and they are firing at the UFPS and the projectile is going to the UFPS player's feet.
     
  41. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Oh great!!! How do I find these methods? I see nothing in the docs for OnWarning.

    EDIT: DOH! not out yet, whens it coming? :)))) Any other goodies.. Actually ive been playing today this is best AI ive had so far I think..

    PS. yes ive been tapping into animation events, what a godsend they are, I guess they can do virtually everything I need in some way

    edit: the warning sounds did work in this release though right? just wondering why I cant hear them
     
    Last edited: Dec 10, 2018
  42. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Can you verify that the "bullets" actually hit you? If so I think I can help with the code to do damage.

    Ive just got back to emerald (I use UFPS "classic") and decided it would be better for me to simply put a collider inside "items" that hit me like swords/bullets, then I can add whatever I want to the script. Hopefully you are using colliders etc and if so you can try this:

    Code (CSharp):
    1. void OnTriggerEnter  (Collider other)
    2.     {
    3.         if (other.tag=="Player")
    4.         {
    5.             Debug.Log("PLAYER HIT.");
    6.  
    7.             if (other != null && other.GetComponent<vp_DamageTransfer>()){
    8.                     other.GetComponent<vp_DamageTransfer>().Damage(15);
    9.                     Debug.Log("damage sent "+15+" TO "+other.name);
    10.                     return;
    11.         }
    12.         else
    13.         {
    14.             Debug.Log("couldnt damage player! CurrentTarget:"+other);
    15.             if (other!=null)
    16.             {
    17.                 Debug.Log("CurrentTarget is "+other.name+" does it have a damage handler???????");
    18.             }
    19.         }
    20.     }
     
  43. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Maybe you can print out their target name (to see what it thinks its going for?), perhaps you could make the target be something like the FPSCamera or the head bone, I think I have this issue somewhere in my game if you use the whole player object sometimes it goes for the bottom of it for some reason.
     
  44. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Where am I putting this at? in the OnTriggerEnter function in Emerald_AI.cs?

    EDIT: Also I have found something out that if I move really close to the ranged AI the damage will happen to the UFPS player. So I'm not sure if it's a collision problem or what.
     
    Last edited: Dec 11, 2018
  45. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS When you come out with 2.2, will the documentation be updated to reflect the new features? It would be nice to have an update tutorial along with the upgrade!
     
  46. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Yeh Im sure I had same issue, I will try setting up some ranged shooters today and bet back to you
     
  47. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Why is that the companion AI dont help you out? They just wander, they're supposed to follow you and attack your enemies arent they? Demo scenes dont do that either. I seem to remember there is also meant to be a canvas giving you controls like 1 to spawn stuff, but that isnt there. I think I also remember many layers were tweaked whenever I load this, ie they seem wrong, I can fall through the floor on some demos, so maybe thats it?

    Edit: oops forgot to call SetTarget() seems like he is following me now :-D

    EDIT2: he follows me but never ever attacks the AIs im fighting, I have tried following the mnual perfectly, any ideas???

    ps- be good if you had a better forum so we can search for things nicer :)
     
    Last edited: Dec 11, 2018
  48. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Hmm since I last worked on this I cant dish out damage, any idea how you do that? My ufps player used to be able to hit the enemies to damage them, feel like im going around in circles because I had this working :) Cant seem to find anything I changed in the main emeraldAI script though.

    EDIT: Apologies this is in the integration tutorials, working through it again now. I swear i thought I had a melee system set up on my guy so I could punch them but I find no evidence of it at all so need to actually do it now ;)
     
    Last edited: Dec 11, 2018
  49. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    573
    in january then
     
  50. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    I fought this.... issue lots. A kinematic rigidbody doesnt.... receive for and do calculations like gravity rigidbodys do. And when a kinematic rigid body collider overlaps another kinematic rigidbody, the system gets screwy and diesnt know how to handle the collision, and typically pops the moving one up on top of the other. Annoying AF. Since the character component is also kinematic rigidbody. You can dig into code and play with the overlap issue itself, or use a different move system. I switched mine to a gravity character controller. Problem solved.