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

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    I made the enemy attack me by setting the player on navmesh layer too !

    Still, I dont see any damage on my character.
    What is the setup I should do ? Can you send some small guidelines please ?
     
    Last edited: Aug 2, 2018
  2. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Could you do a tutorial of Crux with Emerald AI? I have AI's created and they are not getting spawned at all. When is the next version of Emerald and Crux coming out? Can you also please state all of the next enhancements in each? Thanks!
     
    Last edited: Aug 2, 2018
  3. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @BHS Thnx a lot for the advice. I will try and play around with it a bit more. Maybe you can go into a little more detail about which scripts to deactivate?

    In the MagicFX Package, I suppose, I would deactivate the RFX1_Target script on the Effects ParentGO and also the RFX1_TransformMotion script on the Collision GO. Also I find some more scripts directly attached to the ParticleSystem Child Objects, that I am not sure about.

    The RealisticFX4 Package also has Scripts like RFX4_DeactivateByTime on the FX parent GO. Should this be deactivated too?

    I am looking forward to your Tuto, as i really want to use Kriptos awesome FX in my demo game.
     
    Last edited: Aug 2, 2018
  4. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    regarding integration with AC:
    - in order to have the player damaging enemies and receiving damage, do I need to have the emeralController running on my player ?
    - if yes, can anyone guide me how to achieve that ?
    I suppose my char should bet set to custom and manual in AC and try a similar integration as they show on their page: https://adventurecreator.org/tutorials/adding-custom-motion-controller

    I tried based on the above, the bellow code attached to the player + emerald AI controller enabled, but nothing happens. I do not know if I chose the correct :

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine.UI;
    5. using UnityEngine.AI;
    6. using UnityEngine.Events;
    7. using AC;
    8.  
    9. public class CustomControllerLink : MonoBehaviour
    10. {
    11.    
    12.     private Emerald_AI emeraldCharacter;
    13.     private Char acCharacter;
    14.  
    15.     private void Start ()
    16.     {
    17.         emeraldCharacter = GetComponent <Emerald_AI>();
    18.         acCharacter = GetComponent <Char>();
    19.     }
    20.    
    21.     private void Update ()
    22.     {
    23.         //        emeraldCharacter.SingleDestination = acCharacter.GetTargetPosition (true);
    24.         emeraldCharacter.AIAgent.destination = acCharacter.GetTargetPosition (true);
    25.     }
    26.    
    27. }
    or last part, because i use DIRECT, to be reversed of their example:

    private void Update ()
    {
    if (KickStarter.stateHandler.IsInGameplay () || acCharacter.IsPlayer || !acCharacter.IsMovingAlongPath () || KickStarter.settingsManager.movementMethod == MovementMethod.Direct)
    {

    // emeraldCharacter.SingleDestination = acCharacter.GetTargetPosition (true);
    emeraldCharacter.AIAgent.destination = acCharacter.GetTargetPosition (true);
    //emeraldCharacter.TargetDirection
    }
    ......
     
  5. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    With the update don't forget its important to know which animations is dealing the damage as each may have its own category of to-do things,

    In meantime I've done this: (utilizing your playerhealth script)

    public void DamagePlayer (float damageTaken, int WhichAttack){
    Debug.Log("We are getting HIT! By attack# " + WhichAttack + " & this much damage: " + damageTaken);


    It was for testing purposes but helped me do what I wanted per animation attack
     
  6. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @BHS , what's in the development pipeline for this great asset?
     
    Razmot likes this.
  7. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    @BHS : I think the integration with AC should be easier to make tutorial for compared to other controllers you presented. It will also do Emerald AI a great good to do the integration for AC and for few other known and 5 star engines. You can help this way a lot more people and also have more sales ;)
    I think the character Controller can be skipped in this case and only focus on the damaging parts and maybe few otehr features that needs to be bridged if they do not work out of the box.
    Thank you anyway for your asset: I like it very much. I am also glancing of your spawner but I allready have one so it is hard to make the step without testing it :p
     
    BHS likes this.
  8. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    47
    I use RFPS. How can I make happen that when I shoot the animal, he escapes or attacks.
     
  9. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    @BHS I tried putting a debug in the PlayerHealtscript.cs to show if the function is called but it is not. I commented the 2nd parameter and still does not work.
    What must I change in order to see the floating numbers above my player when I am getting hit ? I tested with 2 skeletons hitting eachother and the UI setup for both triggers. And if i hit the skeleton enemy with my player, it triggers too.
    Tried this and get nothing:
    Code (CSharp):
    1. public void DamagePlayer (float damageTaken/*, int WhichAttack*/){
    2.         if (!isDead){
    3.             currentHealth -= damageTaken;
    4.  
    5.             Debug.LogWarningFormat ("We are getting HIT! By attack# " /*+ WhichAttack + " & this much damage: " */+ damageTaken);
     
    Last edited: Aug 3, 2018
  10. Pool4Sky

    Pool4Sky

    Joined:
    Aug 31, 2014
    Posts:
    15
    Hello everybody

    I'm pretty new to Emerald AI. I got it that the enemy attacks me. However, if I move away from him, he remains in the attack animation and does not follow me to continue attacking me. Did you have that too? If so, how can I change it so that he will haunt me again if I go aside.

    Thx.
     
  11. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    @Pool4Sky >> you have to tell people what other assets you are using so anyone might be able to share some info with you (in my case didnt help much :) but at least I tried ...)
     
  12. Pool4Sky

    Pool4Sky

    Joined:
    Aug 31, 2014
    Posts:
    15
    @VP_3 that's not a problem. Thank you. But what do you want to know? I use so many assets in my project. Which information are the right ones and which ones are useless?
     
  13. VP_no1

    VP_no1

    Joined:
    May 12, 2018
    Posts:
    132
    the most important is: what assets you use that can combine with player/characters ? mostly ur controller ...
    also another one iss if u use a framework / engine ...
     
  14. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    Have you followed the integration tutorial for Emerald AI in the RFPS forum. If not, do that first, otherwise to make the AI attack when you shot, set 'AI Attacks Player' in the tag settings to OnlyIfAttacked. To make him flee set 'Health Level to Flee' in Temperament to the value you want him to flee.
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Yes, I will be improving the documentation and tutorials of Crux similar to what is done with Emerald AI on Google Docs. I will look into why AI are sometimes not spawning. It may be due to the new version of Unity. What version of Unity are you using?

    Emerald AI and Crux's updates are currently being worked on. Emerald AI's update will add Root Motion support, breeding, and herd functionality.

    The Crux update will add support for mesh terrains, however, I'm not entirely sure if getting the texture on mesh terrains will be possible because of performance limitations. The new Crux update will also add the ability to spawn based on certain tags/layers, which should help users who use mesh terrains. Lastly, it will also the ability to spawn base on certain weather types, time, and seasons when using UniStorm.


    RFX1_TransformMotion, RFX1_Target, and RFX4_DeactivateByTime all need to be disabled. Pretty much any script that is going to deactivate or manipulate the object in anyway. The scripts that fade out the particle effects' emissions are okay to have enabled.


    I will talk with the developer of Adventure Creator and see if I can make an integration tutorial like I've done with the other character controllers.

    It should be a very similar process to what's done with the other integration tutorials. You would add your player's custom damage function to the DamagePlayer function within Emerald AI. This covers all damage, even damage from projectiles.

    You also need to add Emerald AI's damage function to your custom player's weapon system: YourEmeraldAIReference.Damage(YourDamageAmount, Emerald_AI.TargetType.Player);

    Then you just need to make sure your tags and layers are all properly setup for your custom player as some character controllers use their own layers and tags.


    Thanks for the suggestion. It should be possible currently by using the variable CurrentDamageAmount from the AI that is attacking the player.

    This variable takes in account the current calculated damage for the current animation so detecting the animation itself should be needed.


    I'm currently working on the next version of Emerald AI, now that UniStorm 3.0 has been released. Emerald AI's next update will add Root Motion support, breeding, and herd functionality.


    My apologies, I'm not entirely sure I understand your question. Do you want the AI to flee or when shot by the RFPS weapons? This should happen automatically. If your animal is far away, you need to use the Line of Sight Detection Type and use Expanded Detection Distance. This will allow your AI's detection distance to be expanded when hit and properly react to targets from a distance.


    Does Adventure Creator have its own damage script? If not, you shouldn't have to use Emerald AI's damage player script as its just for the demo player.
     
    Weblox likes this.
  16. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    I am using the current latest version of Invector 3rd Person Controller 1.2.2 and when I go and use the handgun at an AI (shoot), I get the following exception. It will work fine if I am usually up close but if I am at a distance, I get this error message. I have a bear that is in the animal faction if that matters.

    NullReferenceException: Object reference not set to an instance of an object
    Emerald_AI.SearchForTarget () (at Assets/Emerald AI 2.0/Scripts/System/Emerald_AI.cs:3489)
    Emerald_AI.Damage (Int32 DamageAmount, TargetType TypeOfTarget) (at Assets/Emerald AI 2.0/Scripts/System/Emerald_AI.cs:2835)
    Invector.vShooter.vProjectileControl.Update () (at Assets/Invector-3rdPersonController/Shooter/Scripts/Weapon/vProjectileControl.cs:75)


    This is the line in the .cs file giving me the error:

    if (CurrentTarget.tag == EmeraldTag){
    ReceivedFaction = CurrentTarget.GetComponent<Emerald_AI>().CurrentFaction;
    }
     
  17. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    a friend alerted me to this crazy bug that we found...

    stellarreview.png

    xD
     
  18. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Awesome! Now all is working as expected. I will have some fun playing around with Emerald and Kriptos FX.
    Thanks a lot for all the help and keep up the good work. :cool:
     
    BHS and SickaGames1 like this.
  19. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    If you come up with a tutorial, I would be very interested in it as well. I am not as good as the scripting bit so any extra help would be great!
     
  20. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    After importing the KriptoFX Package into the Project make a duplicate (Cntrl+D) of Kriptos Prefab Folder. This way you can modify the Prefabs and let Emerald auto-add its scripts later, w/o changing the originals.

    I have only used the ProjectileFX in the Realistic Effects Pack 01 for the Emerald AI until now. These Effects are Effect01 up to Effect13. Go through each of the Effects, some have script RFX1_Target on the root object, that you need to disable. All Effects have another script RFX1_TransformMotion on the "Collision" child object, that you need to disable also. Just untick the checkbox on both scripts, you dont need to delete them. There are more scripts located on the actual ParticleSystems further down the Hierarchy, those should be good to leave active.

    Now you can assign the Effects Prefabs to your Emerald AI Agent. Set your AI to use ranged attacks and adjust the values. A particle speed between 5 and 10 seems to do a good job for me. Dont forget to hit the update Button in Emerald Editor. Also for each of Kriptos FX there is a corresponding Collision Effect (Effect1 / Effect1_Collision) that you can set to use in the Emerald Editor. You don't need to change anything in these Collision Effects, they will work as they are. ;)
     
    Last edited: Aug 9, 2018
    BHS likes this.
  21. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    It sounds like your CurrentTarget is null. Did you follow every step in the integration tutorial? Are you assigning the Emerald_AI.TargetType.Player as your TypeOfTarget? If not, this may be what's causing your issue.
     
  22. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Figured it out. How does i get an npc to respawn 5 minutes after death?
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Great to hear.

    YourEmeraldAIReference.ResetAI();
     
  24. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Not a coder. Have an example?
     
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Attached is a script that will reset an AI after it has been killed, but only once the respawn seconds have been met. For this example, I set it to 300 seconds, which is 5 minutes.

    To use it, simply attach it to the AI you would like to have respawn. Make sure you attach it to the same object that the Emerald AI system is on.

    For others who want to view the script, here's the code:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. namespace EmeraldAIExample
    6. {
    7.     public class RespawnAI : MonoBehaviour
    8.     {
    9.  
    10.         //The seconds needed before respawning
    11.         public int RespawnSeconds = 300;
    12.  
    13.         //The reference to the Emerald AI system
    14.         Emerald_AI EmeraldAIReference;
    15.  
    16.         //The respawn timer that will track the seconds passed
    17.         float RespawnTimer;
    18.  
    19.         void Start()
    20.         {
    21.             //Get the reference to the Emerald AI system
    22.             EmeraldAIReference = GetComponent<Emerald_AI>();
    23.         }
    24.  
    25.         void Update()
    26.         {
    27.             //Increase the RespawnTimer, but only when the AI has been killed
    28.             if (EmeraldAIReference.CurrentHealth <= 0)
    29.             {
    30.                 RespawnTimer += Time.deltaTime;
    31.  
    32.                 if (RespawnTimer >= RespawnSeconds)
    33.                 {
    34.                     //Reset the AI and set the timer back to 0 to be used again, if needed.
    35.                     EmeraldAIReference.ResetAI();
    36.                     RespawnTimer = 0;
    37.                 }
    38.             }
    39.         }
    40.     }
    41. }
     

    Attached Files:

    Last edited: Aug 13, 2018
    wood333, Weblox, zKici and 1 other person like this.
  26. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    I would make sure to put the RespawnAI class mentioned above in a namespace. Classes should always go in a namespace to avoid conflict with all other assets.
     
    SickaGames1 likes this.
  27. faisalfasi18

    faisalfasi18

    Joined:
    Sep 13, 2017
    Posts:
    2
    Can you please share that third person with me please i'd tried alot to make like that but couldn't or can you please guide me? heal me please ... :(
     
  28. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    And modular based attack system using scriptable objects for bosses / mobs, plz? ;) Don't forget this important feature :)
    Really looking forward for the big Emerald AI Update now that Unistorm update is out.

    Cheers
    Ronny
     
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This was just intended to be a quick example, but the name RespawnAI may exist in a project already. So, I've update the script with a EmeraldAIExample namespace.


    What 3rd person object are you referring to?


    I am working on a modular based attack system for one of the next updates. I have a prototype that I made a few pages back on this thread (that can be found here near the bottom of the post) that would allow users to create modular attacks for an AI to use.
     
    Weblox likes this.
  30. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Yeah I know. Just wanted to be sure thats it's not forgotten ;)
     
  31. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    The respawn script works great! One thing that i did notice is that it is stuck on the death animation. How do i change it back to the idle?
     
  32. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    A few improvement changes I've made to the Emerald AI editor that have helped me, you may like to consider them.

    Changed the Detection Distance to a minimum of +1 instead of +10.
    Chase Distance to a minimum of 1.

    This way the AI goes back to a non chasing state quicker, as adding +10, on top of a detection distance of say 30 was a bit much. You can't always get away from a fast AI.

    There are other options I've changed, but cannot remember them off the top of my head.
     
    Last edited: Aug 16, 2018
    BHS likes this.
  33. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @BHS - How do I inflict the damage after the attack animation is played? Currently its at the start of the attack animation. Might need something in PlayerDamage
     
  34. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @BHS - That sounds great! Hopefully we can upgrade w/o breaking existing AI. What I would love to see are attack specific Unity.Events like "OnAttack1Start" / "OnAttack1Finished" that we can use to display FX on AI while Attacking etc., if that is possible with scriptable objects...

    You can set the damage timing in the Animation / Combat Section of the Emerald Editor. The Attack Delay lets you fine tune the timing to apply the actual DMG in Combination with the Attack Speed Setting. Also set the Attack Distance / Too Close distance, those values are shared for all of the models different attacks.
     
  35. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Hmmm, why do you need that? In my opinion this would be overhead. Normally you should define Animations and Effects for different Attack types. Meaning OnMeeleAttack which is divided for example in OnMeeleAttackHard, OnMeeleAttackLight etc. Same for casting Attacks. OnCastOmni, OnCastChannelShort, OnCastChannelLong, OnCastDirect etc. Of course the type can hold multiple Animations like for entering OnChannelOmni, casting OnChannelOmni and exit OnChannelOmni.

    At the end you should script the Spells as Scriptable Objects and not the attack itself. Meaning creating a Healing Spell lets say "Healing Wave" with an unique ID of XXX, Spelleffect holding the Effect, using Cast Time of 3 seconds, using Animation "OnCastChannelOmni", ChannelType "Heal", HealingMin of 100, HealingMax of 200 and Interruptable "Yes". Games like WoW and others are doing it similar.

    This would be the right approach from my point of view but perhaps I understood you wrong and you meant the same :)

    Cheers
    Ronny
     
    Last edited: Aug 16, 2018
    Weblox likes this.
  36. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @RonnyDance - You may be absolutely right. I am still a beginner in Unity but from a starters point of view I am trying to make my ranged AI display a glow effect on itself that I would activate in the "OnAttackStart" and deactivate again in the "OnAttackFinished" Event. That would be easy solution for me since I already learned how to use it. :D
     
    RonnyDance likes this.
  37. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    I have a nagging little problem with my rabbit Emerald AI npc. The rabbit can push my player across the terrain. How do I prevent this? Actually, all my Emerald AI npcs can push my player character. It doesn't look bad when a large docile animal does the pushing, but small npc animals should not push the player around.
     
  38. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Ah thanks, not sure how I missed that - maybe I misread it as being animation delay before its played.
     
  39. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Rigid body mass on your player increase maybe?
     
  40. jejouelejeu

    jejouelejeu

    Joined:
    Aug 23, 2017
    Posts:
    5
    I've had the same issue others have had with integrating with UFPS : melee weapons do not connect to the enemies and do no damage. Did you find a solution for it yet?
    I've searched the forum for an answer, but didn't find one.
     
  41. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Hello, I integrated Emerald AI 2 with my RFPS project and followed the integration tutorials so everything is working fine. All the creatures that have melee attacks work fine. The problem is this: What about the ranged enemies? I am trying to use emerald on my SoldierBadNPSs with no luck. If anyone can help me or has any example how to use the soldiers with emerald, I would appreciate. Thank you in advance.
     
  42. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I believe this is because your player has a "Nav Mesh Obstacle" component attached to it. Removing it should stop AI from being able to push your player.


    I look into this and see if something has changed with UFPS. If there are any changes to the integration guide, I will let everyone know and update the tutorial.


    What exactly is the issue? If your AI are not reacting to being damaged from far away, this is because the player is outside of the AI's detection radius. A solution for this is to utilize the Expanded Field of View and the Expanded Detection Distance features (Note: You must use the Field of View Detection Type to use these features). This will allow the AI to temporarily expand its detection to look for targets that may be further away. This is done to help with performance so AI aren't moving around with very large colliders.
     
  43. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Hello. When AI soldier is dead he goes under the terrain (no collision). Also I don’t know how to make the gun flash show when he is shooting. Also the soldier is not pointing at the player when he shoots. And many ither problems that i am trying to solve. If you have a soldierBadNPC that is wirking fine with rfps prefab, please share it here. Thank you for your answer.
     
  44. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    So after playing with Emerald AI some minutes for the first time, I am asking me some questions or pehaps missing something.
    Please correct me if I am wrong:

    1. You only can define mobs that have a Meele or Ranged attack type? What about a meele mob who can cast some spells after every random 10 to 30 seconds? Or what about a wizard who should only use ranged attacks like spell casting if the target is not in meele rang like let's say 3-5 meters? If in meele range he attackes with his weapon. That is not possible right? Idea would be to being able to mix range and meele attacks or perhaps a "Mixed" or "Boss" type which can do everything something like that. Because lot of meele mobs should also being able to cast something on specific timers / health / events regardless of their Attack Type. Your spider for example in the demo scene should be a meele attacker but should also be able to cast some poison or web spells with a different animation.

    2. Right now you only can use a maximum of three animation in combat for ranged or meele, right? This really should be splitted into animation types in combat like OnCast, OnMeele types which can hold those 3 or more animations. 3 animations for a whole fight with phases, different attack types etc is pretty small. If I use like 6 attacks with effects I would like to being able to use 6 animations. One animation for every specific spell / effect if I want to. Or a random animation from an casting animation list when casting a spell.

    3. For every waypoint in the waypoint system you should be able to define a random Animation from an animation list. So mobs can run to a position and do something like scream, talk etc. It would be cool to also define that on waypoint x the mob should do something like cast a spell, play a random sound etc. So being able to define specific events for the waypoint would be really cool. I did not find this option.

    4. An idle prefab effect would also be cool. Like defining the idle animation with an effect like a Casting effect for a mage. Right now you only can define the idle animation without any prefab or effect if I am not mistaken.

    5. I can't change the AI Name and AI Title font? For the combat text i can change the font as I saw. A preview of the text in scene mode would be good because I can not see where the text for the AI is placed. Also changing the Healthbar Y Position lower from the AI Title position does not have an effect for me. It's always pretty close to the AI Title text.



    I hope I don't have too many "crazy" ideas but I am coming from projects where this was possible.

    Anyway really nice and easy AI system. Good job in letting users create AIs so easyly.
    Keep up the good work and really looking forward of what Emerald AI will become.

    Cheers
    Ronny
     
    Last edited: Aug 20, 2018
    Weblox likes this.
  45. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    Hi, recently got this asset so I might have missed/overlooked the answer but does the AI have states or have you considered stats. What I mean is instead of having just the "Flees when health is xx" it instead would have more options like maybe become even more aggressive, put up a shield, change targets etc. I know the AI has listeners for events, so I assume one could have scripts but I'm still new to programming. Would I be able to change the AI's settings via a script in that manner?
     
  46. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    No nav mesh component on the Player, just this.

    Player components.JPG
     
  47. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    using Emerald and Crux, quite happy with the turnout.

     
  48. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Congrats on the update @BHS I am looking at a specific use case for emerald. I have animal AI and want to produce a simple social structure. I notice you can have follow and attack enemies together which is great, but what about bonding and mating etc. As the player relationship to the AI improves, I want them to form groups etc.. Is that possible within this system?

    Thanks Andy
     
  49. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Hey there,

    This sounds like you either don't have a death animation attached to your AI's animation settings or the death animation you are using is not properly rigged with your AI's model. Ensure the animations are properly working with your AI prior to applying them.

    If your AI is not properly facing its target, it most likely is the Combat Idle's Y animation position. This can be adjusted by going to the animation object in the Project tab and going to the Animation tab in the Import Settings.


    1) Yes, currently an AI can only use melee or ranged attacks. I plan on adding a modular ability system that will allow users to create a series of attacks, abilities, and spells an AI can use. AI will also be able to switch between melee and ranged attack based on certain conditions such as distance and randomly.

    2) More attack animations will come. With the modular ability system, users will be able to choose which animation is played for each modular ability. There still needs to be a cap of how many attack animations can be used because every attack animation needs to have a created state in the Animator Controller.

    3) An interesting suggestion. I could see how that could be useful. I will certainly consider it.

    4) I plan on more events to Emerald AI. So, some sort of casting or pre-attack event could be useful.

    5) Currently, the AI's name and title font can be adjust by going to the AI Health Bar Canvas in the project and adjusting the AI Name Text manually.

    Thanks, I have a lot planned for Emerald AI with the next couple of updates. :)


    AI don't currently have states, but with I'm working on a modular abilities system. This will allow an AI will have abilities that can be used based on certain conditions, as well as randomly, during combat. I plan on adding blocking with one of the feature updates. This will expand an AI's Confidence Level options such as having an AI block more when their health is low.

    An AI's settings can be altered with events, you would just need a reference to the Emerald AI object you would like to adjust.



    Is there one attached to any portion of your player? I believe this is the only way an object can move a Nav Mesh object.



    Very cool! :)



    Emerald AI's breeding system is still be rewritten, but mating will be possible after this feature is released. It will also allow AI to spawn offspring according to different rarities, like it could previously. As for player relations, the faction system is used by AI. I do plan on adding one for the player though. Group forming isn't currently available, but is a feature coming with the next update.
     
    RonnyDance likes this.
  50. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Let me be clear. I do not have an object moving a nav mesh object. I have a nav mesh object (emerald agent) moving the Player.

    No part of my Player has a nav mesh component.

    All emerald creatures in my test scene can push my Player. My Player cannot push any of them, at all. It looks strange to see my Player pushed around by the animals and NPCs, especially the rabbit. All the emerald agents and my Player have rigidbodys and colliders, if that helps.

    I don't understand how you haven't encountered this issue. Play your own health bar example scene. Stand directly in front of the spider and when it wanders and brushes against your player object, the player object moves. Stand in front a couple of times and you will see it. Then try to push your spider with your player and the player can't do it.
     
    Last edited: Aug 25, 2018