Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,728
    @o0neza0o could be a few reasons:
    • Nav Mesh needs to be baked, and Nav Mesh Agent component added to the character
    • Animations for like Idle, Walk, Run, etc. need to be Looped (or they will only play once).
    • Wrong animation format (EAI doesnt support Legacy animations).
    • Make sure in EAI that you set up EVERYTHING, (blank animation fields can cause probs).
    • Make sure a you have a Avatar set up (a correct one, a few times i didnt have the correct avatar, and animations didnt work).
    BHS is pretty busy this weekend, maybe he will chime in and help :)
     
  2. Low_on_Mana

    Low_on_Mana

    Joined:
    Jun 18, 2018
    Posts:
    37
    Hi! Loving the asset but having an issue at the moment with my companion. It doesn't seem to want to fight passive enemy faction targets. Is this supposed to be the case? It'll fight aggressive and brave cautious (territorial) AI, but not if they're passive. I was thinking that as long as they were an enemy faction, it would see it as a valid target and attack. Am I correct?
     
  3. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,728
    Thats the way it should be, as Passives will not fight, they either dont fight or flee. I dont think it matters if its an enemy faction. (at least in my experience, so far)
     
  4. Low_on_Mana

    Low_on_Mana

    Joined:
    Jun 18, 2018
    Posts:
    37
    Thanks for the reply! I'm not looking for passives to instigate fights, I'm trying to get my companion to engage them. As it stands, he won't touch them unless they're already mad at him.
     
    Last edited: Sep 9, 2019
    warthos3399 likes this.
  5. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,728
    I feel ya, ive been working on EAI/animations for the last 6 hours, with great results. Yea, the system is set up that way, anything set as passive will act accordingly (per the tool tip just below the setting).

    Even though you set "Factions" i think the system ignores that for passives,. Unless you want to write a script with the "SetTarget" function (for companion), best way is to set it as Cautious, with a setting of Brave or higher.
     
  6. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    Thanks for reply!
    I am using malberns dragon package. Archers have to attack dragons. It has collider on its spine. Logs doesn't work properly like some time it shows some times not. If I apply same settings on a cube and take into detection it works fine they attack it but not for dragon.
     
  7. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    It was fixed by adding collider on parent.
     
  8. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    is it possible to increase the detection radius when AI searches for enemies ?
     
  9. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    165
    All of this is setup correctly as it works in my test scene just not on my terrain :/
     
  10. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    @BHS After you submit 2.3, can you give us a rough outline of what you are thinking 2.4 will consist of? I know this can be subject to change, but it is nice to see what you are thinking for future releases.
     
    iChuy likes this.
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Companion AI will only fight AI that are in their active combat state. Passive AI need to be damaged in order for them to transition to their combat state, which is why the Companion AI won't engage them in combat. This was to prevent a companion AI from going on a murderous rampage if they entered something like a city and most of the AI were of the opposing faction. I can look into improving this with the next update though. I will be redoing the faction system with the 2.4 update which will make things more flexible.
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Can you confirm that your NavMesh has been baked properly? Your terrain must be marked as static in order for it to be included in the baking process. Double check that you can see the blue mesh that is generated when in the Navigation tab.

    Please see this guide for an example: https://docs.unity3d.com/Manual/nav-BuildingNavMesh.html
     
  13. Low_on_Mana

    Low_on_Mana

    Joined:
    Jun 18, 2018
    Posts:
    37
    Thank you for taking the time to respond! The rampage was actually what I was hoping for (At least against any faction it hated). Specifically because it allows for predatory behavior.
     
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Are you looking to increase the detection radius (via the editor) or actually increase the detection radius overtime as the AI is searching for enemies?
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Yeah, when I get the chance,I'll put together an outline of my plans for 2.4.
     
    SickaGames1 likes this.
  16. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    161
    I'm having trouble with my AI character being able to push my player around. I'm thinking this is a physics issue but I'm not sure.
     
  17. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    161
    Also, I added a hit effect as a test. Now I want to get rid of it. After selecting no to Use Hit Effect I'm not getting a message the the object wasn't spawned from a pool deleting it instead. I can't get rid of it.
     
  18. Low_on_Mana

    Low_on_Mana

    Joined:
    Jun 18, 2018
    Posts:
    37
    Hello again! Could you please offer a little bit of insight as to how faction relations currently effect decisions? I have a companion that won't fight back unless it has the attacker set to Enemy. I initially tried setting it as Neutral expecting that any aggressive action would cause it to fight back, but it just kinda stood there and died. Is it supposed to do this? If so, What's the difference between Neutral and Friendly? Thanks!

    Also, my companion doesn't seem to want to switch targets after the (set to 3) hits it should need to acquire a new attacker. Have I set up their relations improperly?
     
    Last edited: Sep 10, 2019
  19. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    am looking to increase the radius at the start in general :) bhs
     
  20. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Look at the Rigidbody "Mass" setting in both the EAI and your player. For example, I have a 200 kg stag and a 50kg player, (with Invector controller). The stag can push my player, but if I walk back at the stag we come to a standstill. I can push the stag a little bit. Adjust them to your liking.

    If an object has little or no Mass everything can push it around.
     
    Last edited: Sep 10, 2019
  21. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    2 Issues:

    1. When I first play my scene, if an EAI is close by, the health bar and name are large out of scale, until the EAI and my player separate a few meters. Then the health bar and name adjust (shrink) to their settings.

    2. I have an AI animal roaming around. It seems to be creating target coordinates and moving toward them. It is creating target coordinates that cannot be reached, and is walking infinitely against a collider in its attempt to reach the target.
     
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    If it's happening during wandering, you can enable Use Object Avoidance and add your player as one of the avoidance layers. This will allow your AI to steer away from the player instead of push them. If it's happening during combat, increase your AI's Attack Distance.
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    This is most likely because you have the prefab object somewhere in your scene. When Emerald AI creates hit effects, it applies a Timeout component that disables it after a couple of seconds. If your prefab is still present somewhere in the scene (not during runtime), it will through this message after you start the scene, if that all makes sense.

    This is fixed with version 2.3 as all effect components are added during runtime and not to the actual prefab.
     
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there! A Companion AI will only fight an Enemy faction that is in its active combat state. The Neutral setting's purpose was to stop AI from fighting each other, even if they were of the opposing faction. Friendly's purpose was to allow the use of custom functionality such as only allowing an AI to become a companion, but only if their faction level was Friendly.

    Since I originally designed the faction system, I've found many ways I can improve it to offer more functionality and make it easier for users to use. With version 2.4, I plan on having an external faction system that users will apply to an AI. This will allow unlimited amounts of factions and offer many other improvements. I'll discussing the specifics regarding this after 2.3 is a finished.

    If you want your AI to be able to freely attack other AI, you will need to set the other AI to Aggressive as this will allow them to enter their combat state and attack your companion, which will allow the companion to see them as active targets.
     
    julianr likes this.
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You just need to go to Detection & Tags>Detection Options and adjust the Detection Distance :)
     
  26. Low_on_Mana

    Low_on_Mana

    Joined:
    Jun 18, 2018
    Posts:
    37
    Thanks for elaborating! I think I'll hold off on some of the more complex faction stuff I was playing around with for now then, in anticipation for the new update. Are there any plans in the future for supporting more idle animations for the companion? It currently doesn't support the idle animation list. I'd also really love multiple combat idle animations, so I can add fidgets to break up their down time.
     
  27. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    161
     
  28. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    ah right have done that but is their a way i can change the max radius setting ?
     
  29. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    Hi, I am having a weird issue where enemies hit the player for double or triple damage the first time the scene is loaded. Only does it once and I can't seem to figure out why. I am using the Ultimate Character Controller, but I don't think that's a issue. I thought at first the player damage script was somehow getting added twice but I only see one. I can't seem to find anything that would cause that, not sure if it happened to anyone else or if you have any ideas. I do change the attack damage which is not random at the start of the level.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    If you are talking about increasing the cap value within the Emerald AI editor, you need to open the EmeraldAIEditor script and fine the line below. The 100 value is controls the maximum cap. If you want it larger, increase the value and save the script.
    Code (CSharp):
    1. CustomEditorProperties.CustomIntSlider(new Rect(), new GUIContent(), DetectionRadiusProp, "Detection Distance", 1, 100);
     
  31. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there. Interesting, how are the AI applying the damage to the player, with melee or ranged damage? Both should only happen once and I've never encountered it happening multiple times. If you are using melee damage, are you using the SendEmeraldDamage animation event for applying the damage?

    Also, have you watched this Emerald AI Attack Animation Events tutorial?
     
  32. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    Thanks, sorry I just figured it out, was my error in one of my scripts. It wasn't properly updating the player health to take in to account level increases, totally my fault. Great tutorial, I watched that before to help set up originally. Thanks again for fast response.
     
  33. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    So I haven't set up ranged combat yet in EAI, and so I gave it a try today. I'm seeing a strange error though.
    I followed the tutorial video and section in the documentation, but must be missing something.

    I'm using a gun with a bullet projectile. I've populated both the 'Ranged Attack Transform' field and Projectile Object field.
    However, when my AI initiates the gun fire animation, I see the error below in console: "
    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <7d97106330684add86d080ecf65bfe69>:0)
    EmeraldAI.Utility.EmeraldAIObjectPool.Spawn (UnityEngine.GameObject prefab, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot) (at Assets/Emerald AI/Scripts/Components/EmeraldAIObjectPool.cs:167)
    EmeraldAI.EmeraldAISystem.CreateEmeraldProjectile () (at Assets/Emerald AI/Scripts/System/EmeraldAISystem.cs:1516)"

    Any idea what I may be missing?

    upload_2019-9-11_0-18-22.png
     
  34. Karmate

    Karmate

    Joined:
    Aug 30, 2014
    Posts:
    45
    is 2.3 version completed sir ?
     
  35. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    161
    It's actually happening after the first attack. Once the player has been detected the enemy runs towards the player, attacks, pauses then continues to run forward pushing my player until the enemy decides to attack again. I tried increasing the attack distance, the behavior remains the same.
     
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Great to hear you got it all figured out and you're welcome.
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    It looks like you're missing an attack animation, most likely Attack Animation 1. Ensure that you have an animation applied and that there are no blank animations within your AI's Attack Animation list.
     
  38. Mafutta

    Mafutta

    Joined:
    Sep 30, 2014
    Posts:
    45
    Hi BHS, would you please list anything we should do for upgrading to 2.3 other than backup?
     
  39. MagiSoftworks

    MagiSoftworks

    Joined:
    Feb 12, 2019
    Posts:
    124
    Hi All - Have a very slow walking hurt AI using Root Motion / Final IK. Works like a champ but he's moving "bit" faster then his legs are walking (Slide effect). Animation Play looks perfect. Ideas?
     
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    There shouldn't be anything you have to do before updating other than creating a back up. The only things I can think of for now after updating that you or others may find useful are:
    • Updating/regenerating the AI's Animator Controllers (This will update them to the 2.3 version)
    • Reapplying all Ranged animations as they are now separate variables than they were with version 2.2.
    • You will need to reassign all Emerald AI projectiles and use the new Modular Ability system (There will be a guide on the updated Documentation regarding this). The only thing you really have to do is remove all of the old scripts and create the projectile through an Damage Ability Object.
    • You will need to reassign all Emerald AI Hit Effects. (There will be a guide on the updated Documentation regarding this). The only thing you have to do is remove all of the old scripts, as the components are now added on start, and reapply the hit effects to the AI's Hit Effect List.
     
  41. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    Waiting for it to launch!!
     
  42. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    The current Root Motion calculations work really well for consistent movement animations, but animations that move really slow, or have a lot of slow speed variation like limping, may have some slight sliding. The sliding you are seeing is the minimum allowed speed with the NavMesh component to still allow it to be updating. However, I plan on improving this soon so there's no minimum speed limitation.
     
    Last edited: Sep 12, 2019
  43. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    me too! No doubt it's taking a bit longer to get everything put together ... waiting patiently :)
     
  44. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    Is there any way to fix this without adding collider to parent. because controller breaks when I add collider to the root parent. any help please?
     
  45. Hexer_

    Hexer_

    Joined:
    Aug 25, 2016
    Posts:
    94
    Is it possible to setup herds/packs /flocks with Emerald AI?
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Glad you guys are hyped for 2.3. :)

    I had to do a few quick improvements, but I'm certain it will be submitted by tomorrow. I'm looking forward to seeing what everyone creates with 2.3!
     
    julianr, JRD and SickaGames1 like this.
  47. tgamorris76

    tgamorris76

    Joined:
    Apr 24, 2013
    Posts:
    292
    Quick question, are there any docs for integration with Game Kit Controller. i cant find them anywhere
     
  48. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    How are you initially creating your AI, are you using the Setup Manager? The Setup manager automatically generates a Box Collider on the AI object. This is used for the detection process and one is required. What controller breaks? Emerald AI generates an Animator Controller based off of the animation applied from within the editor. Other Animator Controllers cannot be used.
     
  49. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Not currently, a herds and packs feature will come soon within the next update or two.
     
    Hexer_ and julianr like this.
  50. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    That would be cool, especially if you could specify how you want them to herd/group together when AI is in range of each other, or another option to specify a group of AI in a list that will do this so there is no scan (which would be a performance cost)... Diamond/Triangle/Random/Straight Line formations etc. Perhaps flock to a group of AI, or a specific target (Alpha AI / GameObject / Player / TAG)
     
    BHS likes this.