Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

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

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

?

Which main feature would you like to see in the upcoming 2.6 Emerald AI update?

  1. Strafing - Allow AI to strafe in circles around their targets within a customizable distance.

    22.7%
  2. Stats - Allow AI to have additional stats, such as stamina and mana, usable by an AI's abilities.

    28.4%
  3. Sound Detection - Allow AI to detect sounds within a certain distance of their position.

    48.9%
  1. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    If you want to completely remove an object never to be used again, even when using Emerald AI's Object Pooling, then just destroy it with Destroy(YourGOToDestroy); . You will need to keep track of the objects you've spawned and then want destroyed. Simply storing them to a List should be enough. When you are ready to remove them, use a for loop to go through the list and destroy all objects within that list.

    The error seems like you may be missing an ability within your Offensive Abilities list.
     
  2. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    If you want an AI to ignore a specific layer so it doesn't obstruct the AI, you will need to add the layer to the AI's Obstruction Ignore Layers.

    ObsturctionIgnoreLayers.png
     
  3. raulrusboy

    raulrusboy

    Joined:
    Apr 20, 2020
    Posts:
    6
    Thanks- that's what I've been doing, so I'm glad it's not an issue haha...

    The offensive ability is in there, and it works with other AI that have already been set up. Is there any way that having a generic vs. Humanoid avatar could be interfering?

    EDIT: It turned out to be a faulty Idle animation that was somehow trying to move the entire model via RootTransform. It's so crazy and terrifying how many tiny variables can cause problems in this hobby haha
     
    Last edited: Jun 13, 2021
    Deckard_89 likes this.
  4. StevoFx

    StevoFx

    Joined:
    Apr 1, 2020
    Posts:
    9
    Hello, are there any updates on an integration with puppetmaster? I sort of have it working but there are a lot of conflicts so it would be great to have an official integration supported.
     
  5. Thorgrem

    Thorgrem

    Joined:
    Aug 19, 2015
    Posts:
    4
    Hello, any chance of an integration for "Rpg Builder". Many People on his Discord, ask this, and would be very happy, to have Emerald integrated. The Developer of "Rpg Builder" said that he´s own Integrations of other Assets, comes later, because of new Features and Updates, that are planned. He also said, to ask the Developer of "Emeral AI" for an Integration and let them know he is very open to it, and that he will ofc provide everything they need for free, as well as promoting them once done".
     
    Last edited: Jun 20, 2021
  6. AndorfTheWhite

    AndorfTheWhite

    Joined:
    Nov 1, 2015
    Posts:
    120
    Hi, i am trying to find a way to shoot bursts of bullets as if an AI was using an automatic weapon. How can that be done?
    Would I have to have a long repeating animation for that and add several animation events to spawn multiple bullets during the same animation (burst)?

    EDIT (SOLVED): Perfect, I just extended the animation in my 3D modelling software, added N events to the animation and now it works!
     
    Last edited: Jun 19, 2021
    raulrusboy likes this.
  7. NEPS

    NEPS

    Joined:
    Jul 8, 2015
    Posts:
    12
    Will this allow attacking opsive controllers ??
     
  8. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    79
    I have it set up with opsive and its working fine.
     
  9. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    79
    It was alot easier than I thought because it gets the attackers transform you can just get the gameobject of that transform.
     
  10. NEPS

    NEPS

    Joined:
    Jul 8, 2015
    Posts:
    12
    cool, is that using the latest version of Emerald? Mine will detect but not attack, blocked by collider per the debug. Tried changing layers to ignore all and one on collider but nothing seemed to work.. any tips appreciated.
     
  11. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    79
    Yes there was an updated version released that works with all versions of emerald ai now.
     
  12. joshuaradec

    joshuaradec

    Joined:
    Jun 14, 2019
    Posts:
    2
    Looking for a way to make the AI get damage from collision of a gameobject, making traps.
     
  13. hotpeperoncino

    hotpeperoncino

    Joined:
    Apr 11, 2019
    Posts:
    9
    InstantlyRefillAIHeath is misspell.
     
  14. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    762
    Thank you very much for the Override script. I know how busy you are with multiple assets to support. I have successfully done damage. While I have much additional work to do with Emerald, fine tuning various settings on our NPCs, the Override script is a viable solution. Many Thanks.
     
    BHS likes this.
  15. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    762
    I find two functions being called in animation events: EmeraldAttackEvent and SendEmeraldDamage. What is the difference, and how do I know which to use?
     
  16. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,135
    EmeraldAttackEvent is for the animation event when you (player) get hits by the AI. I think the SendEmeraldDamage is for the player hitting the AI.
     
    wood333 likes this.
  17. Lilcolombian

    Lilcolombian

    Joined:
    Jun 1, 2017
    Posts:
    14
    Been reading through an playing with the AI settings, i got a decent understanding but wanted to ask for direction. My player will be able to switch between different charactes, however whenever there not controlled by the player i want them to use emerald AI. What would be the way to go about this?
     
  18. alsoknownas-stefan

    alsoknownas-stefan

    Joined:
    Apr 3, 2020
    Posts:
    11
    Can't you just write a method that enables/disables the Emerald AI components when needed? Or am I thinking too simple?
     
  19. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    66
    Been having an issue for a while I think but noticing it more lately after adjusting wander settings.

    As my AI is wandering and spots me in the dungeon, they are equipping their weapon and then running past me at which point they stop and start attacking me instead of attacking me as soon as they spot me.

    I'm relatively certain it is because they are going to their wander destination (or possibly my last position) instead of attacking me. The attack distance and stopping distance are both high as these are ranged enemies so they should be stopping if they are within distance (and they are definitely within distance). The too close distance is low (1) so I know that is not the issue, I dont even have backing up enabled.

    I've been trying to piece together how Emerald tells an AI to stop or reset the navmesh agent if they are in combat mode to try and figure out how the wander (or other destination) is cleared but I'm not seeing it.

    Any ideas or if you can point me to the right area of code I can narrow my debugging.
     
    Last edited: Jul 7, 2021
  20. Pinkandfluffywizard

    Pinkandfluffywizard

    Joined:
    Dec 18, 2016
    Posts:
    1
    Any idea on how to make it so that when one AI agros to me, either by looking at me or by taking damage, it will alert nearby AIs to my presence?
     
  21. alsoknownas-stefan

    alsoknownas-stefan

    Joined:
    Apr 3, 2020
    Posts:
    11
    @BHS Any news on the new version of Emerald AI? Hope you are doing fine, since this post was some weeks ago.
     
  22. raulrusboy

    raulrusboy

    Joined:
    Apr 20, 2020
    Posts:
    6
    Any ideas what's causing this?

    IndexOutOfRangeException: Index was outside the bounds of the array.
    EmeraldAI.EmeraldAISystem.Update () (at Assets/Emerald AI/Scripts/System/EmeraldAISystem.cs:1033)

    All animations are filled in, and the AI functions fine despite the error, but it gets called hundreds of times for each engagement.
     
  23. ChameleonAK

    ChameleonAK

    Joined:
    Aug 6, 2015
    Posts:
    2
    Hi,
    Before buying this package, I went through forum, demo and videos, and want to clarify that those features included in your package:

    • If AI is damaged by a ranged weapon, then is there any option that damaged AI search for player inside specific area?
    • If Player approaches AI from behind crouching and AI is using LineOfSight, will the AI attack player on very close range?
    • If two enemy AI [using LineOfSight] are standing, having a small distance between them with one enemy AI is facing forward and other one backward, then if one is alerted or hit by player, will the other closest AI be alerted or not?
     
  24. TheGhost0

    TheGhost0

    Joined:
    Sep 11, 2017
    Posts:
    19
    i have question for this tools:

    Can I make the enemy follow the sound he hears?
    Can I make the enemy attack the enemy that does not look like it?
    Can I make the enemy use more than one skill?
    Can I make the enemy heal himself and his friends if they are close to losing?
    Can I make the player use more than one skill, but while the player reaches a certain level?
    Is the player can carry a weapon and use it?
    Can the enemy carry a weapon when he needs a weapon?

    If the answer is yes, please give me an explanation of everything that it can do and help me in programming my game, please.
     
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    When I get the chance, I have plans to add PuppetMaster support. This will most likely be done through an integration tutorial similar to what was done with Final IK.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    I'll reach out to the developer of RGP Builder. I'd be more than happy to do an integration with RPG Builder, after I have finished some of the updates I'm working on.
     
  27. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    Look for the script DamageAIByCollision. It's included with Emerald AI.
     
  28. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    Thanks :) I'll get that fixed.
     
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    SendEmeraldDamage is for internal usage and is used for triggering a melee damage. EmeraldAttackEvent is what's supposed to be used for your Animation Events and automatically detects whether the AI is ranged or melee. This is explained here: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Creating-Attack-Animation-Events
     
    wood333 likes this.
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    This was a bug that will be fixed with the next update. I'm planning on submitting this update sometime this week.
     
  31. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    I don't have time to post a code example at the moment, but this is certainly something I can look into adding as an option through the Emerald AI editor within the next update or two.

    What I would do is use an OverlapSphere: https://docs.unity3d.com/ScriptReference/Physics.OverlapSphere.html and get all colliders near the aggroed AI when the aggro is triggered. If surrounding AI's Faction matched the aggroed AI, assign the aggroed AI's new target with SetCombatTarget: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Emerald-AI-API#setcombattarget
     
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    My apologies for the delay with the Emerald AI update. I was also working on a large UniStorm update at the time and it took a lot longer than I expected. The UniStorm 5.0 update is now done so I'm planning on submitting the Emerald AI update sometime this week, now that I have the time to finish it up.
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    This error seems very arbitrary and I haven't been able to recreate it. Try clearing the AI's Animator Controller and creating a new one, within the Emerald AI editor. You can simply save over the AI's current Animator Controller if you want to keep it as the same file.
     
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    I responded to this via the email you sent.
     
  35. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    66
    Thanks. I ultimately solved this by adding this to the top of the AttackState function before the other if statements. Not sure if this is the best way, but it has worked perfectly.

    Code (CSharp):
    1.             if(EmeraldComponent.DistanceFromTarget<EmeraldComponent.AttackDistance && !EmeraldComponent.DeathDelayActive && !EmeraldComponent.TargetObstructed)
    2.                 EmeraldComponent.m_NavMeshAgent.ResetPath();
     
  36. alsoknownas-stefan

    alsoknownas-stefan

    Joined:
    Apr 3, 2020
    Posts:
    11
    No need to apologize. Just glad you are doing fine. :) Great to have a Unistorm update, I am sure to check it out.

    I have send you an email on the wrong damage number being displayed by the combat text manager (it shows total damage, but not damage after mitigation by block).

    I hope that adding an event is still on your to-do list for when a target (the player primarily, but perhaps it is also handy for other targets/gameobjects?) is detected within the AI's line of sight (as opposed to detection radius). :)

    My vote also goes to an official puppetmaster integration. I am going to have a go at integrating emerald AI and puppetmaster this week, but no doubt I will run into problems like others have.

    @StevoFx Could you explain how you did it and what conflicts there are? Any tips and tricks?
     
    Last edited: Jul 15, 2021
  37. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,135
    Any chance to get ABC Combat integration in?!
     
    StevenPicard likes this.
  38. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    808
    This would be nice to see.
     
  39. raulrusboy

    raulrusboy

    Joined:
    Apr 20, 2020
    Posts:
    6
    I found the issue. If you set the AI to Melee or Both, and check Run Attack but don't apply any animations, and then set it to Ranged, it will still try to play the missing Run Attack animations from the Melee Attack while in the combat state. Checking for missing animations doesn't help, ostensibly because Melee Attacks are disabled.

    I'm also getting some missing reference exceptions when the AI are attacking each other and one of them gets killed and despawned. The dead AI is left in place for at least 6 seconds, which should be plenty of time for the other AI to drop it as a target, but sometimes it doesn't, which is perplexing.
     
  40. alsoknownas-stefan

    alsoknownas-stefan

    Joined:
    Apr 3, 2020
    Posts:
    11
    How would I go about blocking a strike from the Emerald AI enemy with a shield (as seen here
    ) and then letting the enemy play a stagger animation after a succesfull block with my shield?
     
  41. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,135
    Easy...write it yourself. Do an event to where when blocking, fire character get hit animation.
     
  42. alsoknownas-stefan

    alsoknownas-stefan

    Joined:
    Apr 3, 2020
    Posts:
    11
    Well, I got my shield with event working in the integration with Invector. Their MeleeCombat_NoInventory scene contains a shield with an event system. In the script vMeleeWeapon.cs is an OnDefense() event that you can unhide. On this event you can call anim.Play("Base Layer.Hit States.Hit 1", 0, 0);

    Emotes apparently only work outside of combat mode, but you can trick Emerald AI by doing this:
    EmeraldComponent.CombatStateRef = EmeraldAISystem.CombatState.NotActive;
    EventsManager.PlayEmoteAnimation(0);
    StartCoroutine(ContinueEmoteAnimation());

    I found that anim.Play is much better, since it ignores Exit times in animations.

    Now all I have to do is isolate the shield mechanic of Invector, put it into my VR Project, identify the isBlocking method and call it, for example when the y of the shield is higher than x, isBlocking is true.
     
    Last edited: Jul 22, 2021
  43. trojant

    trojant

    Joined:
    May 8, 2015
    Posts:
    64
    Hi,@BHS
    Why do the same animal AI sometimes get stuck together? And sometimes it can't avoid other animals. What's the matter, please? Thank you.
    Set random priority? I think it's less stuck.
    upload_2021-7-23_2-54-23.png

    upload_2021-7-23_2-56-16.png

    upload_2021-7-23_2-58-2.png

    upload_2021-7-23_2-58-36.png

    upload_2021-7-23_3-2-9.png
     
    Last edited: Jul 23, 2021
  44. alsoknownas-stefan

    alsoknownas-stefan

    Joined:
    Apr 3, 2020
    Posts:
    11
    ABC already has integration with Emerald AI, according to the product description on the Unity Asset Store: https://assetstore.unity.com/packages/tools/game-toolkits/ability-combat-toolkit-155168#description

    Here is a post on how to turn on the integration: https://forum.unity.com/threads/50-sale-ability-combat-toolkit.770840/page-2

    There does not seem to be official documentation. I advise contacting the developer of ABC and reading forum posts.
     
    Last edited: Jul 24, 2021
    StevenPicard likes this.
  45. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,135
    There is no integration currently.
     
  46. alsoknownas-stefan

    alsoknownas-stefan

    Joined:
    Apr 3, 2020
    Posts:
    11
    Can you be more specific on what part is not integrated (since it seems that there is some level of integration, according to the developer himself) and what functionalities you would like to see integrated?
     
  47. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,135
    No the developer claims that it should work with any system but like others here have tried and it is not as easy the Mozza makes it seem.
     
  48. al3d

    al3d

    Joined:
    Feb 7, 2013
    Posts:
    26
    BHS is it possible to have a tutorial for link puppet master with emerald AI ? please help me I tried without success :(
     
  49. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    Yes, I'll take a look at the incorrect damage number being displayed and get that fixed with the update I'm currently working on. This update ended up taking a lot longer than expected, but it has lots of improvements and bug fixes that I will discuss soon.

    Yes, an event for the line of sight event will also be added with the next update.

    I will look into PuppetMaster integration when I get the chance. My priority right now is getting the Emerald AI update released.
     
    Last edited: Jul 28, 2021
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,494
    Thanks for the bug report. I'll look into this and get it fixed.
     
unityunity