Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

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

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    256
    My latest with EAI (scale has changed)...

     
  2. o0neza0o

    o0neza0o

    Joined:
    Sep 6, 2015
    Posts:
    164
    Ok, for some reason my AI doesn't move... Unsure why. Nav mesh is baked and everything.
     
  3. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    338
    Good day. I have one more question. Is there support for old animations ?? or just an animator?
     
  4. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    256
    EAI doesnt support Legacy animations, use Generic or Humanoid.
     
  5. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    256
    @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 :)
     
  6. xenogodemperorofthehive

    xenogodemperorofthehive

    Joined:
    Jun 18, 2018
    Posts:
    19
    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?
     
  7. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    256
    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)
     
  8. xenogodemperorofthehive

    xenogodemperorofthehive

    Joined:
    Jun 18, 2018
    Posts:
    19
    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.
  9. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    256
    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.
     
  10. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    32
    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.
     
  11. tahir_ali

    tahir_ali

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

    unity_7UFP4-iCkwsgjg

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

    o0neza0o

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

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    733
    @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.
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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.
     
  16. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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
     
  17. xenogodemperorofthehive

    xenogodemperorofthehive

    Joined:
    Jun 18, 2018
    Posts:
    19
    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.
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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?
     
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    Yeah, when I get the chance,I'll put together an outline of my plans for 2.4.
     
    SickaGamer likes this.
  20. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    84
    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.
     
  21. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    84
    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.
     
  22. xenogodemperorofthehive

    xenogodemperorofthehive

    Joined:
    Jun 18, 2018
    Posts:
    19
    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
  23. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    wood333

    Joined:
    May 9, 2015
    Posts:
    630
    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
  25. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    630
    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.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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.
     
  27. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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.
     
  28. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    You just need to go to Detection & Tags>Detection Options and adjust the Detection Distance :)
     
  30. xenogodemperorofthehive

    xenogodemperorofthehive

    Joined:
    Jun 18, 2018
    Posts:
    19
    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.
     
  31. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    84
     
  32. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    73
    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.
     
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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);
     
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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?
     
  36. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    73
    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.
     
  37. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    86
    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
     
  38. Karmate

    Karmate

    Joined:
    Aug 30, 2014
    Posts:
    40
    is 2.3 version completed sir ?
     
  39. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    84
    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.
     
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    Great to hear you got it all figured out and you're welcome.
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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.
     
  42. Mafutta

    Mafutta

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

    MagiSoftworks

    Joined:
    Feb 12, 2019
    Posts:
    78
    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?
     
  44. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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.
     
  45. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    733
    Waiting for it to launch!!
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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
  47. julianr

    julianr

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

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    32
    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?
     
  49. Hexer_

    Hexer_

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,949
    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 SickaGamer like this.