Search Unity

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

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

  1. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    The min and max attack speed settings control how quickly an AI attacks. These can be found under AI's Settings>Combat>Damage Settings.
     
  2. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    940
    When is the next update due out?
     
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Hey there.

    I don't have a solid ETA for version 2.4, but it should be submitted no later than the end of February.

    1) I will be addressing the attack distance cap with version 2.4 and lowering it to 0.1. You can fix this manually by opening the EmeraldAIEditor script and adjusting the line below. 1.5f is the minimum allowed attack distance.
    Code (CSharp):
    1. CustomEditorProperties.CustomFloatSlider(new Rect(), new GUIContent(), AttackDistanceProp, "Attack Distance", 1.5f, 200);
    2) I've always assumed AI wouldn't travel to the end of a level's NavMesh so there's no code in place to handle this, but I will ensure this is fixed with version 2.4. If you need a fix before the release of 2.4, just let me know.

    3) This looks like your AI's Turn Speed is not high enough. Try a value of 2000 to see if it resolves the problem. This setting can be found under AI's Settings>Movement>Turn Settings.
     
  4. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    It should be submitted no later than the end of February. There's a lot of under the hood/bug fixes I'm doing with the 2.4 as well as the new features.
     
  5. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    940
    I remember you were going to implement different animation abilities such as sitting down, sleeping ect... When is that going to come out?
     
    dsilverthorn likes this.
  6. Raul_MadGoat

    Raul_MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    262
    Thanks for the reply, those are some great insights! We will wait for 2.4 then since the release its not that far away.

    Also I will check out the suggested fixes tomorrow when I'm back at my workstation. As for the end of navmesh attack issue, if the fix is gonna make it into 2.4 there is no rush with it :)
     
  7. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Yes, I looked into this and it will have to wait until the 2.5 update. It ended up being more involved than I originally thought.
     
    SickaGamer likes this.
  8. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    940
    Please add this to the 2.5 roadmap
     
    dsilverthorn likes this.
  9. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Hey everyone,

    Users have suggested more documentation and tutorials on using Emerald AI. The Emerald AI documentation was sufficient using the Google Docs, but it ended up being too limiting with the amount of information needed to document all of Emerald AI. So, I've been working on an Emerald AI Wiki through GitHub which has allowed me to provide much more detailed documentation, guides, and tutorial for Emerald AI.

    This is still a work in progress and it uses Emerald AI version 2.4 so a few things may not yet be available. However, it still has tons of useful information and tutorials for those who are interested. Feedback and suggestions for more content this would be appreciated. Note: The Emerald AI Wiki will be replacing the Emerald AI Google Doc with the release of version 2.4.

    Emerald AI Wiki

    For users who need a detailed guide on setting up an AI from start to finish, see the this Emerald AI Wiki page:
    Emerald AI - Creating an AI
     
  10. Raul_MadGoat

    Raul_MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    262
    New wiki looks great! Way easier to navigate than the docs in my opinion :)
     
  11. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    251
    Hi, I'm still having an issue with the AI sometimes not disabling objects when it dies. I am not using an animation event, but a Unity event on the AI; "DisableAllItems" in the AIs Death Event section.

    I have two events here: Disable Final IK (this works without issue) and the Disable All Items, which sometimes does not fire. Are animation events more reliable for this?
     
  12. Raul_MadGoat

    Raul_MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    262

    Hello, got some time to look over the fixes you provided!

    Still can't seem to get around issue 3). Tried with turn speed value, although it was already set at 2000 by default, tried to go even higher. Also played more with other detection settings with no luck.

    At this point I'm not really sure what causes it. It seems to always happen if the player gets detected when the AI is walking to its next location with dynamic wander. AI will start to run to that location while playing the alert animation. If the AI is idling and while it detects the player, it seems to work normally.

    Getting detected when AI idling - https://drive.google.com/open?id=1f95rLMu1xVJpobKtbCnVtzFPh-whleoA
    Getting detected when AI wander - https://drive.google.com/open?id=18kvfO9Mp83uEBNJtUZnmGvSIeoslruS5

    I've also created a test project where the issue can be reproduced. I will send it over private message shortly, maybe it helps.

    Thanks.
     
  13. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    126
    Hi!
    I am currently having some issue with the ragdoll after the Ai dies. I notice that for a brief moment the Ai go back to t pose and then falls. Is it normal? If not, how can be fixed?
    Thanks!

    Dom
     
  14. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    126
    Another question if I can!
    I noticed that the AI's Health bar is shown based on detection distance. It's possible to hide if the AI is behind a wall or an obstacle that prevents the player to see the AI?
    Thanks again,

    Dome
     
  15. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    414
    Getting the same errors. :(
     
  16. Kojote

    Kojote

    Joined:
    May 6, 2017
    Posts:
    40
  17. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Hey there. Are your objects that you'd like to disable added to the AI's Item list? This is located under AI's Settings>Items.
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Hey there. Is your AI using the Root Motion or NavMesh Driven movement type? If your AI has root motion animations, it must use the Root Motion movement type setting. This is located under AI's Settings>Movement. As for the idle wandering issue, I've never seen this before and cannot seem to recreate it, but I will keep trying to figure out what might be causing it. Have you checked to ensure there are no idle animations in any of the movement animation slots?
     
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    That's not normal. Try setting the AI's Animator's Update Mode to Animate Physics to see if it helps.


    Emerald AI has its own shader for UI to draw it through objects. Switching the Emerald AI UI material to the UI>Default shader will fix this.
     
  20. warren-miller-maltd

    warren-miller-maltd

    Joined:
    Jul 26, 2012
    Posts:
    41
    Hi sorry if this has been answered before, I did search but couldn't find anything:
    Can you use Emerald AI if the main character is an Animal (eg: bear?) or do they need to be human?
    thx in advance...
     
  21. Raul_MadGoat

    Raul_MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    262
    Thanks for the reply. There is no issue with motion, I just thought it's related to the wandering alert issue. By the way I have sent you a sample project over private message where the issue can be reproduced, if you want to take a look over it, maybe you can find something out.
     
  22. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    326
    Emerald look for tags, you could use a pickle as your main player if you wanted.
     
  23. monte_carlo

    monte_carlo

    Joined:
    Mar 26, 2015
    Posts:
    17
    Hi apologies if this has already been answered, I searched and found similar references but no fix as it were.. My AI is using waypoints, detects the target without issues, runs straight at the target, collides with the target (unintentional) and then runs in circles around the target indefinitely.
    Any ideas what I might have done, I have changed detection settings, distances, stop distances but nothing seems to change the outcome ?
    Thanks
    M
     
  24. monte_carlo

    monte_carlo

    Joined:
    Mar 26, 2015
    Posts:
    17
    fixed it myself.. got the distances in a muddle, detect, line of sight etc. working now. Cheers
     
    dsilverthorn likes this.
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Yes, Emerald AI can be used for both humans and animals. You can see an example of a four-legged AI on the product page of Emerald AI and its shoot AI demo.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Thanks, I'll take a look right now.
     
  27. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Alright, I've figured out the problem and I have a fix for you.

    Within the EmeraldAISystem script, find this:
    Code (CSharp):
    1. else if (AIAgentActive && CombatStateRef == CombatState.NotActive && !DeathDelayActive)
    2. {
    3.    if (BehaviorRef == CurrentBehavior.Companion || BehaviorRef == CurrentBehavior.Pet)
    4.    {
    5.       if (CurrentFollowTarget != null)
    6.       {
    7.          FollowCompanionTarget();
    8.       }
    9.       else
    10.       {
    11.          Wander();
    12.       }
    13.    }
    14. }
    Then add this underneath it:
    Code (CSharp):
    1. else
    2. {
    3.     if (m_NavMeshAgent.hasPath && BehaviorRef == CurrentBehavior.Cautious && ConfidenceRef > 0)
    4.     {
    5.        m_NavMeshAgent.ResetPath();
    6.     }
    7. }
    It resets the AI's destination before starting the warning process. What was happening was the AI was trying to reach the wander destination while it was trying to handle the warning process.
     
    Raul_MadGoat and SickaGamer like this.
  28. Raul_MadGoat

    Raul_MadGoat

    Joined:
    Jan 10, 2015
    Posts:
    262
    That fixed it! :)

    Thank you very much for the great support!
     
  29. SeymourGutz

    SeymourGutz

    Joined:
    Aug 9, 2019
    Posts:
    7
    Is it possible to have temperament affected by faction? For example, a villager would fight a bandit, but flee from a dragon.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Great to hear and you're welcome!
     
  31. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Not currently, but it's great idea for the faction system. I'll look into this for one of the upcoming updates.
     
  32. alex_1302

    alex_1302

    Joined:
    Aug 20, 2019
    Posts:
    11
    Hi. first of all congrats for emerald. i can see that is a great tool. i am thinking on buy it, and i was reading the documentation, but i have only a little question. in the game that i am developing i will have some characters that will need make jumps using offmesh links. this jumps will have three animations states: 'jump start', 'in air jump' and 'jump finish' used when the characters start jumping, when is in the air, and when is near the floor respectivelly. my question is: can Emerald handle this jumps ? maybe automatically ? or will i need to make my own script to handle this offmesh links jumps? if so how ? will i need to disable Emerald when my own script make the offmesh link jump?. i hope find some solution because Emerald seems to be a very powerful tool and i like to integrate it in my project. Thanks in advance.
     
  33. FrostedBrain

    FrostedBrain

    Joined:
    Sep 26, 2019
    Posts:
    18
    Can I trigger events on specific waypoints? Like at a specific waypoint could I get my AI to play an anim and enable/disable objects when they leave that point?
     
  34. ArthurHoeke

    ArthurHoeke

    Joined:
    Nov 27, 2014
    Posts:
    1
    Hey, just bought the asset but I'm having some issues with AI movement. I setup the navmesh, but for some reason the AI only moves when I've selected it in the editor.. when I have selected a different gameobject or nothing it simply stands stationary whilst playing the walking animation. Also, when I do have it selected it tends to get stuck in objects like little rocks every meter or so. This happends when I use root motion, if I use the navmeshdriver this is the result: https://i.gyazo.com/731e2abe9a429e3554ed153cc262e5cb.mp4
     
    Last edited: Feb 12, 2020
  35. PeppersGamer

    PeppersGamer

    Joined:
    Jan 18, 2018
    Posts:
    16
    I am having a hard time figuring out how to have my Invector vMeleeManager script, access the combat text system. upload_2020-2-12_11-32-47.png
    I though it would need to go in the area where we posted the emerald Emerald AI Damage section in the Invector integration video. Has anyone got this to work? Sorry my coding skills are not great.

    upload_2020-2-12_11-35-34.png
     
    SickaGamer likes this.
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Hey there!

    Emerald AI does not currently support jumping or offmesh link jumps, however, it is something I would like to add with a future update. I haven't had the chance to look at how it can be done, but I do know it's possible as other users have done so. You would have to add your own animation states to the Emerald AI generated animator controller.
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    There's no current API to do this with waypoints. You can do this with the Destination wander type which triggers the Reached Destination Event when the AI arrives to the set destination. You can then use the following to play an emote animation.
    Code (CSharp):
    1. EmeraldComponent.EmeraldEventsManagerComponent.PlayEmoteAnimation(EmoteID);
    After the AI has played their animation, you can then generate the next destination and repeat this process.
    Code (CSharp):
    1. EmeraldComponent.EmeraldEventsManagerComponent.SetDestinationPosition(Vector3 DestinationPosition);
    A Reached Destination Event can be added programmatically with:
    Code (CSharp):
    1. EmeraldComponent.ReachedDestinationEvent.AddListener(() => { YourCustomFunction(); });
     
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Strange, there's no reason why it should be functioning like that. Are you receiving any errors and are the included example scenes working correctly?
     
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    You just need add the Invector parameters like this (Untested, but should work):
    Code (CSharp):
    1. if (hitInfo.targetCollider.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>())
    2. {            
    3.    hitInfo.targetCollider.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>().Damage(hitInfo.attackObject.damage.damageValue, EmeraldAI.EmeraldAISystem.TargetType.Player, transform, 400);
    4.  
    5.    //Add this:
    6.    CombatTextSystem.Instance.CreateCombatText(hitInfo.attackObject.damage.damageValue, hitInfo.targetCollider.transform.position, false, false, false);
    7. }
     
    PeppersGamer likes this.
  40. PeppersGamer

    PeppersGamer

    Joined:
    Jan 18, 2018
    Posts:
    16
    Works perfectly, Thanks so much!


     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    Great to hear, you're welcome!
     
  42. BLINDRane

    BLINDRane

    Joined:
    May 7, 2017
    Posts:
    3
    Hey there, I am experiencing an issue where ranged AI always shoots to the same spot, regardless of the player offset y position. It is a short enemy, and so it always shoots the player in the knees. I tried sizing it up, and it still aims for the knees. How can I fix this?
     
  43. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    251
    Still having the issue with the items not disabling on death. There is one thing to note though: My console keeps getting warnings from Emerald about animations not being applied - even though they are, and are even being used. For example it says the AI does not have a run animation, though it it definitely does, and is even using that run animation right now, both combat run and normal run.

    I created a new Animator Controller too, as per the upgrade instructions. I'm not sure why these items are not being disabled though.
     
  44. Avedis

    Avedis

    Joined:
    Jan 12, 2013
    Posts:
    8
  45. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,166
    I'm working on improving this with version 2.4, but for now, you can use a "dummy object" that acts as your player. This will be attached as a child to your actual character controller so the projectiles hit this object instead of your player's actual transform. The character controller will no longer have the player tag and player layer. Instead, this tag and layer will be set on the dummy object.
     
  46. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    940
    @BHS 2.4 coming out next week?
     
  47. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    251
    At First , Big Thx to You @magique, that Function Packet save me a lot of time, i have a question , will you update that Package so for the moment, it works very well but i see not the combat text when my player attack, only from the ai and a other question can you write on the Function Damage AI the Damage Amount as a selectabel Variabel so i we can use a global Variabel on that field for more control over that (like Player switch the Weapon for other damage count).
     
    Last edited: Feb 22, 2020
    dsilverthorn likes this.
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,782
    Thanks for giving it a try. I will definitely update some more.

    I'm not sure what you mean by your first request. As far as the second one, I can definitely add the variable capability. I will post an update soon.
     
    dsilverthorn likes this.
  49. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,782
    @Pandur1982 Here is an updated package with the variable damage value in the DamageAI action.
     

    Attached Files:

    dsilverthorn likes this.
  50. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    251
    @magique Big thx for the update that works great for me.I mean in my first request the DamageText in the EmeraldAI Scene Folder the playable Demo Scene, that is a Top Down style with MIkeMoose as Player Character.When MikeMoose attack a Enemy i see a CombatText (with Number) over the Head from the Enemy spawn. When i attack with the Playmaker Action, i see no CombatText from my Player i see only the CombatText from the Enemy (The damage what my charackter take from the enemy like the -1 or - 5 and so one).
     
unityunity