Search Unity

[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. Zelre

    Zelre

    Joined:
    Dec 3, 2016
    Posts:
    55
    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.
     
  2. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    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?
     
  3. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
  4. 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 !
     
  5. 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
     
  6. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Very cool, thanks for sharing!
     
  7. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I'll get the GKC tutorial updated first thing tomorrow.
     
    Hexer_ likes this.
  9. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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();
     
  11. BHS

    BHS

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

    BHS

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

    BHS

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

    Hexer_

    Joined:
    Aug 25, 2016
    Posts:
    94
    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?
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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.
  16. Hexer_

    Hexer_

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

    BHS

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

     
    julianr, SickaGames1 and Hexer_ like this.
  18. Hexer_

    Hexer_

    Joined:
    Aug 25, 2016
    Posts:
    94
    @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!
     
  19. Wandersoul

    Wandersoul

    Joined:
    Aug 28, 2013
    Posts:
    35
    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
  20. Deckard_89

    Deckard_89

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

    Wandersoul

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Thanks! I've added this to the code snippet section of the integration tutorial.
     
    julianr likes this.
  23. SickaGames1

    SickaGames1

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

    ZGoodwin

    Joined:
    Jul 14, 2017
    Posts:
    31
    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)
     
  25. UDN_449900de-7c34-4a67-83eb-fa8501bf0413

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

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

    Wandersoul

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

    BHS

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

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
  30. UDN_449900de-7c34-4a67-83eb-fa8501bf0413

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

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

    Wandersoul

    Joined:
    Aug 28, 2013
    Posts:
    35
    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.
     
  32. 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
     
  33. BHS

    BHS

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

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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.
  36. UDN_449900de-7c34-4a67-83eb-fa8501bf0413

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

    Joined:
    Jun 16, 2017
    Posts:
    17
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    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.
     
  38. 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.
     
  39. UDN_449900de-7c34-4a67-83eb-fa8501bf0413

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

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

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    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:

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

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

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

    adifrank

    Joined:
    Dec 11, 2017
    Posts:
    26
    @BHS My character only walks half way in waypoint and then turn around?
     
  43. 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
     
  44. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Any ETA on 2.3? @BHS
     
  45. 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
  46. K4rha

    K4rha

    Joined:
    Aug 7, 2014
    Posts:
    30
    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.
  47. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Has anyone used Emerald AI with Core GameKit?
     
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Yes, I use it with Core GameKit. You are probably concerned with pooling issues. I've personally had to add some additional code in order to make it work smoothly. The main thing was to create a new class that had references to all the Emerald classes like EmeraldAISystem, EmeraldAIInitializer, etc, and I have them disabled in the prefab. Then in an OnSpawned() function I enable them. I might have had to do some other things, but I don't remember all the details. But if you have a specific problem I'm sure I could help you find a way to make it work.
     
  49. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I saw that post, but I admit that I don't quite understand what you're saying. In your post, you state the following:

    "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"

    Do you mean that the AI are not spawning in their defined spawn positions? What do you mean by moving to one location? What location? Are the AI supposed to spawn in random positions and then wander? More details would help.