Search Unity

[RELEASED] Emerald AI 2.3 - The Ultimate Universal AAA Quality AI Solution

Discussion in 'Assets and Asset Store' started by BHS, Jun 26, 2015.

  1. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    296
    darrkbeast fixed that issue but i noticed if my ai is set to never attack player it wont do its death animation it just stands and twiches but its health bar is set to zero, if i set it to always attack player then it does everything correctly
     
  2. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    108
    Thats weird, so are you making a passive AI? Its possible its a bug, I have not encountered that one. That may be a question for the creator.
     
  3. MagiSoftworks

    MagiSoftworks

    Joined:
    Feb 12, 2019
    Posts:
    117
    Hi Team - Does anyone have an issue with EAI causing damage to Invector Character? :) It's hit or miss for me. 2.2 works like a charm. Layer Correct, Script edits. Maybe I'm missing something. Wood333 think you are using Invector? thoughts?
     
  4. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    296
    darrkbeast nope have it set on aggressive for so it attacks over ai and leaves the player alone
     
  5. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    108
    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.
     
  6. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    108
    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?
     
  7. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    108
    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.
     
  9. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    55
    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
  10. MagiSoftworks

    MagiSoftworks

    Joined:
    Feb 12, 2019
    Posts:
    117
    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
     
  11. StevenPicard

    StevenPicard

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

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    108
    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
     
  13. SickaGamer

    SickaGamer

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

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    462
    No sir.
     
  15. MagiSoftworks

    MagiSoftworks

    Joined:
    Feb 12, 2019
    Posts:
    117
    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 ?
     
  16. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    108
    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.
     
  17. SickaGamer

    SickaGamer

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

    MagiSoftworks

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

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    12
    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.

     
  20. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    96
    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.
     
  21. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    456
    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.
  22. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    146
    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.
     
  23. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    658
    what is the recommended method to keep Emerald Ai critters out of the water??
     
    dsilverthorn likes this.
  24. 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?

     
  25. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    96
    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.
     
  26. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    456
    @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.
     
  27. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    220
    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.
     
  28. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    876
    @BHS Happy Holiday!
     
  29. 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?
     
  30. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    456
    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.
     
  31. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    701
    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
     
  32. warthos3399

    warthos3399

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

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    701
    Ok thanks :)
     
    warthos3399 likes this.
  34. yarsrvenge

    yarsrvenge

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

     
    warthos3399 likes this.
  35. sr388

    sr388

    Joined:
    Jul 22, 2014
    Posts:
    1,664
    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.
     
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,084
    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.
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,084
    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.
     
  38. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,084
    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.
     
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,084
    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.
     
  41. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,084
    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!
     
  43. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    146
    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.
     
  44. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    12
    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.
     
  45. jesseganey

    jesseganey

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

    pascalenos

    Joined:
    Mar 28, 2019
    Posts:
    1
    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.
     
  47. jesseganey

    jesseganey

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

    blacksun666

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

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    123
    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
     
  50. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    165
    @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 ?
     
unityunity