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

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    189
    What do walk left / right animations actually mean? Strafing, or actual walking in the given direction (if that makes sense)?
     
  2. Hexer_

    Hexer_

    Joined:
    Aug 25, 2016
    Posts:
    86
    I did some work on making latest Emerald work with latest GKC.
    Anyways, I managed to make the Emerald AI damage GKC player but I can't get it to work the other way around.
    It's like GKC doesn't recognize the Emerald collider at all… it's not even firing CheckHealth :-/

    This works...

    Code (CSharp):
    1.        
    2. public void SendPlayerDamage(int DamageAmount, Transform Target, EmeraldAISystem EmeraldComponent)
    3. {
    4.              if (GetComponent<health>()){              
    5.                 GetComponent<health>().setDamage((float)DamageAmount, Vector3.forward, Target.transform.position, Target.gameObject, Target.gameObject, true, true);
    6. }
    7.         }
    This doesn't work...

    Code (CSharp):
    1.  
    2. EmeraldAISystem Emerald_AIToCheck = objectToDamage.GetComponent<EmeraldAISystem> ();
    3.         if (Emerald_AIToCheck) {
    4.             Emerald_AIToCheck.Damage ((int)damageAmount, EmeraldAISystem.TargetType.Player);
    5.         }
     
  3. Tandinos

    Tandinos

    Joined:
    Jan 10, 2015
    Posts:
    6
    Yeah I turn all the sliders to 0 and the attack hit sounds etc still play they are super loud vs other sounds
     
  4. Mohamad-Elgabbas

    Mohamad-Elgabbas

    Joined:
    Aug 30, 2015
    Posts:
    14
    hey
    when my AI dies i call ResetAi from EmeraldAIEventsManager Class but i have strange result the AI get up and regain health and temperament rest to the default settings (not to my default setting) the AI run randomly and after 3 second from calling ResetAi method the EmeraldAiSystem script and the Animator get disabled.
    cannot find recycle ai option under optimize tap !
    emerald ver : latest
    unity ver : 2018.3.13f1
     
  5. Zelre

    Zelre

    Joined:
    Dec 3, 2016
    Posts:
    52
    Maybe the Reset AI function does exactly that... Resets the AI. Try set the AI'd state, and refill health. Figure out what changes when it dies and reset those things. Might work better.
     
  6. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    81
    So, due to existing project constraints, I'm still using Emerald AI version 2.0 or 2.1 (not the latest).
    It seems to happen about 5-10% of the time, that my enemy AI will just freeze and become completely unresponsive until I exit the game.
    It can be in the middle of an attack on the player, or sometimes even before the first player encounter with him. I'll find him in some weird position in a different part of the world. Seems to be totally random, and I see nothing in the logs.
    Any tips on best way to debug this?
     
  7. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    693
  8. Mohamad-Elgabbas

    Mohamad-Elgabbas

    Joined:
    Aug 30, 2015
    Posts:
    14
    i was asking because it's in the Docs so is't replaced with a new method , is't deprecated or it's just a bug in the new ver and where recycle ai option under optimize tap i really want to know. can you see recycle ai option on your version maybe i have a problem in my project or this version of emerald just compatible 100% with unity 2019 and there is a problem with previous versions of unity !
     
  9. port1234

    port1234

    Joined:
    Jun 15, 2017
    Posts:
    2
    How to change the Hit transform on the player as on AI because the archer ai shoots at the feet I use with Invector Shooter
     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    Very cool, thanks for sharing!
     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    Walk left and walk right are for the Blend Tree and are based on the AI's current direction towards its destination. It's not strafing, but more of a pivot.
     
    Deckard_89 likes this.
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    I'll get the GKC tutorial updated first thing tomorrow.
     
    Hexer_ likes this.
  13. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    Did you set the Spatial Blend to 0? Having this on 1 is what allows it to use 3D sounds. Ensure that this value on your AI is set to 1, it should be by default.
     
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    Hey there, This is most likely the bug discussed before where an AI doesn't properly clear its target after it has died. I've fixed this with the upcoming version 2.2.2, but for now, when you call ResetAI also call YourEmeraldAIComonent.ClearTarget();
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    I have never heard of that issue before. There's nothing in Emerald AI's code that would alter its position to a different part of the terrain other than its NavMesh destination. Are you certain that there are no external scripts modifying the AI's position? Have you properly generated the NavMesh on your scene? If possible, it would be best to provide a video of the issue so I can determine what's going on.
     
  16. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    There is no longer a Recycle AI option. This is done automatically using ResetAI(), however, there is a bug where the AI retains its previous target so YourEmeraldAIComponent.ClearTarget() needs to be called after ResetAI() is called.
     
  17. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    You can adjust this using the Player Offset Y Position under the Damage Settings when using the Ranged Weapon Type.
     
  18. Hexer_

    Hexer_

    Joined:
    Aug 25, 2016
    Posts:
    86
    Sometimes the NPC slides on the ground for a second or two before doing a moving animation such as walk, run or move backwards.
    What am I doing wrong and how can I fix it?
     
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    You need to make your Stopping Distance amount higher. This can be found under AI's Settings>Movement Settings. You can also try making your AI's Agent Radius smaller. This can be found under AI's Settings>NavMesh Settings.
     
    Hexer_ likes this.
  20. Hexer_

    Hexer_

    Joined:
    Aug 25, 2016
    Posts:
    86
    Thank you so much for the fast reply :D
     
  21. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    The Game Kit Controller (GKC) integration video and tutorial are finished.

     
    julianr, SickaGamer and Hexer_ like this.
  22. Hexer_

    Hexer_

    Joined:
    Aug 25, 2016
    Posts:
    86
    @BHS just one more thing about GKC integration which I just now confirmed with its dev..
    For melee combat mode, the code

    Code (CSharp):
    1. EmeraldAI.EmeraldAISystem EmeraldAIToCheck = objectToDamage.GetComponent<EmeraldAI.EmeraldAISystem>();
    2. if (EmeraldAIToCheck) {
    3.             EmeraldAIToCheck.Damage((int)damageAmount, EmeraldAI.EmeraldAISystem.TargetType.Player);
    4. }
    must also be added to bottom of method checkCanBeDamage in applyDamage.cs just above the return false;

    Otherwise melee attacks won't be able to damage Emerald AI.. which is the issue I had and couldn't figure out the reason until today!
     
  23. Wandersoul

    Wandersoul

    Joined:
    Aug 28, 2013
    Posts:
    34
    Couldn't seem to connect to the listed discord so I was hoping someone might help me out here. I set up a new AI enemy to hunt my player and it now wanders about the area properly, but it doesn't react to the player. What do I need to have set up on the player so the AI will detect them? Currently the player is little more than Opsive third person controller. The AI will chase the demo player if put into the Territorial demo, but not in my scene.

    EDIT: Figured it out. THere's a requirement that the player have a collider with isTrigger enabled on. Since Opsive doesn't put their trigger collider on the root object, the player was never detected. Might be a good FAQ item.
     

    Attached Files:

    Last edited: Jun 2, 2019
  24. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    189
    Give your capsule collider the Player Tag so the Emerald creatures can detect it.
     
  25. Wandersoul

    Wandersoul

    Joined:
    Aug 28, 2013
    Posts:
    34
    Unfortunatly Opsive's UTPC capsule collider is created via code.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    Thanks! I've added this to the code snippet section of the integration tutorial.
     
    julianr likes this.
  27. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    693
    nice. How is 2.2.2 going as well as the great and anticipated 2.3!!!!
     
    julianr likes this.
  28. ZGoodwin

    ZGoodwin

    Joined:
    Jul 14, 2017
    Posts:
    23
    Copied / Cloned AI does not register attack damage w/ the invector integration setup. I've encountered problems whenever the original AI enemy is either cloned or copied for additional AI unit. For some reason things get messed up. Either the AI will slide across map, or, damage is no longer receiving.

    The question: Are there official steps to cloning the AI unit? (currently, I am simply copying the whole unit inside of hierarchy and hitting play. Again, this creates broken AI)
     
  29. UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    Joined:
    Jun 16, 2017
    Posts:
    16
    can anyone help me intergrating this into my project?
     
  30. Wandersoul

    Wandersoul

    Joined:
    Aug 28, 2013
    Posts:
    34
    Did you follow the instructions? Are you getting an error?
     
  31. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    It's going well and I'm working on getting it submitted as soon as possible. :)
     
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    I'll PM you the AI duplicator tool. I'm working on a better solution for cloning AI using scriptable objects to store certain information that can then be imported to other AI to void having to reassign everything manually.
     
    julianr likes this.
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
  34. UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    Joined:
    Jun 16, 2017
    Posts:
    16
    im using another asset and im trying to intergrate the 2 things but i cant seem to make it work :(
     
  35. Wandersoul

    Wandersoul

    Joined:
    Aug 28, 2013
    Posts:
    34
    Is it possible to add a 'skill check' to whether or not the AI notices the player? I was thinking it might be useful to have the player able to 'hide' from the AI and was wondering if this was already an offered feature.
     
  36. nuttyape

    nuttyape

    Joined:
    Jun 16, 2018
    Posts:
    3
    what setting do i need to change... my ai when dies floats in mid air..
    upload_2019-6-10_22-10-1.png
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    What asset are you using? I would be more than happy to help the best I can. :)
     
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    In order for an AI to detect a player, the player needs to have the appropriate tag and layer that is setup through the Emerald AI editor. When using the Line of Sight detection type, the AI will need to actually see the player in order to start attacking them. So, players should be able to hide form AI. If you want more control over this, you could change the player's tag and/or layer when you want AI to have this ability, given that they have the proper layer and tag setup within the Emerald AI editor.
     
    Wandersoul likes this.
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    That would be because of your animation, not Emerald AI. To fix this, you will need to adjust the animation within the animation settings. You will need to check Bake Into Pose on the Root Transform Position (Y).

    Without this checked
    AnimationFloatingFix1.png

    With this checked
    AnimationFloatingFix2.png
     
    nuttyape and julianr like this.
  40. UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    Joined:
    Jun 16, 2017
    Posts:
    16
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,843
    I’ll reach out to the developer of that asset to see if I can get a copy to create a tutorial for it. Without having the system myself, it’s difficult to know where the added code needs to go.

    To damage an AI, you need to find the reference from the damaged object of your character controller and call:
    GetComponent<EmeraldAI.EmeraldAISystem>().Damage(DamageAmount, EmeraldAI.EmeraldAISystem.TargetType.NonAITarget, transform, 500);

    In the PlayerDamage script, you need to add a function to damage your player controller/health script. Without all of the script and function names, I have no way of knowing what functions you need to call for that asset.
     
  42. unity_hv4chnlVpeE8Jg

    unity_hv4chnlVpeE8Jg

    Joined:
    Jun 14, 2019
    Posts:
    1
    I have a Question Regarding Emerald Ai. I just downloaded it a few days ago to start learning it. one issue I'm having is how do I call a variable like the AI's health. in a new script.
    Any Help for the Newbie would be greatly appreciated.
     
  43. UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    Joined:
    Jun 16, 2017
    Posts:
    16
    i cant figure it out sadly :( if you have teamviewer we can always do it over here :)
     
  44. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    119
    I'm having an issue with the Waypoints for the Emerald AI. I'm using Core GameKit to spawn groups of enemies in the scene. But all the AI will move to one location instead of the spawner location. Anyway to fix this?
     

    Attached Files:

  45. UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    UDN_449900de-7c34-4a67-83eb-fa8501bf0413

    Joined:
    Jun 16, 2017
    Posts:
    16
    Is it possible to do it over TeamViewer with you? :D
     
  46. adifrank

    adifrank

    Joined:
    Dec 11, 2017
    Posts:
    3
    @BHS My character only walks half way in waypoint and then turn around?
     
  47. ChillyMcChill

    ChillyMcChill

    Joined:
    Nov 17, 2016
    Posts:
    57
    Hello, I am having a weird issue with my AI. I noticed my character will walk fine for a while (about 30 seconds) but when he stops sometimes he keeps moving with an idle animation for a few seconds until he finally stops. Sometimes he will start walking again with the same issue

    What could the issue be? I have tried navmesh and rootmotion navigation and it seems to be happening on both

    Thanks
     
  48. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    693
    Any ETA on 2.3? @BHS
     
  49. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hi,
    I have a deer with cautious temperament and coward confidence level, so when it detects the player flees.It works, but if the player is in front of the animal,it flees towards the player, and i would like it flees always opposite the player.Any idea why?

    - Is there any tutorial how to damage the ai(for example shooting it) or the player to get damage (from a bear ) and use the ragdoll death?
    and is possible the AI flee from a projectile?

    thanks
     
    Last edited: Jun 19, 2019
  50. K4rha

    K4rha

    Joined:
    Aug 7, 2014
    Posts:
    26
    Hello,

    i recently bought emerald ai and i was wondering if there's a Mirror integration planned in the upcoming months.
    It wouldn't be a big deal to implement it by myself, but i want to avoid spending time on something that is coming soon anyway.

    Thank you
     
    Scream2020 likes this.