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

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Emerald Attack Event console debug logging.PNG

    But the events are NOT missing?
     
  2. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    The Dev is back to work or on vacation?
     
  3. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    You might have better luck on discord with that question. Dev has a history of disappearing when focusing on one of his assets.
     
    MaximilianPs likes this.
  4. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Yeah. What I think he is doing now
     
    wood333 likes this.
  5. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84
    Hi there!

    *** I just solved it: it was the Stopping Distance in the AI Settings/Movement.

    **** That being said, has anyone been able to create a more precise setDestination (i.e., have the EmeraldAI walk directly to the target location)?

    When using setDestination, both in visual scripting and c# script, my EmeraldAI simply stay in its place. Dynamic wandering type works well, so it's not an issue with the movement itself. When set to Dynamic wandering, using setDestination stops the EmeraldAI for a while, then the wandering resumes.

    I've consulted the API at https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Emerald-AI-API#SetDestination

    Does the EmeraldAI require anything else to begin moving towards a target destination?

    Test code excerpt:
    if ((activateDestination == true) && (initiatedDestination == false)) {
    initiatedDestination = true;
    EventsManager.SetDestination(targetDestination); }

    Thanks!
    Pascal
     
    Last edited: Feb 20, 2022
  6. pquarantine_studio

    pquarantine_studio

    Joined:
    Jun 24, 2017
    Posts:
    2
    Besides AI sound detection it would be awesome to have a dismemberment system when fighting monsters or any other AI character.
     
  7. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
  8. PRfsJay

    PRfsJay

    Joined:
    Apr 22, 2021
    Posts:
    15
    Greetings, I tried the discord and no luck thought I would try here. (fingers crossed) I have an AI companion and I seem to have two problems with it. 1. when the companion AI is set to "companion" the idle sounds do not work, so my companion does not "speak" at all, but if I change it to aggressive the ai walks around using the idle sounds and speaks and attacks everything lol. any know how to get a companion to actually use the idle sounds?

    2. When an enemy AI attacks me first the damage is taken into the player (my VR character from VRIF) but if the enemy switches over to the companion character and attacks, the VR player character still takes takes the damage and dies even if I am a mile away!. if the enemy fights the ai companion first then all goes well and smooth. does anyone know how I can fix this?

    thank you for your time and attention.
     
  9. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    Hi, I have the same issue with set destination not working. I tried clearing target, changing movement type abd my AI will no move. I even tried bypassing the ai and telling the navagent to move and that didn't work either. Seems like something is forcing the ai to remain still.
     
  10. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS Hasn't been around in a while. Not sure whats going on?
     
  11. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Would using as many as 15 - 20 factions effect frame rate?
     
  12. painkiller2007

    painkiller2007

    Joined:
    May 25, 2013
    Posts:
    44
    Not being able to play the hit animation while AI is moving or in combat causes a lot of issues. Feels very unrealistic that the zombie/enemy still keeps walking towards the player even if the player is attacking the enemy.

    Is there an easy way to do this ? @BHS

    The emotes also work only for non combat situations.
     
  13. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84
    Hi there!

    I have an animator issue occurring from time to time, which state: 'Attack Cancelled' does not exist. I have looked at EmeraldAI settings, but can't find an "Attack Cancelled" in the animation or the AI settings.

    Where should I look for this Attack Cancelled animation option?

    Thanks!
     
  14. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    63
    Hi! I'm having problems with Support Abilities. I have followed the tutorial to make an energy shield as a support ability but doesn't appear in my ai enemy. However, the Offensive Abilities work fine. I have configured the animation event like a "EmeraldAttackEvent". Is it right? Can anybody help me?
     
  15. Setzor

    Setzor

    Joined:
    Mar 10, 2014
    Posts:
    10
    I'm currently working on swapping the navmesh system integration to AStarPathfinding and already have it kind of working. If anybody is interested when I'm done, i'll setup a github repo with patch instructions.
     
    SickaGames1 likes this.
  16. Feodor111

    Feodor111

    Joined:
    Aug 7, 2021
    Posts:
    1
    I'm interested, but can I use this tool to create an AI for a 2D game, or only 3D?
     
  17. SI_007

    SI_007

    Joined:
    Aug 10, 2015
    Posts:
    84
    Hi Setzor!

    Indeed, if you manage to get it working with AStarPathfinding (paid or free version), it would be greatly appreciated if you could setup a github repo with integration instructions.

    Thanks!
    Pascal
     
  18. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    You get that working, a lot of people will be thanking you.
     
  19. Setzor

    Setzor

    Joined:
    Mar 10, 2014
    Posts:
    10
    I'm literally just replacing the navmeshagent integration with astarpathfinding. whatever the system currently supports should still work. In my case I'm testing in 3D.
     
  20. OfficialDeVel

    OfficialDeVel

    Joined:
    Oct 11, 2020
    Posts:
    10
    Hello
    Is it possible to integrate somehow Emerald ai with fmod?
     
  21. mattis89

    mattis89

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

    I don't even know where to stark when making my game multiplayer. Since it's just a co-op with 2 players it's not so heavy.
    What need to be synced and how to sync it? I'm ment to use photon pun 2.
    Do I make a separate script or is it in emeralds code I add pun 2 sync codes ... Could someone spread some light on this. Thanks
     
  22. Setzor

    Setzor

    Joined:
    Mar 10, 2014
    Posts:
    10
    in my case i just have the AI code run on the server side. obviously transforms and animations and what not need to be synced. i've been working on a simple multiplayer twinstick shooter game and what i thought would be simple has proven to be quite a challenge when dealing with real time bullet physics working with npc enemies running around.
     
    Willbkool_FPCS likes this.
  23. BHS

    BHS

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

    My apologies for the lack of communication regarding the Sound Detection update.

    While the sound detection feature is not quite ready to be showcased (but will be soon), I'm eager to showcase another major improvement I've been working on.

    This is a complex AI Duplicator, which is capable of duplicating every component of one AI including, weapons, animations, Emerald AI settings, ragdoll components (both Character Joints and Configurable Joints as well as their colliders), and more and copying them to other AI. This even works with blank animated models that haven't been setup with Emerald AI yet.

    Some features do require identical rig naming (as shown in the picture below), but as long as the naming is the same (like how Synty Studios name their characters) this will work, even if the characters are from different packs.

    Overall, this make setting up AI a lot easier and quicker, even if you just want duplicated settings and animations. I'd love some feedback on this and if there's anything that's missing or can be improved. If anyone is interested in testing, please email me with your Emerald AI invoice number.

    The AI Duplicator Manager
    AIDuplicator1.png

    There's no limitations to the amount of AI that can be duplicated at a time. The AI Duplicator has been stressed tested this with over 200 objects at once.
    AIDuplicator2.png

    A completely blank model (on the right) that has not been setup with Emerald AI or had ragdoll components applied to it. It's also a part of a different character pack:
    Blank_Model.png

    The same model run through the AI Duplicator. All needed Emerald AI components, settings, animations, weapons and weapon placement, ragdoll components, colliders, and LBD component have all been applied:
    Duplicated_AI.png
     
    shyamarama, mattis89, julianr and 4 others like this.
  24. kisala-dawid

    kisala-dawid

    Joined:
    Feb 13, 2015
    Posts:
    4
    I try to test Emerald AI 3.0, but I'm not able to upgrade materials:

    Emerald AI UI material was not upgraded. There's no upgrader to convert UI/Default+1 shader to selected pipeline

    Anyone can help?
     
  25. Jigida70

    Jigida70

    Joined:
    Aug 9, 2017
    Posts:
    11
    I added a trigger to make my NPC jump when I push a button (it's in VR, and I added a button to the left hand, and when pushed, the NPC jumps forward). The problem is, that the NPC immediately returns to the x/z coordinates at the beginning of the jump. Not sure how to correct this.
     
  26. Jigida70

    Jigida70

    Joined:
    Aug 9, 2017
    Posts:
    11
    I think I figured it out. I had to eliminate the last frame of the jump animation, since it was the same as the first. I then had to set the AI's movement to root motion, instead of NavMesh. Not ideal though, I really feel like the AI's movement is better with NavMesh.
     
  27. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    I dont know what it means by having the AI code run on the server side... Also all that syncing, where do I sync that?
     
  28. Supergrubman

    Supergrubman

    Joined:
    Jan 2, 2014
    Posts:
    20


    My AI character is not doing turning correctly. It is glitching.

    I have a few guesses on what might be causing it.
    1)The Zombie anim asset I purchased doesn't have walk right & left animations, so I didn't set them. Are these compulsary? If so, can someone recommend me a good Zombie anim asset that's compatible with Emrald AI?

    2) Another thing is I set the turn animations to 45degree turn animations since that is the smallest degree of turn I have in the anim pack. I'm not sure if it's not supposed to be like this.

    Solved Edit: I fixed the turn thing by changing the turn animation from Root motion to In place even though I'm using RootMotion movement. I guess even in Rootmotion movement the turn is supposed to to be In place. Correct me if I am wrong.

    Now that's settled are walk right & left animations compulsary? Will not having them cause problems?
     
    Last edited: Apr 5, 2022
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    That shader is just the Default UI shader with an increased Render Queue to render in front of everything. You can try assigning the default UI shader and increasing the Render Queue manually to see if that works. I will work on upgrading it to be compatible with other render pipelines though.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Yes, even Root Motion turn animations are supposed to be stationary. Movement turn animations are for Walk Left, Walk Right, Run Left, and Run Right.

    You do not have to have walk left and walk right animations. You can use walk straight animations, but the AI just won't turn as sharply. I'm working on making a custom option for turning instead of relying on the NavMesh turn as it isn't always quick enough.
     
  31. Low_on_Mana

    Low_on_Mana

    Joined:
    Jun 18, 2018
    Posts:
    37
    Is it possible to dynamically change the Nav Mesh offset in runtime? I tried adjusting it by hand and there was no change to the agent.
     
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Yes, but you would need to adjust it directly with:
    Code (CSharp):
    1. YourEmeraldComponent.m_NavMeshAgent.baseOffset
     
  33. Low_on_Mana

    Low_on_Mana

    Joined:
    Jun 18, 2018
    Posts:
    37
    Thank you! Worked out great
     
  34. BHS

    BHS

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

    Here's another brief update on some of the improvements coming with version 3.2. This improvement is important with the next update having the addition of sound detection.

    Currently, targets with changing collider sizes for functionality like crouching and crawling could have issues being detected by Emerald AI agents. This can easily allow for exploits where players can be undetected by both line of sight and an AI's aim. With this example, and the development of this next update, the Invector character controller is being used.
    CurrentTargetDetection.png

    I've rewritten some of the detection code to use the collider's center bound position as with line of sight, no target info is received until the target is seen. Previously, just the transform position was used which resulted in the above issue. Using the collider's bounds allows unseen targets to have properly adjusted heights, even if the target's collider size changes.
    ImprovedTargetDetection1.png
    ImprovedTargetDetection2.png


    The Target Position Modifier has also been modified to work with colliders that can change size. A collider source is automatically grabbed so you can see the changes right within the editor and adjust the height offset as needed.

    ImprovedTargetDetection3.png
    ImprovedTargetDetection4.png
     
    EN_Games, SickaGames1 and Bioman75 like this.
  35. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    @BHS tried to use mixamo archer as npc for archer, you should do a video on it
     
  36. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Having issues with what seems to be an AI's turning radius.

    • If I just run around in circles, the AI follows, and I can evade it forever.
    • If I stand still after this, the AI will continue to run around in a circle around the player, never able to just stop, turn to him, and fight.
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Willbkool_FPCS likes this.
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This usually happens when the AI's attack radius is too small. This makes AI unable to reach it resulting in this issue. You can try increasing the attack radius to see if it helps. I also have plans to improve turning speeds while moving with the next update which should minimize this from happening.
     
  39. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Where is the Attack Radius setting please? Is it the same as Max Damage Angle (Melee Settings)?
     
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Here's the Attack Distance:
    AttackDistance.png
     
    Deckard_89 likes this.
  41. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    This does seem to help a bit so far, yeah. Thank you
     
  42. SorraTheOrc

    SorraTheOrc

    Joined:
    Jun 11, 2016
    Posts:
    210
    I'm getting null reference exceptions in EmeraldAIDetection at line 409. This occurs because an AI was searching for a player, but that player has died and been removed. The AI retains a reference to it in LineOfSightTargets.

    A quick, but hacky, fix is to add `if (T == null) continue;` before line 409.
     
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    If your player dies, you need to use SetIgnoredTarget right when the player dies so it isn't retargeted. This can be found here: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Emerald-AI-API#setignoredtarget

    When your player has been respawned, you can then clear the ignored targets with this: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Emerald-AI-API#clearallignoredtargets
     
  44. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Thanks! BHS can add it to his list ;) @BHS Can't wait for your sound detection! Huge thing that will help your AI system for me and I think everyone!
     
    BHS and julianr like this.
  45. SorraTheOrc

    SorraTheOrc

    Joined:
    Jun 11, 2016
    Posts:
    210
    That doesn't seem very practical, in fact it feels far more hacky than my "ignore nulls" (though I worry about the buildup of nulls in that list of objects being tracked - not sure when they are culled, if ever).

    Your suggestion, if I understand it correctly, means I have to iterate over all the AI that may have seen the player and call two methods, one on death and one on respawn. Wouldn't it make more sense for the AI to say "oh, they're dead, forget them now". They are, after all, already detecting when the target is dead.

    It would seem to me that there may be many situations in which a target dies and this approach would work for every possible scenario in which a target leaves the game.
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    All AI share the same static IgnoredTargetsList variable. Only the AI who is currently interacting with the player will be checking if the target is within the IgnoredTargetsList.

    Alternatively, you can just use the ClearTarget function when the AI dies right before it's destroyed: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Emerald-AI-API#cleartarget
     
  47. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    177
    @BHS tried emerald a bit & it's good for prototyping but i missed a few features, AI hit animation handling should be improved there should be a way ai play a specific hit animation for a specific attack. If it is not too much work would be a great feature to add. If thats too much at least add directional hit detection an optional feature if someone have model that have hitt animation of different direction emerald ai should be able to handle it.
     
  48. adifrank

    adifrank

    Joined:
    Dec 11, 2017
    Posts:
    26
    @BHS I would like the NPC to play an animation when it first detects the Player. I tried doing that in Events and placing the animation in emotes. And trying to play then animation with on detect target event with EmeraldAIEventManager.PLayEmoteAnimation but it doesn't work.

    How can I accomplish this?
     
  49. Jigida70

    Jigida70

    Joined:
    Aug 9, 2017
    Posts:
    11
    On one of my NPC's, I suddenly can't get to the Animations or AI's settings tabs. I click on them and nothing happens. All the other tabs (Temperament, UI Settings, etc.), work just fine. It happened after I changed the combat idle animation.
     
  50. SeymourGutz

    SeymourGutz

    Joined:
    Aug 9, 2019
    Posts:
    16
    If it's an enemy you could just set the AI to Cautious then use the Warning animations.
    The way you described should work too if set up properly, however combat overrides emote animations by default. I had the same issue and BHS helped by showing me a setting in the Animator that forces the emote animations to finish first. See attached pic. Click on the line indicated in blue then enable Exit Time for each emote.
     

    Attached Files: