Search Unity

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

    magique

    Joined:
    May 2, 2014
    Posts:
    3,515
    No, but I can do that tonight.
     
  2. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,053
    Okay cool. What if I use Crux to spawn Emerald AI , is it possible when using terrain streaming?
     
  3. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,515
    I checked this and saw some very strange things. The Run animations were not assigned in the override controller. So I manually set them, but they somehow got set back to nothing on their own. After a couple of tries I finally got them to stick. However, the issue is still happening where the AI drops through the ground sometimes.
     
  4. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    I'm still working on the new clouds for UniStorm. I'm hoping to have them finished by the end of the month. :)
     
  5. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    Yes, there's even a setting within the Emerald AI Editor when spawning with Crux. This will automatically adjust the population amounts when you kill Emerald AI agents. Crux shouldn't spawn on areas with no terrains/mesh so everything should work fine if you are streaming terrains.
     
    mattis89 likes this.
  6. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    What version of Emerald AI are you using? Version 2.2 doesn't use Override Controllers so maybe that's the issue. Did you remove the previous version of Emerald AI before updating to the new version?
     
  7. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    Hey everyone,

    There have been many request for switchable Weapon Types (the ability to switch between ranged and melee combat). With Emerald AI version 2.2.2, this will be possible. This will allow an AI to switch weapon types based on distance, health level, or randomly based on customizable odds. Animations and attack distances, for both ranged and melee, can be customized from within the editor. This of course is completely optional and users who do want to have this option enabled, don't have to worry about seeing the additional options. They only become visible when Enable Both Weapon Types is enabled which is located under AI's Settings>Combat>Combat Actions.

    NewAnimations.png



    Also, I've made an integration tutorial for Final IK. This allows an AI's feet and legs to align properly with the angle and slope of the terrain using inverse kinematics while blending with their animations. More tutorials are coming soon.

     
    Last edited: Apr 9, 2019
    Weblox, RonnyDance and p_hergott like this.
  8. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,515
    Weird. I thought I had the latest version. I will remove and do an update and see how that helps.
     
  9. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    There have been Asset Store issues with assets not updating correctly. Maybe that's what's happening. Version 2.2 also requires a version of Unity 2017 or higher.
     
  10. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,515
    I have 2017.1 so that shouldn't be a problem. I'll let you know how it goes.
     
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,515
    I removed EmeraldAI from my project. I also removed it from the local store cache. This forced me to re-download the asset from the store. I did that and imported again. I don't see the falling through the floor issue, but this time I am testing with a different project and different enemy prefabs so maybe that's why. However, this freshly downloaded version still creates an override controller. How can that be?
     
  12. Troast

    Troast

    Joined:
    Mar 5, 2017
    Posts:
    11
    I have problems with my ranged A.I. Have CreateEmeraldProjectile events, and made time to transition 0. Also, there is no obstruction layers set so it has no reason to not detect player. In fact, when getting withing detection distance, the A.I will target the user, and move closer to within attack range. Once reach this range, it stays stuck in "combat idle" pose doing nothing.
     
  13. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,053
    Im very happy to hear this!! :)
     
  14. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    188
    @magique 2.2 is the only version I've ever used and I still see the sinking into floor thing in 2018.3. Maybe it's something to do with having the mirrored turning animations? Not sure.
    Also, I can pass through the creature as though it has no collision at all, even though it has that box collider. This is using with Opsive's TPC version 2 by the way.
     
  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,515
    I didn't use the Mirror option so that's probably not it. I'm currently testing with Invector controller so I can't speak to the collision issue.
     
  16. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,515
    @BHS Do you have ideas on why a clean download still uses the override controller? I don't want to continue with this version if something is wrong with it.
     
  17. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    367
    @BHS Please verify that 2.2 does NOT use an override controller. If that is the case, I may have an anomalous version as well.
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    Please enable all of the Debug Log Options located at the bottom of the Docs tab to see which object is being targeted or obstructed. This may give me a better idea as to what's happening.
     
  19. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    689
    Bandicam helps :)
     
  20. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    Can you please provide a screenshot? I would recommend using version 1 of the Asset Store to download and import Emerald AI, if you haven't already done so. There's not much I can do on my end. The old version isn't even on the Asset Store server-side. I removed it for this exact reason so I have no idea how it's still downloading the old version.
     
  21. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    689
    @magique record yourself downloading it, installing it and how the override controller is being rendered.
     
  22. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,515
    Is there something specific you want a screenshot of that will show which version it is?

    You mean download from the old store?
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    Updated: Alright, so an Animator Controller and an Override Controller both have a file type of .overridecontroller, but they are both different components within Unity. This may be what's causing some of the confusion. If your Animator Controller looks like it does in the second screenshot, you are using the correct version of Emerald AI.

    To ensure we are the same page, this is an Override Controller. Emerald AI should not be using this.
    AnimatorOverrideControllerNewClips.png

    The only animator Emerald AI should be using is an Animator Controller like below. Animations are directly assigned to this while in the editor and do not use an Override Controller. An Override Controller was used with version 2.1 and prior.
    GeneratedAnimatorController.png
     
    Last edited: Apr 10, 2019
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    Yes, the old Asset Store.

    The current version's Animation tab should look like this:
    CurrentAnimationTab.png
     
  25. Troast

    Troast

    Joined:
    Mar 5, 2017
    Posts:
    11
    I put debug on, have no problems with detection or obstruction. I copied this A.I from another working ranged character but I think something is wrong with either my projectile or the transform of the point where the projectile originates because the original works. Difference exists in the model mesh and colliders, projectile object and transform to shoot from and head transform for raycasts, all other settings are the same. On review though, those are some significant parts that are altered from the basis npc I used.
    I'll change those around a bit more and see if I can get it working.
     
  26. Troast

    Troast

    Joined:
    Mar 5, 2017
    Posts:
    11
    I have had these errors a number of times, thought nothing of it because things seem to work anyway. But heres what I get, when I pressed update projectile to try another one instead:

    Assertion failed on expression: '!go.TestHideFlag(Object::kNotEditable)'
    UnityEngine.GameObject:AddComponent()
    EmeraldAI.Utility.EmeraldAIEditor:OnInspectorGUI() (at Assets/Emerald AI/Scripts/Editor/EmeraldAIEditor.cs:1499)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  27. Troast

    Troast

    Joined:
    Mar 5, 2017
    Posts:
    11
    As usual, fix unity bugs by unplugging and turning back on again (closing and restarting Unity)
     
  28. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,515
    OK, so it was just a mix up. It says it's an override controller, but it's definitely not the old style override controller as seen in your screenshot. So all should be good as far as that is concerned.
     
  29. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    97
    is there is any way to make the AI cant see the player for example if the player throw smoke grenade or in dust storm ??!!
     
  30. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    200
    Change the players layer while in the triggered area? Or tag, or set vision distance to like 1 or something on npc?
     
  31. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    200

    Haha is it too early to get a timeframe for 2.2.2?
     
  32. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,053
    @BHS I see there will be Final IK intergration, I have allready implementented the grounder IK solution, but theres alot more cool stuff that need to be intergrated, like puppetmaster death scenarios (when AI dies the physics takes over) and if theres an explosion the AI flies back of the impact.. And other stuff in the puppetmaster package like, AI trips, if it rum into an object it falls , and that kind of stuff... Basically Emerald AI need to pause all movement descisions and waypoint creation to have the puppetmaster take over and then when the AI gets back up it continues what it was ment doing.. you feel me? I get back to you when I have something cool going on maybe you could help with the final steps :)
     
  33. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    69
    Hi.

    Are there any way to change "Follower Tag"?
    I want to change the status that follow or unfollow.

    I tried the code below, but I don't know how to use it and got error.
    CurrentEmeraldSystem.UpdateTargetTags("Ally","Enemy",null,null,null,null);
    http://www.blackhorizonstudios.com/docs/emerald-script-reference/functions/updatetargettags/

    using EmeraldAI;
    using EmeraldAI.Utility;

    CurrentEmeraldSystem.UpdateTargetTags("Player","untagged",null,null,null,null);

    (Does it need "null"?)
     
  34. SilverHelmStudios

    SilverHelmStudios

    Joined:
    Aug 21, 2010
    Posts:
    141
    Just thought I share a suggestion with you here. When using the stop and start functions for AI behavior, please consider adding a special Turn-To-Face method for AI behavior. I've been working a coding contract on a project that uses EmeraldAI, and I had to do a rather lengthy and evasive behavior to override the default animation behavior being triggered by turning the character to face the player after stopping an AI. I had the team change the animator controller's flow initially so that I didn't have to include such a lengthy method of avoidance, but they found that it broke the animation functionality of the tool afterwards.

    Currently upon rotating the character's root object, the EmeraldAI system starts to fallback through various transitions since it fails to reach the idle state as expected. It either falls into a transition for rotate left or rotate right if the AI is stopped during its walk cycle and rotated before it can reach the idle trigger. Note that as long as AI root is not rotated after the abrupt stop, the trigger will signal the transition to idle, but the AI won't be facing the player. To work around this, I dynamically add an override controller to the animator that plays a rotation animations while leaving the AI facing their actual forward vector. So the player is seeing a faked rotation of the AI through animations.

    Just something to consider adding since editing the animator controller isn't the best method for maintaining continuity with the tool.
     
    mattis89 likes this.
  35. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    395
    Have found a way to get rid of all my Animation Event problems with some animations using this Animation converter https://assetstore.unity.com/packages/tools/animation/animation-converter-107688 . Converted the problematic anims to legacy and then back to generic. Now all Animation Events working fine.
     
  36. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    395
    Mad_Mark wrote:

    4) When the AI who has a melee attack only, launches an attack and the player moves away, the damage event is called, even though the player is out of range. He still receives damage. Looks odd. I could compensate for this I guess by speeding up the animation. Is there another way around this?

    Having the same problem using RFPS. My player runs some meters away and get still attacked until the the attack animation ends.

    And another problem: My Zombie AI is spawning a medikit after death through an event. This works fine, but the medikit is disappearing after some seconds. How can i change this ?
     
    Last edited: Apr 14, 2019
  37. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    188
    @unicat Does the medikit disappear at the same time your zombie is destroyed? It may be being spawned as a child of the zombie and so is being removed along with it. We also could do with an option for dead Emerald creatures to never disappear.
     
  38. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    395
    No, the zombie doesn`t remove, only the medikit.
     
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    If you copied the Emerald AI component from another AI, this would most likely be why you're having issues because it's referencing a different transform for the AI's head and the previous AI's ranged transform. If you need a way to copy an AI's component from one AI to another, given that they have the same animations and rigging, I have a tool that can do this. If you're interested, let me know and I'll PM you it.
     
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    I'm hoping to have it submitted by the end of them month. :)
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    Hey there,

    That API is outdated. If you want to update the follower tag, just get a reference to the AI's Emerald AI component and change it with something like this:
    GetComponent<EmeraldAI.EmeraldAISystem>().FollowTag = "unfollow";
     
    combatsheep likes this.
  42. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    Hey there,

    Thanks for the suggestion and information regarding this. I can certainly improve this and add a function that will rotate towards a designated target. To clarify, this is during non-combat interaction, correct?
     
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    Great to hear you found a solution and that everything is working correctly.
     
  44. SilverHelmStudios

    SilverHelmStudios

    Joined:
    Aug 21, 2010
    Posts:
    141
    @BHS give me a few minutes, I'll revert to my original solution and get you a video.
     
  45. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    3,826
    I have a fix for this ranged detection issue with version 2.2.2.

    This is most likely Emerald AI's object pooling. When creating an object with the built-in functions, they use object pooling which means they get disabled after about 3 seconds by default. For a temporary fix, add a EmeraldAIProjectileTimeout script to your medkit and set the timeout seconds to something really high so it doesn't disappear. I can add a non-object pool function with the 2.2.2 update.
     
  46. SilverHelmStudios

    SilverHelmStudios

    Joined:
    Aug 21, 2010
    Posts:
    141
    @BHS there you go:



    This is turning the absolute root while in motion. You can see it falls into the rotate state in the video.
     
  47. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    689
    When will 2.3 be done? :)
     
  48. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    395
    Great, thanks.
     
  49. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    69
    Hi, BHS.
    Thank you!
    I'll try it.
     
  50. ThePaceMaker

    ThePaceMaker

    Joined:
    Dec 18, 2016
    Posts:
    5
    Hey guys, tried messaging you and emailing you but no reply?
    I Have used Emerald many times and never had any issues really, absolutely love it!!. Im currently using invector integration all tutorials worked fine and I am on unity 2018 3.8. I have an issue upon using the setup manager where after I click setup AI at the end of the process I am getting prefab instances error, top of the code Is below, ive messaged you the full error, if you could possibly assist It would be appreciated.

    ArgumentException: UnpackPrefabInstance must be called with a Prefab instance.
    UnityEditor.PrefabUtility.UnpackPrefabInstance (UnityEngine.GameObject instanceRoot, UnityEditor.PrefabUnpackMode unpackMode, UnityEditor.InteractionMode action) (at C:/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:1531)
    EmeraldAI.Utility.EmeraldAISetupManager.OnGUI () (at Assets/Emerald AI/Scripts/Editor/EmeraldAISetupManager.cs:155)