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

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    Thats weird indeed, I tested my AI and they die after the player dies (Ragdoll works) I did not try animation. Got me stumped, I don't know why your ai is not calling the death animation.
     
  2. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    I use invector, the only issue I have is the ai targets the feet. I fixed that issues, but other then that works fine. Did you check the debug, see where the ai is looking and targeting, like is it targeting your player top level or perhaps some other part of the player?
     
  3. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    it only fails to call if its set to never attack player and is then kill by a player :(
     
  4. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    First thing, check your player to make sure when the ai attacks it adds the damage script so we know at least it gets that far. Clearly it sees the player and targets it so that part sounds right. If the script does get added to your player then we need to look at the code.
     
  5. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Another question regarding Gun/Shooting AI

    Does Gun AI move around when it is attacked or it is attacking player?
    From demo and demo videos I can only see that it stands still or moves backward a few steps all the time and shoots from the same position. That's bad, it is lifeless.

    Some moving is crucial, also shooting pause/move is a must-have.
     
    Last edited: Dec 13, 2019
  6. MagiSoftworks

    MagiSoftworks

    Joined:
    Feb 12, 2019
    Posts:
    124
    Thanks Darrkbeast - To be honest I haven't been able to get damage on my Invector player since 2.3.
    I have EAI 2.2 projects that all work perfect. I am running Unity 2019.2.15f1 on this one . Using latest Invector Shooter/Melee. Sorry for ignorance but how can I check "when AI attacks it adds damage script"? - thanks for the help! Matt View attachment 528774
     
  7. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    Does this support the A* Pathfinding asset yet?
     
  8. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    During run time wait till ai attacks player then look at player in inspector. The script below will be added.... or should be. For you it should be added to your player top level. Mine is different location cause I want it to be. Anyways if that does not get added to player when hit then some thing is wrong. Now also look all over your player to see if that got attached to any other element of your player. I use latest version of EAI and unity.

    Also below is the snip of the script that adds the damage script to the player. Its located in the EmeralAISystem script. You could also put some debug logs in there to make sure its all working.

    How big is your project, if its small enough google drive it to me and I can look at it. If large then create a new one and see if you get same results.

    upload_2019-12-12_22-37-43.png
    upload_2019-12-12_22-46-28.png
     
  9. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS any luck on that update?
     
    gearedgeek likes this.
  10. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    No sir.
     
  11. MagiSoftworks

    MagiSoftworks

    Joined:
    Feb 12, 2019
    Posts:
    124
    I really do appreciate your help on this. :) It does add the Emerald Damage Script just as Player is hit. It does add it at the lower level though. Think I'm overlooking something in Invector ?
     
  12. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    If its attaching there and still your not getting hurt then it must be in the code of EmeraldAIPlayerDamage script. Send that to me in a private message and ill look at it.
     
  13. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS What are the chances that you can create a spawner system to do waves of AIs (outside of Crux).
     
  14. MagiSoftworks

    MagiSoftworks

    Joined:
    Feb 12, 2019
    Posts:
    124
    Thanks - Sent PM with Attached Script. Let me know if you receive ok? Thanks again! Matt
     
  15. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    So, I am losing my mind on a problem and hoping someone might have run into this before. I have done a basic integration of Emerald into a VR game I am building. The AI uses root motion / animated physics and when I do not have the headset on they chase and go the correct speed (VrLostFocusEvent / HMDUnmounted)

    However, when I have the headset on, while the root motion animation speed is correct their movement speed is not. They move much slower. I have repeated this multiple times to ensure it was not a fluke.

    Whether the headset is on or not, there is a camera of course, so I am really perplexed what is causing it. When I quickly looked at the source code it appears there are a number of things Emerald does under the hood as far as direction, speed based on various raycasts and physics spheres. I thought it might have to do something with incorrect tagging, but I've tried everything.

     
  16. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    Hi BHS,
    I saw back on April 19, someone had mentioned they were getting a 'UnpackPrefabInstance' error in Invector which you replied you would look at and get back on. I don't see any follow-up, so was wondering if that was resolved.

    For me, I'm seeing that same error with PuppetMaster. Whenever I try to drag my PuppetMaster character into the Emerald AI SetupManager, and then select the 'Setup AI' button, I continually get this error:
    "ArgumentException: UnpackPrefabInstance must be called with a Prefab instance.
    UnityEditor.PrefabUtility.UnpackPrefabInstance (UnityEngine.GameObject instanceRoot, UnityEditor.PrefabUnpackMode unpackMode, UnityEditor.InteractionMode action) (at C:/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:1622)
    EmeraldAI.Utility.EmeraldAISetupManager.OnGUI () (at Assets/Emerald AI/Scripts/Editor/EmeraldAISetupManager.cs:185)"

    Any idea what I might have wrong? I've set up Emerald AI on dozens of other non-PuppetMaster characters in the past, so not sure what might be missing in this case.
     
  17. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,726
    Wanted to stop in and share the EAI goodness, heres my post:

    Ive been having too much fun lately, lol. The updates on the dinos is great, the way they act and the sounds they make, has worked out nice. Will only get even better as "hit" animations need to be added. The following video shows the new audio, and the "low health" fleeing effect, and slower death animation. Heres the update for tonight (courtasy of EmeraldAI):
    • Death animation speed decreased on all dinos.
    • Attack speed adjusted, per dino.
    • Run Attack animations added, per dino.
    • Attack biting sounds added.
    • Flee on low health, set up for all dinos (set at 20%).
     
    BHS and MagiSoftworks like this.
  18. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Why can't I use a Global Variable with "Set Destination". I'm using Core GameKit to spawn the Emerald AI prefabs into the scene. I'm trying to get the Emerald AI to return to its spawning location after killing the player.
     
  19. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    what is the recommended method to keep Emerald Ai critters out of the water??
     
    dsilverthorn likes this.
  20. UDN_f21a5ba2-1ae8-4bcb-ac50-486a7076dff5

    UDN_f21a5ba2-1ae8-4bcb-ac50-486a7076dff5

    Joined:
    May 17, 2017
    Posts:
    2
    Hi @BHS Reflexes are very slow when AI attack. How can I solve this problem?

     
  21. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    Anyone have any tips on using Emerald AI with PuppetMaster?
    Specifically, how do they co-exist? And what sequence do you create the character in using both?

    When I tried to add Emerald AI to a PuppetMaster enabled character, it appears the character just sits in an idle state (even though walking and running states were added to Emerald). Additionally, the character doesn't seem to react to being hit with weapon I had added collider layer to. Previously the character was reacting when I had PuppetMaster only on him, without EAI.
     
  22. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,726
    @UDN_f21a5ba2-1ae8-4bcb-ac50-486a7076dff5 Theres a few ways to adjust that:
    • Under Animations/Combat: to the left of your Attack Animation, youll see a number 1, here you can speed up or slow down any attack animation clip.
    • Under AI Settings/Combat/Damage Settings, you can adjust Min attack speed and Max attack speed.
     
  23. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    When the game begins, Emerald disable all colliders apart from the box collider used for the character. You might need to manually enable all the "limbs" on your puppet/character, I am not sure. Let me know if you find a solution, because I also want to use Emerald with Puppet Master.
     
  24. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS Happy Holiday!
     
  25. UDN_f21a5ba2-1ae8-4bcb-ac50-486a7076dff5

    UDN_f21a5ba2-1ae8-4bcb-ac50-486a7076dff5

    Joined:
    May 17, 2017
    Posts:
    2
    I already did that. The animations are accelerating, but the wolf is still waiting and attacking. He comes to me, but why is he waiting to attack?
     
  26. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,726
    Only 3 other settings effect that, Stopping Distance, Attack Distance, and Too Close Distance (but your not using that). Check SD and AD.

    Only other thing that comes to mind is Behavior/Confidence and Detection.
     
  27. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    So got a question about Emerald AI for anyone who can answer.

    Is there any way to constrain AI made with Emerald AI to stay in a pre-defined area?

    Just curious
     
  28. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,726
    Yes, by using "way points", and "Stationary" makes them stay in 1 spot only.
     
    HeadClot88 likes this.
  29. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Ok thanks :)
     
    warthos3399 likes this.
  30. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    Just a follow-up. I resolved this issue by enabling interpolation on the AI's rigidbody.

     
    warthos3399 likes this.
  31. sr388

    sr388

    Joined:
    Jul 22, 2014
    Posts:
    2,890
    Hi everyone.

    I am the developer of Game Kit Controller: https://assetstore.unity.com/packages/templates/systems/game-kit-controller-40995)

    A few weeks ago I checked the integration with emerald, due to the health and damage detection changed in GKC in the last main update. Here the new steps to add the elements needed for the integration (mostly the same, the only difference is the code to add, which is very quick to add too), I have tried them and it works properly, let me know if anyone try them. Users from the GKC forum have already tried.

    Emerald AI integration documentation

    These integration steps can be already made if you have any 3.02 version of GKC already.

    Regards.
     
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    There's a weird bug with some versions of Unity where the rigidbody component that's attached to an object with an Animator stops its movement from working correctly (my guess is that it's related to this). I will be fixing this with the update right after the 2.3.1 update.
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    This feature is possible when an AI uses the Stationary or Dynamic Wander Type. An AI's starting position is set to its current spawning position on Start.
     
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Try setting the water's Navigation Area to Not Walkable. This should stop the NavMesh from generating where the water is.
     
    wood333 likes this.
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    The animation is set to play right when the AI reaches its target's destination. Try increasing the AI's attack speed to allow it to attacker quicker. If that isn't enough, try lowering the transition time between the Combat Movement and Attack states.
     
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I've had a few customers get PuppetMaster working great with Emerald AI, but the rigidbody component on the AI object interferes with PuppetMaster. To fix this, you need to remove the rigidbody component from Emerald AI and the AI object. This isn't needed anymore with the updated detection system and it will be removed anyways with the update following the 2.3.1 update.

    To remove the rigidbody component from Emerald AI, do the following:
    1) Open up the EmeraldAISystem script and remove or comment out the [RequireComponent(typeof(Rigidbody))] from the top of the script. Save it when you're done.
    2) Open up the EmeraldAIInitializer script and press Ctrl+F to open up the search bar.
    3) In the search bar, find the line EmeraldComponent.AIRigidbody = GetComponent<Rigidbody>(); and remove it or comment it out.
    4) Right under the above line you just removed, comment out EmeraldComponent.AIRigidbody.isKinematic = true;
    5) Save the EmeraldAIInitializer script.
    6) Remove all rigidbody components from your AI objects and Emerald AI should work with PuppetMaster.
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Happy Holidays! :)
     
    jesseganey likes this.
  38. BHS

    BHS

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

    My apologies for the delay, but the 2.3.1 update has been submitted and is awaiting approval! Due the holidays, it may not be accepted until late next week or the following week. I will post the release notes when the update is accepted. I hope everyone's holidays are great!
     
  39. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I'm using Core GameKit to spawn prefabs of the Emerald AI into the scene. I tried using Dynamic Wander but there are times where the AI would move to 0,0,0 then start to wander.
     
  40. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    I may have found a bug, so wanted to post my resolution here. My "player" target was not being properly detected. After debugging Emerald, I found the issue.

    In the LineOfSightDetection call, this is the line that attempts to get a bead on the identified target:

    Vector3 direction = (new Vector3(T.position.x, T.position.y, T.position.z)) - EmeraldComponent.HeadTransform.position;

    Unlike the other calls though, it did not take the HeadLookYOffset into account. By simply changing it to this, I resolved the issue:

    Vector3 direction = (new Vector3(T.position.x, T.position.y + T.localScale.y / 2 + (EmeraldComponent.HeadLookYOffset), T.position.z)) - EmeraldComponent.HeadTransform.position;

    It is important to make sure the separate setting for Player Y Offset (for firing projectiles) is set correctly as well or it will never attack.

    It is possible others may not have discovered this because they have a larger collider. In VR, I am using a transform under the camera and want a target that is not massively large as this is a stealth type game.
     
  41. jesseganey

    jesseganey

    Joined:
    Apr 26, 2017
    Posts:
    78
    Does anyone know how to integrate emerald with darktree fps. Happy holidays
     
  42. pascalenos

    pascalenos

    Joined:
    Mar 28, 2019
    Posts:
    10
    Order #4673128155693Order Date: Nov 25, 2019 11:40 AM
    Unity 2018.4.13f1
    Windows 10

    The problem I present when using your product (Emerald ia v2.3.2) is the following.

    HI good afternoon.
    My name is Homero Aguilar.

    Artificial intelligence does not follow the waypoints. It deviates and collides with the walls and pillars of the structures and there it gets stuck trying to move forward. I have tried to change the radius size of the nav mesh agent and the voxel of the navmesh, and it keeps happening. I have expanded the size of the spaces through which the ia should be directed and it continues to get stuck. You could help me.
    For your attention and help thank you. Regards.
     
  43. jesseganey

    jesseganey

    Joined:
    Apr 26, 2017
    Posts:
    78
    Did you put navmesh obstacle sctpt on these objects.
     
  44. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    214
    @pascalenos Shouldn't post your order id in an open forum.
     
    dsilverthorn likes this.
  45. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    143
    Hi there, I have a quick question concerning the AI taking damage.
    I am unable to make it react to each melee / ranged attack.
    The Ai gets the damage but the animation is not always triggered. Can you tell me how to call it via script in the Damage Events?
    upload_2019-12-27_1-19-24.png

    Thanks in advance and best regards,

    Dom
     
  46. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    @BHS
    Thank you for the awesome asset!

    I have few questions. Sorry of they were already addressed. Please do direct me to the response if so.

    1. I have configured my main character's Pet dog as a companion AI. When idle I want the dog to walk around in the given radius looking for may be a tree (to Pee)o object.to sniff. Right now the AI just stands at one position when he reaches the main character.
    2. How do I setup a state where my Pet always ahead of main character, instead of following behind? I want him to go in front of me and alert me of an enemy or any interesting object. Is this possible? He need not engage in combat as the current system let's you.
    3. Is there a way to configure enemies to look for cover when in combat? Right now they just stand in one possible and shoot :(
    Was hoping the AI was more capable than that. Any plans of adding more combat behaviours ?
     
  47. thorgaming_42

    thorgaming_42

    Joined:
    Sep 25, 2015
    Posts:
    13
    I am trying to use emerald AI on a Spherical world, I have got the Navmesh baked ok and if I call SetDestination on the agent it moves fine.

    But without calling SetDestination the agent isn't doing anything, no wandering not detecting the player, I wondered if there was something in the emerald pathing that might be stopping this from working?
     
  48. agent_Macgyver

    agent_Macgyver

    Joined:
    Sep 1, 2012
    Posts:
    36
    I'm having a bit of trouble:

    I want the AI the prioritize other AI instead of the Player for "Current Target" - what's the best way to do this, as the AI will not change targets unless 'Use Aggro' is enabled - but many times the AI won't get hit, so it will just chase the player indefinitely.

    this is a problem with companions as the companions follow the player, but since the player is often the closest target when approaching, all the enemy ai attack the player unless the companion can get a hit in.

    I did a find/replace for many of the fields in emeraldAIDetection that were EmeraldComponent.CurrentTarget == null to (EmeraldComponent.CurrentTarget == null || EmeraldComponent.CurrentTarget.name=="Player") but I am not sure if this is the best way to do it and would love your input.
     
    Last edited: Jan 6, 2020
  49. lolclol

    lolclol

    Joined:
    Jan 24, 2013
    Posts:
    212
    i want to integrate this kit with horror fps kit from thunder wire studio ? is this possible ?
     
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @BHS What changes are in 2.3.1?