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

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    No matter what, the "best" course of action is to do a clean install.
    1. Retains your original project just in case something goes south.
    2. Eliminates or at least obviates any code dependencies.
    3. Allows you to not lose any modifications you made to dependent code.
    Just my opinion, based on many stupid human tricks...
    Mark
     
    combatsheep likes this.
  2. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Have you tired enabling the Debug Tools (located under the Docs tab at the bottom and allows you to visually see raycasts within the editor tab) to see if the AI's line of sight is being fired over the player's head? This is typically why an AI will engage with a target, but not attack them. If an AI's line of sight is too high, it can be adjusted with the Player Offset Y Position located under the AI's Ranged Options.
     
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Of course! If you can send me an example of an AI that is causing the issue, that would be helpful, thanks.
     
  4. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Are you using an effects pack that has any other components or scripts on it? If you are, the additional scripts may be interfering with Emerald AI's projectile script.
     
  5. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    I am using Kripto Magic 1 and Magic Ultimate, 2 different packs and my abilities both go to the same side. Any ideas?

     
  6. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I'm having an issue where the Emerald AI isn't being displayed with Opsive UCC. I believe I have all the Tags/Layers set up but nothing is displaying.
     
  7. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    100 page Anniversary Congrats ;)
     
    llJIMBOBll and johaswe like this.
  8. SashaNyashaa

    SashaNyashaa

    Joined:
    Jul 31, 2015
    Posts:
    6
    Hello, I was thinking about purchasing Emerald AI. I have a question. Does he work with a playmaker? (I use a translator).
     
  9. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    I read somewhere recently ... someone is currently developing PlayMaker actions for Emerald. AWESOME !
     
  10. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    SashaNyashaa likes this.
  11. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    @BHS thanks that fixed it! The only remaining issue is that the ranged attacks seem to collide with the AI that fires it, detonating them prematurely
     
  12. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    133
    Thanks, Mark.
    I'll try it.:D
     
  13. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Last edited: Apr 18, 2020
  14. Jon_Brant

    Jon_Brant

    Joined:
    Mar 22, 2018
    Posts:
    56
    Hey there. Just picked up this asset, looking pretty cool. I tried to search for this issue, but no luck.

    I have 6 attack animations set, but the AI only ever uses the first one in the list. Is there an option I'm not seeing somewhere to make it use a random one? The 6 hit animtions I'm using seem random
    upload_2020-4-18_19-30-39.png
     
    Last edited: Apr 19, 2020
  15. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hey bro take a look at combat settings in there you can set to use random and add the animations u have set to use.

    I’m not at pc so can’t be specific just helping quick
     
    Jon_Brant likes this.
  16. Jon_Brant

    Jon_Brant

    Joined:
    Mar 22, 2018
    Posts:
    56
    Ahh, I only had one entry in the list of Melee Attacks in Combat Settings>Damage Settings. Adding the other 5 corresponding to my animations fixed it. Thanks!
     
    llJIMBOBll likes this.
  17. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    How would I implement this possible fix for Spine Animator for a Death Event?

    Code (CSharp):
    1.   // Your code, executing death
    2.     void Death()
    3.     {
    4.         StartCoroutine(FadeOutSpineAnimator(1f)); // Running procedure to blend out spine animator motion (component in which this code is launched must be enabled)
    5.     }
    6.     // Blend out procedure
    7.     System.Collections.IEnumerator FadeOutSpineAnimator(float duration = 1f)
    8.     {
    9.         FIMSpace.FSpine.FSpineAnimator spine = GetComponentInChildren<FIMSpace.FSpine.FSpineAnimator>();
    10.         if ( spine)
    11.         {
    12.             float elapsed = 0f;
    13.             while (elapsed < duration)
    14.             {
    15.                 elapsed += Time.deltaTime;
    16.                 spine.BlendToOriginal = Mathf.Min(1f, elapsed / duration);
    17.                 yield return null;
    18.             }
    19.             spine.enabled = false;
    20.         }
    21.         yield break;
    22.     }
     
    Last edited: Apr 19, 2020
  18. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    is their a way to get the ai to swim on the surface of water with emerald?
     
  19. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    I am trying to teleport an AI from out of reach area into the playable area, but it seems to only be allowed to move in the Z and X axes, but not Y. Why is this please?
     
  20. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Because an AI has a NavMeshAgent, it is always placed on a navigable surface at the nav mesh offset height.
     
    Deckard_89 likes this.
  21. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Solved by having the NavMeshAgent disabled by default, then teleporting the AI to the desired place, then enabling the NavMeshAgent.
     
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    You were able to resolve this by ensuring all Kripto components were removed like I suggested via Discord, correct?
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This is because Emerald AI's UI can only rotate towards 1 camera at a time. It wasn't designed to be used with split screen.
     
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This can be fixed by reducing the size of the projectile's collider with its ability object.
     
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Not currently, at least without some code modifications, but I do plan on adding a swimming feature at some point.
     
    dsilverthorn likes this.
  26. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Yes I was! Thanks for the helpful info! When is the next update and what is in it? :)
     
  27. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    @BHS how would we go about adding this, as got animations fine and triggers but i want it to float ?
     
  28. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS I tried adding a "neutral" faction group and I was unable to get them to attack after I initiated an attack. If I make them an enemy it works fine.... Any ideas?
     
  29. Alexandus

    Alexandus

    Joined:
    Sep 5, 2012
    Posts:
    25
    Give him some slack on the next update haha he just released a big one.
    @BHS tried your suggestion, but projectiles are still exploding immediately on the AI that's trying to fire them - do ranged attacks work for you locally? Even using the built in Emerald example ranged attacks fail when I put them on my AI's. I set the colllider radius to 0.000001

    Other than that, fantastic update and this is one of my favorite assets on the store
     
    Last edited: Apr 21, 2020
  30. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    If you want it to float you'll need to animate the navmeshagent offset to simulate floating effect.
     
  31. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    @magique have been changing the navmeshagent which does change it so it appears to float but it is not smooth it just goes straight up , anyways to do a smooth float ? i am also tried using planes as like a ramp to try to gain a similar effect but it doesn't register any ground areas other then the terrain?
     
  32. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    It seems that the Y axis is not taken into account when the AI attacks - if you are above them they can still damage you with melee attacks, as long as you are beside them in x/z axes. Verticality is not taken into account, this is a huge issue for me atm. The player is up an entire set of stairs but taking damage from an AI that is on ground level.

    Has anyone else experienced this, or is it only an issue with my setup somehow?
     
  33. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    If anyone else is interested in swimming AI, I wrote a quick script for @unity_7UFP4-iCkwsgjg to accomplish this. I plan to integrate this into my LifeLink AI Extensions and refine it more there.

    To use it, you must do the following:

    1. Attach a box collider to your water plane and check Is Trigger. Make sure the box collider covers the entire area of the water, including depth.
    2. Tag your water plane as Water and put it on the Water layer.
    3. Attach a rigidbody to the water plane and make it Kinematic and uncheck Use Gravity
    4. Attach the EmeraldAISwim script to your EmeradlAI
    5. Set the Water Level in EmeraldAISwim to a little bit less than your water's actual level.
    6. Set the Swim At Depth value to the depth you want the AI to start swimming. This allows the AI to walk into the water at shallow depth and start swimming when it gets deeper.
    7. Set the Layer To Ignore field to the layer that the AI is on so that water depth checks don't collide with the AI itself
    8. Add a swimming animation to your AI's Emotes and assign that value to the Swim Emote ID field.

    That's it. The AI will walk in shallow depth and swim at deeper depths and then return to walking again when going back on land.

    This same technique can also be used for flying AI and I plan to add that to LifeLink as well. When I enhance this, it will have smoother transitions between walking and swimming and may have some floating animation to simulate buoyancy.

    [EDIT]
    It turns out that there are some flaws with this script that make it not work in a lot of scenarios. It also doesn't cooperate with waypoints or trying to reach a player target. I have found a solution and will post an update in a new post when I have it all polished. So, do not use this script.
     

    Attached Files:

    Last edited: May 9, 2020
    julianr, Akshara, llJIMBOBll and 4 others like this.
  34. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @magique and multiple phases dragon boss fight?
     
  35. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Oh, definitely coming.
     
  36. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Try changing attack height:

    upload_2020-4-22_8-14-30.png
     
    Deckard_89 likes this.
  37. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Thank you, I will try this out asap.
     
  38. JeffG

    JeffG

    Joined:
    Oct 21, 2013
    Posts:
    85
    Not this will help, but I use Kripto and I use a different projectile class

    Code (CSharp):
    1. using System.Collections;
    2. using EmeraldAI.Utility;
    3. using UnityEngine;
    4.  
    5. public class KriptoProjectilAISupport : EmeraldAIProjectile
    6. {
    7.     private RFX1_Target fx_Target;
    8.  
    9.     // Start is called before the first frame update
    10.     void Start()
    11.     {
    12.         fx_Target = GetComponent<RFX1_Target>();
    13.  
    14.         if (fx_Target != null)
    15.         {
    16.             if (ProjectileCurrentTarget != null)
    17.                 fx_Target.Target = ProjectileCurrentTarget.gameObject;
    18.             else
    19.                 fx_Target.Target = EmeraldSystem.CurrentTarget.gameObject;
    20.         }
    21.  
    22.         if(fx_Target.Target != null)
    23.             Debug.Log(string.Format("Target is {0}", fx_Target.Target.name));
    24.         else
    25.             Debug.Log("No Target for Projectile");
    26.     }
    27.  
    28.     /* These Methds are all empty too override the base class */
    29.  
    30.    
    31.  
    32.     private void OnEnable()
    33.     {
    34.        
    35.     }
    36.  
    37.     private void Update()
    38.     {
    39.        
    40.     }
    41.  
    42.     private void OnTriggerEnter(Collider other)
    43.     {
    44.         Debug.Log(string.Format("projectile hit {0}", other.gameObject.name));
    45.  
    46.         // DO damage to whatever it is
    47.  
    48.     }
    49. }
    50.  
     
  39. AdminArdagor

    AdminArdagor

    Joined:
    Feb 6, 2018
    Posts:
    42
    Hi BHS ! When can expect the integration in Emerald functionality of strafe (around Player - in battle)- for NPCs ? Such capabilities are very lacking.
     
    Last edited: Apr 24, 2020
  40. LVelior

    LVelior

    Joined:
    Feb 1, 2020
    Posts:
    9
    BHS greetings, I use the Invector but noticed this problem: When dealing damage with a sword, the Emerald AI does not always start the hit damage animation (although the Emerald AI’s health is taken away with each hit correctly). How can this be fixed?
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    No problem! The main focus for the next update is location based damage.
     
    SickaGames1 likes this.
  42. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Strange, when I tested this, the Neutral relation is working as expected on my end. Can you test the included demo scene to see if the Neutral relation is working correctly?
     
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Do you have any other colliders on your projectiles or anywhere else on our AI? It sounds like the projectile is colliding with either itself or the AI that's firing them. When you tested the example scenes, were the AI using their default projectiles?
     
  44. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    The Attack Height is calculated separately so users can adjust the allowed height an AI can attack. See the AI's Attack Height setting under the AI's Settings>Combat>Damage Settings tab.
     
  45. indie_dev85

    indie_dev85

    Joined:
    Mar 7, 2014
    Posts:
    52
    Any updates about implementation of herd and breeding mechanics?
     
  46. verteom

    verteom

    Joined:
    Oct 26, 2018
    Posts:
    48
    I want to play an extra animation in the controller, but the AI will always update some animations. like combat movement , walk backwards .. Stationary Direction .. Is there has better function to disable those
     
  47. ArthurHoeke

    ArthurHoeke

    Joined:
    Nov 27, 2014
    Posts:
    12
    @BHS After a couple months I'm still having issues with the ranged combat AI's detection. My ranged enemy isn't able to detect me at all when I walk past him using trigger or detection radius. Only when I initiate the attack he'll spot me, but doesn't follow me nor attack me. Only when I (in VR) lower my controller to either high up above my head or basically laying on the ground it seems to sometimes randomly detect it and start attacking without issue, but after I pull it back he'll lose me again. Setting the max firing angle to the highest value doens't help either.

    Only having this issue so far using ranged enemies, melee works perfectly fine.
    https://i.gyazo.com/5598ecf5bebe2c7503d6d338279c3ff1.png
    https://i.gyazo.com/2e6281b624b36b97464a3e2686d6a904.png
    https://i.gyazo.com/034f97ea60b81c94a1d35c0766c3fdd7.png

    Tags / layers appear to be setup properly, since it does work for ground enemies using the exact same values.
    https://i.gyazo.com/57b877d9fa2e6096bbd1c72669e76e90.png
    https://i.gyazo.com/c7f4ab1a03a45e7f926670f4ce14e7b9.png
     
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Currently, you can use the built-in Emote animation feature if you just want to play a single animation at a time. If you want more sophisticated scenarios you could take a look at LifeLink, which is a series of AI extensions for EmeraldAI that I'm currently developing. I have added Animation Sequences allowing you to play a series of animation clips. It also has a lot of other features and more to come.

    https://discord.gg/zchnE5b
     
  49. verteom

    verteom

    Joined:
    Oct 26, 2018
    Posts:
    48
    It sounds cool~ Animation Sequences will the better way than what I did , Now,I need to write some code to stop,like this:
    Animator.SetBool("Turn Right", false);
    Animator.SetBool("Turn Left", false);
    Animator.ResetTrigger("Hit");
    Animator.SetBool("Idle Active", false);
    Animator.SetFloat("Speed", 0);
    and trigger what I want specail hit animation
     
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    LifeLink has a Stop and Resume function as well. ;)
     
    verteom likes this.