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

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    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.
  2. Raul_T

    Raul_T

    Joined:
    Jan 10, 2015
    Posts:
    363
    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 :)
     
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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.
     
    SickaGames1 likes this.
  4. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    Please add this to the 2.5 roadmap
     
    dsilverthorn likes this.
  5. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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
     
  6. Raul_T

    Raul_T

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

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    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?
     
  8. Raul_T

    Raul_T

    Joined:
    Jan 10, 2015
    Posts:
    363

    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.
     
  9. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    143
    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
     
  10. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    143
    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
     
  11. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Getting the same errors. :(
     
  12. Kojote

    Kojote

    Joined:
    May 6, 2017
    Posts:
    183
  13. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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.
     
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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?
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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.
     
  16. warren-miller-maltd

    warren-miller-maltd

    Joined:
    Jul 26, 2012
    Posts:
    53
    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...
     
  17. Raul_T

    Raul_T

    Joined:
    Jan 10, 2015
    Posts:
    363
    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.
     
  18. p_hergott

    p_hergott

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

    monte_carlo

    Joined:
    Mar 26, 2015
    Posts:
    19
    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
     
  20. monte_carlo

    monte_carlo

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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.
     
  22. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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_T and SickaGames1 like this.
  24. Raul_T

    Raul_T

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

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

    SeymourGutz

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

    BHS

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

    BHS

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

    alex_1302

    Joined:
    Aug 20, 2019
    Posts:
    54
    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.
     
  29. FrostedBrain

    FrostedBrain

    Joined:
    Sep 26, 2019
    Posts:
    31
    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?
     
  30. ArthurHoeke

    ArthurHoeke

    Joined:
    Nov 27, 2014
    Posts:
    12
    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
  31. PeppersGamer

    PeppersGamer

    Joined:
    Jan 18, 2018
    Posts:
    17
    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
     
    SickaGames1 likes this.
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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.
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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(); });
     
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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?
     
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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.
  36. PeppersGamer

    PeppersGamer

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


     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Great to hear, you're welcome!
     
  38. 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?
     
  39. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    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.
     
  40. Avedis

    Avedis

    Joined:
    Jan 12, 2013
    Posts:
    24
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    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.
     
  42. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    @BHS 2.4 coming out next week?
     
  43. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    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.
  44. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    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.
  45. magique

    magique

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

    Attached Files:

    dsilverthorn likes this.
  46. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    @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).
     
  47. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    OK, I understand. I'll have to take a look and see what additional code needs to be added to insure that the combat text is working. I don't know when I can take a look though.
     
    Pandur1982 likes this.
  48. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    @magique Big Thx for your looking and work on that.
     
  49. AaronVictoria

    AaronVictoria

    Joined:
    Aug 21, 2010
    Posts:
    176
    @BHS here is another suggestion for you, add a buffer zone between the player and the AI entity to allow for walk-back and run-back states. I've hacked this into my project, and even included a few variables for randomness and inaccuracy to ensure that the NPC isn't so aggressive with buffer zone reaction that melee users aren't able to engage them. This allows a melee user to maintain a bit of combat damage before the AI entity is able to run backwards. For some projects, simply walking backwards isn't enough to keep weaker ranged targets from being quickly dispatched by strong melee damage.
     
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @Pandur1982 OK, so I'm trying to reproduce your issue, but I need more information. You said the following:

    "When i attack with the Playmaker Action, i see no CombatText from my Player i see only the CombatText from the Enemy"

    What Playmaker action are you using to attack with?

    [EDIT]
    I assume you mean the DamageAI action. I have tried it and see what you mean. I will look for a solution.
     
    Last edited: Feb 23, 2020