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

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    230
    @BHS,

    1. Is there a way to wonder around my 'set location' within an X radius?

    2. Why is the chase distance minimum of 24?
    I'd rather be able to chase only say a distance of 5 outside my 'set' location so it does not go too far from the wonder/waypoint location.

    3. Is there a way to randomly walk the waypoints? If not will you please implement that with your update...

    4. When the NPC walks/runs up to the player, I wan't an instant attack, takes too long to attack the player by the time he is out of reach again.
    I do have min/max attack speed set to 0.
    Also 0 attack delay and run attack delay.

    Attack should be more instant no?

    Thank you
     
    SickaGamer likes this.
  2. erichey

    erichey

    Joined:
    May 5, 2017
    Posts:
    20
    Any update on a tickbox for ragdoll death?
     
  3. joeyether40

    joeyether40

    Joined:
    Jan 26, 2018
    Posts:
    18
    I just started using Emerald AI. I am making a game using GKC controller where you need to run over animals with your vehicle to create roadkill for a café. I want to be able to apply damage and or kill that animal by running into them either with my vehicle or any of my traffic vehicles. The AI works great to have them wander around and I can shoot them but I can not figure out how to hurt them with a vehicle. My vehicle will receive damage when I hit them, which I want, but just not deliver it. Any ideas?
     
  4. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    181
    Hi,I have two questions:

    1.Can I direct the pet to the designated location?
    2.Any news about UCC integration?
     
  5. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    309
    Do you know the dungeon architect? I would like to use Emerald AI in Dungeon Architects. But it is not good. Can you provide integration or advice for a dungeon architect?
     
  6. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    Dungeon Architect lets you easily build your dungeon environments. It really has nothing to do with AI and Emerald should work just fine with it. Once you've built your dungeon just make sure to build your nav mesh and all should work perfectly.
     
  7. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,090
    1) In order to do this, you need to set the StartingPosition variable to the location you would like your AI to wander around. However, this variable is private so it needs to be set to public so it can be controlled. This will be fixed with version 2.2.
    2) The mimimum chase distance is based off of your AI's detection radius. This is because the detection radius is based off of a trigger collision and not actual distance. What I can look into is just making this based on actual distance so there is more control.
    3) Not currently, but it's already been added with version 2.2.
    4) Interesting, the AI should attack quickly if those settings are set to 0. I will look into this.


    Yes, ragdoll death will be added with version 2.2. I have been testing this quite a bit and it allows AI to seamlessly transition to ragdoll from their current animation. It also allows for more functionality such as AI being hit by dynamic objects such as arrows, rocks, traps, etc while using the direction of the collision to determine the ragdoll force's position. I will be demonstrating this with my status update that I plan on posting some time today.


    You would just call Emerald AI's Damage function in an OnCollisionEnter function. I will be adding ragdoll functionality with the 2.2 update that will add for some really cool added mechanics.

    Code (CSharp):
    1. C.gameObject.GetComponent<Emerald_AI>().Damage((int)DamageAmount, Emerald_AI.TargetType.Player);

    1) Yes, you should be able to do this by calling the SetFollowerPet(Transform FollowerTarget) function and setting your location to the FollowerTarget transform. When you'd like your pet to return, you would just call the same function but set your player as the FollowerTarget.
    2) Yes, I have a copy of UCC and I'm trying to find the time to make an integration tutorial.


    What isn't very good about it? You would just need to bake dynamic NavMesh after the level has been created. Dynamic NavMesh is even listed as one of its features. I can speak with the developer to see if I can get a copy to better support it when I get the chance.
     
    Last edited: Oct 1, 2018
    Duffer123 and RonnyDance like this.
  8. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    878
    We need @BHS to get 2.2 out!
     
    Duffer123 likes this.
  9. DanBanner

    DanBanner

    Joined:
    Dec 11, 2015
    Posts:
    29
    I added it to the following function within Emerald_AI.cs and added a Debug.Log to show that it is firing, and it is, but the AI still wanders to the wrong place instead of going to the correct destination.

    Code (CSharp):
    1. public void SetDestination (Transform AIDestination){
    2.         if (CurrentTarget == null && CurrentHealth > 0){
    3.             Debug.Log("SET DESTINATION");
    4.             AIAgent.ResetPath();
    5.             AIReachedDestination = false;
    6.             WanderTypeRef = WanderType.Destination;
    7.             SingleDestination = AIDestination.position;
    8.             AIAgent.destination = AIDestination.position;
    9.             AIAgent.CalculatePath(AIDestination.position, AIPath);
    10.             DestinationUpdated = false;
    11.         }
    12.     }
     
  10. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    878
    With regards to 4, he is talking about whenever the AI hits someone, it takes a slight jog around the Player and then hits him again. I like it when the AI goes Leroy Jenkins stands in one spot and keeps hitting. It can flee at a certain health point, but it shouldn't run around to much.
     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,090
    I agree! Moot Motion support is difficult to implement because there are so many factors with each AI and its animations. I'm trying to keep things are versatile and flexible as possible. I am having to rewrite the way animations are applied because Animator Controllers now use blend trees. This new method allows the Emerald AI editor or Setup Manager to create a new Animator Controller, apply the animations, and other settings all directly to the blend trees and states.


    While working on version 2.2, I think I may have found where this issue is coming from. If you need a fix for it before 2.2 is release, I can try to put a guide together to help resolve it.


    @zKici

    Okay, this can be disabled by setting Dynamic Movement to "No". This is located under AI's Settings>Combat>Combat Actions & Effects Settings.
     
  12. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    Nice to know. That one bothered me as well.
     
  13. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    198
    Am I special or is there not a gravity system along with this? Or am I missing something??
     
  14. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    878
    If your guys are floating away then you are doing something wrong.
     
  15. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    198
    There not necessarily floating away but theirs some sick hills and I wish I could go through them in real life.
     
  16. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    This make absolutely no sense whatsoever.
     
    llJIMBOBll and Deckard_89 like this.
  17. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    198
    I have hills on my terrain and the AI is going through the terrain instead of up the hill of the terrain.
     
  18. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    Did you bake the nav mesh?
     
  19. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    198
    Why I thought that was dynamic beats me that was the issue lol. Thanks!
     
  20. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    No problem. Glad to help.
     
  21. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    878

    Advanced Boss fights?
     
  22. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Well as I understood this will come pretty soon with the new Event and modular based attack system. I doubt it that everything will come with 2.2 which is fine if the updates come on regulary basis. They are so many features and changes planed for 2.2 that it will be a pretty big update.

    In my opinion BHS is doing the right thing and he really should take advantage of the current situation now that ICE is deprecated. His AI is the only one which is pretty easy and good in the Assetstore and could become the most powerfull and easiest to work with as long it gets the needed features and updates.

    I just hope BHS considers to go the " Share Template Mob / Boss Script" AI way to let create the community Bosses / Generic Mobs AI through template / scripts so you can share them. A feature like this is really missing. This has the big advantage that you will have good AI Creatures and Bosses in no time and everyone can learn and commit their creations to make Emerald AI the best AI out there. A Discord channel would be a good idea for this blueprint way also.

    Cheers
    Ronny
     
    Last edited: Oct 3, 2018
    SickaGamer and Weblox like this.
  23. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    230
    "Okay, this can be disabled by setting Dynamic Movement to "No". This is located under AI's Settings>Combat>Combat Actions & Effects Settings."

    Even with that, the NPC runs/walks up to the player stops, it seems like it transitions to idle/combat animation and then attacks. (TBH I didn't really see much difference... and one of the NPC had that off the other on...)

    I want it to attack the moment it reaches the destination... slight delays look awful.


    Looking forward to this -> 1) In order to do this, you need to set the StartingPosition variable to the location you would like your AI to wander around. However, this variable is private so it needs to be set to public so it can be controlled. This will be fixed with version 2.2.
    Great -> 2) The mimimum chase distance is based off of your AI's detection radius. This is because the detection radius is based off of a trigger collision and not actual distance. What I can look into is just making this based on actual distance so there is more control.
    Beautiful -> 3) Not currently, but it's already been added with version 2.2.
    Improve further more please... 4) Interesting, the AI should attack quickly if those settings are set to 0. I will look into this.
     
  24. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    878
    Totally agree with this. @BHS could make a killing on his AI if he were to be a replacement for ICE. But like you said, he has a few more features to add before that happens.
     
  25. PlainStudios

    PlainStudios

    Joined:
    Sep 9, 2013
    Posts:
    18
    I'm having an issue with the AI damage to UFPS . I added the lines of code which would cause the AI to damage UFPS characters and it worked . It doesn't work anymore tho and I don't know what the issue is because there is no error and I did nothing to my character to change it .
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,090
    Boss fights will be a lot more customizable once the Modular Abilities/Attacks are implemented, but this won't happen until version 2.3. Right now, my focus is getting Root Motion support implemented, which is coming along nicely.


    I totally agree. I am actively working on improving Emerald AI. The 2.2 update will bring quite a few improvements. This update's main focus is improving animations. Because version 2.2 will be using blend trees, AI's animations are now much smoother and offer a lot more animations. I've also added the ability for an AI to have independent Non-Combat Idle and Combat Idle animation blend trees. This allows AI to have a set of animations for Idle, Turn Left, Turn Right, Walk, Walk Left, Walk Right, Run, Run Left, Run Right, and Get Hit for both Combat and Non-Combat. I've also added the ability for AI to have draw weapon and put weapon away animations. However, these can be bypassed if users don't have the needed animations.

    The 2.3 update will focus on herds and breeding support as well as the modular abilities feature. I felt like redoing the Animator Controller and adding Root Motion support was important because it directly affects the overall quality of Emerald AI.

    Templates are something I would will consider. One easy solution could be to have scriptable objects or "profiles" that could store all of an AI's settings. This would allow users to share their settings, or even abilities, with others by simply importing profiles to the Emerald AI or upcoming modular abilities system.


    Try setting your AI's Min and Max Chase Time to 0 to see if this helps the AI react faster.


    What specifically isn't working? Is your AI able to target your UFPS player or is it completely ignoring it?

    Have you made sure that the UFPS player has the Has Collision Trigger set to false? This can block an AI's raycast which would make your AI see the UFPS player as obstructed.

    Are you following the most up to date tutorial from here: https://docs.google.com/document/d/...uHce2BVLM3QTq5axg/edit#heading=h.g90cyocltt35
     
  27. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    878
    Do you have ETA on your upcoming updates for timelines?
     
  28. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    I agree. No root motion and the 3 animations limit right now is not so great (I know that you will have a limit anyway). Also being able to define random animations on idle like talk, look around etc. will improve the quality greatly. Same for defining random animation on waypoint reach. But I posted that before ;)
    Important is only that Emerald AI will be kept easy. If it's too complicated to create creatures because of this animations, that controller etc. users will be frustrated. Just drag and dropping the animations like in the current version was really easy and great, but well right now limited.

    Amen! As long as you will also be able to define something like "Cast spell XXX on 50% health", "Enrage on <20% health and do double dmg" etc. going with profiles would also fit the template idea. Really good idea.

    Keep it up. The community can't wait to see what you are working on and have planned :)
     
  29. PlainStudios

    PlainStudios

    Joined:
    Sep 9, 2013
    Posts:
    18
  30. PixelPounder

    PixelPounder

    Joined:
    Feb 11, 2014
    Posts:
    52
    Any update on the integration between Emerald AI and Opsive's new Character Controller(s)?
     
    Duffer123 likes this.
  31. PlainStudios

    PlainStudios

    Joined:
    Sep 9, 2013
    Posts:
    18
    I got my issues fixed now , I just re-imported everything . I would however like to know if I can do AI drops or spawns on death .
     
  32. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    230
    Min max chase was set to 0, 1

    I tried with 0,0 and still there is that brief pause / stop when the NPC reaches its destination and transitions between likely idle before attacking?

    I just hope in your update this is also addressed and allow them to Instantly attack. Like for most NPCs it is critical to play death animation instantly rather than stopping for your last breath before falling down :) similarly most of my NPCs need to attack as soon as within range or ranged attack...


    It would be really nice if we see an update soon enough...
     
  33. vincent_lade

    vincent_lade

    Joined:
    Sep 17, 2017
    Posts:
    45
    Is there a way to simplify the AI?
    Some of my NPCs will walk the opposite direction of the Player, get stuck on furniture, or sometimes wonder in circles.
    Stationary, Agent Avoidance Quality is High, Use Dynamic Movement is Off, Agent Radius is Low, Behavior set to Aggressive, Chase Distance set very high. I'm basically just looking for an enemy that will just see and purse the Player without strange movements or stopping.
    Is there something I should inspect to get them to behave more predictably?
     
  34. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,090
    I plan on having 6 Idle animations that are randomized each time an AI reaches its waypoint. I also plan on redoing the way Emote and Hit animations are done because assigning animations during runtime can cause other AI's animations to glitch if they happen to be using the animation while it's being changed. I will most likely have a cap of 10 Emote animations, which should be more than enough. It will allow AI sharing Animator Controllers to independently use their animations without issues.

    I agree, making Emerald AI easy to use is very important. Users will still be able to apply animations from within the Emerald AI editor as they have done before. It will just assign animations to blend trees as well as other states.

    Yes, the ability system will be similar to what you've described. This, in combination with the root motion support, should really improve the overall quality of Emerald AI. I'm looking forward to showing off what I've been working on, but I'm still working on redoing the Animator Controller. I'll see if I can show off something soon. :)


    Great to hear.

    You can with an On Death Event. Just rewrite a little script that generates loot or spawns an item in a public function then call this public function with an On Death Event.


    If I remember correctly, the animations should be playing right when they are needed. The Animator Controller is being redone with version 2.2 so transitions will be a lot smoother and play when needed. If you need a solution now, you can try adjusting the Animator Controller's Transition Duration to be quicker to see if it allows quicker transitions between animations.

    Adding Root Motion support and redoing the Animator Controller is requiring some rewriting of the Emerald AI script. I do apologize it is taking longer than expected, but it will be worth the wait. This update should greatly improve the overall quality of Emerald AI.


    If your AI are getting stuck, this may be how your NavMesh was baked. If it's patchy, it can cause AI to act or move strangely. If you could please provide a screenshot of your NavMesh in your scene, it might help me better understand what's going on.
     
    RonnyDance likes this.
  35. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    878
    Are you starting on 2.3 right after 2.2 or are you starting on another one of your products?
     
  36. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    Last edited: Oct 10, 2018
  37. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    181
    Some of the creature's mesh sometimes enters the terrain.

    How can I optimize it?
     
  38. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    There are several things to consider with this issue.

    The first is the NavMeshAgent, which has an offset that can adjust for a character being too far above or below a terrain.

    The second is the NavMesh that has been baked. This is often lower resolution than the actual terrain and can cause the agent to be in the wrong position.

    The third is that these agents do not have any kind of Foot IK to align them with the surfaces they are on. You can use a product like FinalIK and its Grounder component to achieve better results with all feet aligning to the surfaces. Even for Quadruped.
     
    Mark_01 likes this.
  39. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    181
    Thanks man,you help me a lot.
     
    magique likes this.
  40. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    181
    When Emerald AI find player,it will walk to player forever and don't attack.

    What is this problem?
     
  41. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    Do you mean if the player continues to back up or even when the player is stationary?
     
  42. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    181
    I was wrong. The creature pushed the Player to a certain position and started attacking. Do you know why?
     
    Last edited: Oct 10, 2018
  43. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    878
    That is what i call the Emerald Ballroom dance.;)
     
    llJIMBOBll likes this.
  44. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    It's tricky to get it right, but you'll have to play with the settings to tell it how far from the player it can be to attack and not to get too close, etc. I don't have access to it right now to remember all the parameters, but look at all the AI tabs for the different possibilities.
     
  45. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    181
    I solved it, this problem is because the creature size is too large, need to increase Attack Distance and Too Close Distance.
     
    magique likes this.
  46. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    181
    Can I let emerald ai chase the player after hearing the sound?
     
  47. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    Not currently, no.
     
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,736
    @BHS I thought this was just a fluke, but when I set up an AI, the animations never get set on the Animator Controller. I just set up a companion AI with all his animations, but when I inspect the Animator, all the animations simply point to some default ones in Emerald AI 2.0/Resources/Animations. When I look at the AI in the Inspector under the Animations tab it says that the Animator Controller is up to date. I'm using Unity 5.6.4p3. I tried clicking Update Animator Controller, but it has no effect.

    Also, instead of following my Player, my Companion starts off really slowly, picks up speed, and eventually runs as fast as possible to the 0,0 point on the map. What's going on?

    [EDIT]
    I see in the Inspector that it says the Companion AI will wander until it's follow target is set. And that this is best done with a script and calling SetTarget. So, I wrote a script and call SetTarget to the player, but then the Companion starts attacking my player. Even though I have Never attack player set. So, I don't think SetTarget was correct. So I changed this to SetFollowerCompanion, but then the companion just behaves as before and runs off to the center of the map.

    [EDIT2]
    OK, so suddenly it's working now when I do SetFollowerCompanion. Not sure why. But still having the other issue with animations not being set in the controller.

    [EDIT3]
    Regarding the animations, now I'm not so sure. I remember now that when I had used SetTarget and it was attacking my player that it was definitely using an attack animation from the character. But when I looked at the assigned animations in the controller, they were from the Emerald AI 2.0/Resources/Animations folder. So, not sure how that's possible. I'll dig deeper tonight.

    [EDIT4]
    OK, so I see now that the system uses override controllers so when looking at the Animator tree it shows the original animations and only the override controller shows the actual animations. That's very confusing. I didn't even know about override controllers.
     
    Last edited: Oct 12, 2018
  49. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    181
    1.It won't run to me when I hit Emerald AI unless I am close to it and hit.
    2.Can I not disable the Emerald AI's Collider when it dies?
     
  50. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    105
    is this AI provide cover system for range attack !!??!!
     
unityunity