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

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @magique Do you recommend Pool Boss over these fancy standalone pooling assets like Pool Manager or Pooly?
     
  2. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I never tried anything else except my own system so I can't speak about those stand-alone packages. However, I would highly recommend Core Gamekit, which includes PoolBoss. Not only do you get a great pooling solution, but you also get a comprehensive wave spawning system. And Core Gamekit also integrates with Master Audio, which is a great product as well. The author is constantly improving his assets and his support is excellent.

    [EDIT]
    Btw, Core Gamekit is on sale for 40% right now. At $30, it's a steal. A 5 star asset with 374 ratings.
     
    Last edited: Mar 21, 2018
  3. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    In addition to Core Gamekit, the Emerald AI author also provides an AI spawning system called Crux, which I haven't tried, but looks promising. I'm not sure if it's been updated for Emerald 2.0 support though.
     
  4. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @magique Already using Core Gamekit and Master Audio for 1+ year. But they're a pain to set up with Adventure Creator which is my main framework now. So I'll probably end up without them.
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Bummer. They are such good assets.
     
  6. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    98
    Emerald AI is a great tool.
    Emerald AI has any type of sound detection for enemies?
    Example: If I shoot with my handgun next to an Emerald AI NPC(even if I didn't hit the Emerald AI NPC), the NPC can react to the sound and begin to attack(consider it has Agressive pattern)
     
  7. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This has not been implemented,Emerald is more towards hack n slash or rpg action.
    But it would be interesting to get a radius sound for projectile or raycast point impact for AI perception; because Emerald is becoming a multi purpose AI plugin with coming updates.
     
    Last edited: Mar 21, 2018
  8. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @magique Have you also tried UFPS's own internal PoolManager? I'm asking because UFPS is a staple in my project, and I'm seeking advice whether it's a good enough pooling system on its own.
     
  9. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I own UFPS, but haven't used it for a very long time. I switched to RFPS, which I believe is a far superior product. So, I can't really say much on that point. Although, you can use PoolBoss from Core Gamekit without using the full system if you want. I don't see any reason why you couldn't integrate that fairly easily.
     
  10. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @magique I'm only using UFPS because the AdventureCreator+Emerald+UFPS threeway integration is pretty flawless at this point. I love how RFPS is free of bloat, but it's not as widely supported.
     
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    RFPS has easy integration with Emerald AI 2.0, but if Adventure Creator is the key factor then you probably have to stick with UFPS. I'm not really sure UFPS pooling system is meant for stand-alone use though, but Opsive can tell you more on that.
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Quest Machine 1.0.4 is now on the Asset Store with Emerald AI integration. I think Quest Machine and Emerald AI make a nice combo. It was really easy to create kill quests and escort quests for the demo scene.
     
    julianr and AGregori like this.
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Awesome. I've been considering using Quest Machine and this pretty much makes that a no brainer now. Thanks for all your work @TonyLi
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Thanks! If anyone's on the fence, there's a free evaluation version. It's the same as the paid version (and fully compatible); it just has a watermark and no source code.
     
    julianr likes this.
  15. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    For the record, I went through the UFPS manual and now use its own pooling. It seems to have the exact same general-purpose functionality as PoolBoss or Pooly.
     
  16. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Cool. You should be good to go then.
     
  17. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I'll look into the newest UFPS update and see what needs to be adjusted to make it compatible. Most likely, the tutorial should be the same as it was previously.


    I personally tested Emerald AI 2.1.1 after it was accepted with multiple versions of Unity to ensure everything worked correctly. All the scenes were working correctly. I can take a second look though. Did you update Emerald AI or remove it and re-import it into your project?


    I will be working on PlayMaker support and tutorials soon.


    @julianr Everything should be working fine with RFPS and UFPS. What you are most likely seeing is the new expandable line of sight/detection radius feature. This will limit the distance to what an AI can see or detect after it has been hit. This can be found under the Detection Options. If you would just need to use a high amount for the distant player to be detected.

    I haven't seen an AI skip its death animation, but I will look into this and figure out why it's sometimes being skipped.
     
    dl290485, AGregori and magique like this.
  18. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @BHS - mine was related to Third Person Controller from Invector. I don't use UFPS or RFPS at the moment :)
     
  19. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I'm having trouble getting my companion AI to attack targets. I have targets set to NPCs layer and their faction set to Undead. I have the companion set to detect NPCs layer and the faction relationship for Undead is set to enemy. But still, the companion just follows me around and doesn't attack anything.

    [EDIT]
    Also, my companion is invulnerable to attacks by the enemy AI. They are definitely attacking my companion, but the companion takes no damage. I'm using RFPS and have followed the instructions for integration and it works for player versus AI, but not with the companion.
     
    Last edited: Mar 23, 2018
  20. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    really keen on the love/hate + quest integration with emerald, I've downloaded the trial copies a week ago, have they been updated in the past few days for compatibility with emerald?
     
  21. hsxtreme

    hsxtreme

    Joined:
    Apr 14, 2017
    Posts:
    55
    Anyone got an idea on how to integrate a headshot system to emerald?
    I also want to make some bosses with sensible parts (like dead space).
    Use it with RFPS.
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @uberwiggett - Yes, they were updated a few days ago when Love/Hate 1.8.9 and Quest Machine 1.0.4 were released.
     
    uberwiggett likes this.
  23. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    @BHS
    I deleted Emerald folder and re import plugin instead of update, it must have been some problem with . It's better to delete and make a new install perhaps.

    The ranged AI is very dynamic , great work :)

    There is lot of duplicated inits to false for same parameters

    Code (CSharp):
    1.     }
    2.     }
    3.     void AnimationIdleWarning (){
    4.         AIAnimator.SetTrigger(IdleWarningParameter);
    5.         AIAnimator.SetBool(IdleCombatParameter, false);
    6.         AIAnimator.SetBool(IdleParameter, false);
    7.         AIAnimator.SetBool(RunParameter, false);
    8.         AIAnimator.SetBool(WalkParameter, false);
    9.         AIAnimator.SetBool(IdleAlertParameter, false);
    10.         AIAnimator.SetBool(TurnRightParameter, false);
    11.         AIAnimator.SetBool(TurnLeftParameter, false);
    12.     }
    13.     void AnimationWalk (){
    14.         if (!AIAnimator.GetBool(WalkParameter)){
    15.             AIAnimator.ResetTrigger(HitParameter);
    16.             AIAnimator.SetBool(WalkParameter, true);
    17.             AIAnimator.SetBool(IdleParameter, false);
    18.             AIAnimator.SetBool(IdleCombatParameter, false);
    19.             AIAnimator.SetBool(RunParameter, false);
    20.             AIAnimator.SetBool(IdleAlertParameter, false);
    21.             AIAnimator.SetBool(TurnRightParameter, false);
    22.             AIAnimator.SetBool(TurnLeftParameter, false);
    23.         }
    24.  
    25.  ...
    26.  
    27.     }
    Instead create a general init function
    Code (CSharp):
    1.   void ResetAllAnimationsToFalse(){
    2.             AIAnimator.SetBool(WalkParameter, false);
    3.             AIAnimator.SetBool(IdleParameter, false);
    4.             AIAnimator.SetBool(IdleCombatParameter, false);
    5.             AIAnimator.SetBool(RunParameter, false);
    6.             AIAnimator.SetBool(IdleAlertParameter, false);
    7.             AIAnimator.SetBool(TurnRightParameter, false);
    8.             AIAnimator.SetBool(TurnLeftParameter, false);
    9.         }
    To simplify all your code

    Code (CSharp):
    1.  
    2.   void AnimationIdleWarning (){
    3.          ResetAllAnimationsToFalse();
    4.         AIAnimator.SetTrigger(IdleWarningParameter);
    5.  }
    6.  
    7. void AnimationWalk (){
    8.  
    9.         if (!AIAnimator.GetBool(WalkParameter)){
    10.  
    11.              ResetAllAnimationsToFalse();
    12.  
    13.             AIAnimator.ResetTrigger(HitParameter);
    14.             AIAnimator.SetBool(WalkParameter, true);
    15.        }
    16.  
    17.  
    18. void AnimationTurnLeft (){
    19.  
    20.         ResetAllAnimationsToFalse();
    21.        AIAnimator.SetBool(TurnLeftParameter, true);
    22.    }
    23.  
    24.    void AnimationTurnRight (){
    25.  
    26.         ResetAllAnimationsToFalse();
    27.        AIAnimator.SetBool(TurnRightParameter, true);
    28.  
    29.    }
    30.  
    31. void AnimationRun (){
    32.        if (!AIAnimator.GetBool(RunParameter)){
    33.  
    34.            ResetAllAnimationsToFalse();
    35.  
    36.            AIAnimator.ResetTrigger("Attack 1");
    37.            AIAnimator.ResetTrigger("Attack 2");
    38.            AIAnimator.ResetTrigger("Attack 3");
    39.  
    40.            AIAnimator.SetBool(RunParameter, true);
    41.            AIAnimator.ResetTrigger(HitParameter);
    42.  
    43.        }
    44.    }
    45.  
    46.  
    47.  
    48. }
    49.  
    50.  
     
    Last edited: Mar 23, 2018
  24. jk350z

    jk350z

    Joined:
    Feb 7, 2018
    Posts:
    4
    Emerald AI Invector implementation needs updating? I followed the tutorial. However after the first code update in Emerald_AI.cs (Using the latest version of Invector) btw released a couple days ago. When adding the integration code into playerdamage() function in Emerald_AI.cs . it creates all types of namespace errors.
     
    julianr likes this.
  25. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    So leaving the dead body is the expected behavior from stock emerald 2.0?
     
  26. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I believe it is, but I could be wrong because I haven't used 2.0 that much yet. I didn't see anything anywhere that would allow you to do this. I just wrote my own very simple script to do the spawning and despawning through Core Gamekit's PoolBoss. And I used the new Emerald AI 2.0 event system to listen for when the AI was damaged so I could check if it was dead.
     
  27. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This a modification to be able to switch ranged attack projectiles to raycast ranged attacks
    It's tested and working :)



    Script Emerald_AI

    1) Find and add green code lines
    public float ProjectileTimeoutTime = 4.5f;
    // 0=projectile 1=raycast
    public int RangedAttackRaycastType = 0;
    private RaycastHit rayHitInfo;


    2 ) Find and replace blue code lines and add green code lines

    if (CurrentTarget != null){
    if (!IsRunAttack){
    if (AttackAnimationNumber == 1){
    yield return new WaitForSeconds(0.25f);

    AnimationAttack();

    //Grab our AI's target position halfway through the attack delay so that the projectile fires straight.
    //This is to stop the projectile from firing behind the AI if their target happens to move after an attack animation has been triggered
    ProjectileFirePosition = CurrentTarget.position;
    yield return new WaitForSeconds(Attack1Delay);
    CurrentAttacks++;

    //custom
    if (WeaponTypeRef == WeaponType.Ranged && Attack1Projectile != null && RangedAttackRaycastType == 0){
    CurrentProjectile = EmeraldObjectPool.Spawn(Attack1Projectile, RangedAttackTransform.position, Quaternion.identity);
    CurrentProjectile.transform.SetParent(ObjectPool.transform);
    CalculateRangedProjectile(CurrentProjectile);
    }

    if (WeaponTypeRef == WeaponType.Ranged && RangedAttackRaycastType == 1)
    {
    Debug.Log("Raycast attack call ");
    raycastRAngedAttack();

    }


    }

    3) after function

    Code (CSharp):
    1. void CalculateRangedProjectile (GameObject SentProjectile)
    add the new function below

    Code (CSharp):
    1.  
    2.  
    3.     //custom
    4.     void raycastRAngedAttack()
    5.     {
    6.         //RangedAttackRaycastType = 1;
    7.  
    8.         Vector3 targetOffset = CurrentTarget.position;
    9.         targetOffset.y += 1.3f;
    10.  
    11.         Vector3 direction = targetOffset - RangedAttackTransform.position;
    12.  
    13.         Physics.Raycast(RangedAttackTransform.position, direction, out rayHitInfo, 100f);
    14.  
    15.         if (rayHitInfo.collider != null)
    16.         {
    17.             Debug.Log("Raycast hit something ");
    18.             if (TargetTypeRef == TargetType.Player && rayHitInfo.collider.tag == "Player")
    19.             {
    20.                 Debug.Log("Raycast hit player");
    21.                 DamagePlayer();
    22.  
    23.             } else if (TargetTypeRef == TargetType.AI) {
    24.                 Debug.Log("Raycast hit AI");
    25.                 if (TargetEmerald != null)
    26.                 {
    27.                     if (TargetEmerald.CombatStateRef == Emerald_AI.CombatState.NotActive)
    28.                     {
    29.                         TargetEmerald.CurrentTarget = this.transform;
    30.                         TargetEmerald.CombatStateRef = Emerald_AI.CombatState.Active;
    31.                         if (TargetEmerald.BehaviorRef == Emerald_AI.CurrentBehavior.Companion)
    32.                         {
    33.                             TargetEmerald.TargetEmerald = GetComponent<Emerald_AI>();
    34.                         }
    35.                     }
    36.  
    37.                     Emerald_AI EmeraldAIscript = rayHitInfo.collider.GetComponent<Emerald_AI>();
    38.  
    39.                     if (EmeraldAIscript != null) {
    40.                         EmeraldAIscript.Damage(CurrentDamageAmount, Emerald_AI.TargetType.AI);
    41.                     }
    42.  
    43.                 }
    44.                 else
    45.                 {
    46.  
    47.                     TargetTypeRef = TargetType.Player;
    48.                 }
    49.  
    50.             }
    51.             else if (TargetTypeRef == TargetType.NonAITarget)
    52.             {
    53.                 //Custom code can be added here.
    54.             }
    55.  
    56.  
    57.         }
    58.  
    59.         //Randomize next damage
    60.         GetDamageAmount();
    61.  
    62.     }
    63.  

    Script Emerald_AI_Editor




    1) Find and add green code line
    SerializedProperty ProjectileTimeoutTimeProp;
    //custom
    SerializedProperty RangedAttackRaycastTypeProp;


    2) Find and add green code line

    ProjectileTimeoutTimeProp = serializedObject.FindProperty ("ProjectileTimeoutTime");
    //Custom
    RangedAttackRaycastTypeProp = serializedObject.FindProperty("RangedAttackRaycastType");


    3) Find and add green code lines

    CustomFloatField(new Rect(), new GUIContent(), ProjectileTimeoutTimeProp, "Projectile Timeout Time");
    GUI.backgroundColor = new Color(0.1f,0.1f,0.1f,0.19f);
    EditorGUILayout.LabelField("Controls, in seconds, how fast projectiles will timeout and be disabled.", EditorStyles.helpBox);
    GUI.backgroundColor = Color.white;
    EditorGUILayout.Space();

    //custom
    CustomIntField(new Rect(), new GUIContent(), RangedAttackRaycastTypeProp, "Ranged attack is raycast");
    GUI.backgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.19f);
    EditorGUILayout.LabelField("Check it to use Raycast ranged attacks ", EditorStyles.helpBox);
    GUI.backgroundColor = Color.white;
    EditorGUILayout.Space();



    That's it, find "Ranged attack is Raycast" and change it's value 1 to use Raycast instead of projectiles to do ranged attacks.




    @BHS feel free to add it to the plugin and perhaps make it more elegant.
    - Using a bool instead of int for the variable telling if raycast must be used or not
    Code (CSharp):
    1.    public int RangedAttackRaycastType = 0;
    - Expose target hight offset used in raycast (to avoid raycast to target foots)
    Code (CSharp):
    1.  Vector3 targetOffset = CurrentTarget.position;
    2.         targetOffset.y += 1.3f;
    This could be a variable for each AI prefab depending on it's size, named RangedRaycastYOffset.
    - Disable 2 and 3rd attacks if raycast is used

    I got two new ideas for Emerald (not so complex to add) :

    1) Strafing while attack option for ranged AI.

    Ranged AI would walk and do ranged attack while always turning to target direction, this could be set as never, always or random (AI would randomly choose to strafe or not when it choose to move after some ranged attack).

    2) Most needed, AI home location

    The AI spawn initial position would be the home location of AI.
    When chasing or attacking a target, if the AI leaves a max radius from it's home location, the AI runs back to it's home location (with some small random offset).
    While there could be options to have AI invincible or reset it's health to max when it runs back to it's initial spawn position.

    It's a common mmo gameplay, this allows to create some individual units staying around a position like guards, or to keep a AI groups in their own zones.
     
    Last edited: Mar 24, 2018
    llJIMBOBll and julianr like this.
  28. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    I believe so, yes. There is the option to have the enemy ai respawn, so it needs to remain intact. Also as it was created eith the idea that crux will handle spawning, it probably wasnt added becausw it already existed there.

    As for invector update, they have changed their namespaces to allow for outside calls. I think you may need to have to add "using.invectorxxxx" at the top of your emerald ai script in order to call the function. I haven't got it up in front of me so i can't recall the specific command but pretty sure that is all you need
     
  29. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi @BHS
    The code below can be refactored
    Code (CSharp):
    1.  
    2.                         if (WeaponTypeRef == WeaponType.Ranged && Attack1Projectile != null && RangedAttackRaycastType == 0 )
    3.                         {
    4.                              CurrentProjectile = EmeraldObjectPool.Spawn(Attack1Projectile, RangedAttackTransform.position, Quaternion.identity);
    5.                              CurrentProjectile.transform.SetParent(ObjectPool.transform);
    6.                              CalculateRangedProjectile(CurrentProjectile);
    7.                         }
    This is how it is replaced
    Code (CSharp):
    1.  
    2. //custom
    3.   if (WeaponTypeRef == WeaponType.Ranged && Attack1Projectile != null && RangedAttackRaycastType == 0 )
    4.                         {
    5.                             setupProjectile(Attack1Projectile);
    6.                         }
    7. ...
    8.  if (WeaponTypeRef == WeaponType.Ranged && Attack2Projectile != null && !attackMeleeInsteadRanged)
    9.                         {
    10.                             setupProjectile(Attack2Projectile);
    11.                         }
    12. ...
    13.  if (WeaponTypeRef == WeaponType.Ranged && Attack3Projectile != null && !attackMeleeInsteadRanged){
    14.                             setupProjectile(Attack3Projectile);
    15.                         }
    16. ...
    17.  if (WeaponTypeRef == WeaponType.Ranged && RunAttackProjectile != null) {
    18.                         setupProjectile(RunAttackProjectile);
    19.                     }
    20. ...
    21.  
    22.  
    Adding a new function
    Code (CSharp):
    1.        void setupProjectile(GameObject go) {
    2.             CurrentProjectile = EmeraldObjectPool.Spawn(go, RangedAttackTransform.position, Quaternion.identity);
    3.             CurrentProjectile.transform.SetParent(ObjectPool.transform);
    4.             CalculateRangedProjectile(CurrentProjectile);
    5.         }
    6.  
     
    Last edited: Mar 23, 2018
  30. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I think that code may be out of date since either Invector or Emerald was updated since then.
     
  31. jk350z

    jk350z

    Joined:
    Feb 7, 2018
    Posts:
    4
    yes, Invector I believe was update on 3/19, and it seems to have broken the integration tutorial. Likely needs a few lines of code changes.
     
  32. jk350z

    jk350z

    Joined:
    Feb 7, 2018
    Posts:
    4
    I updated the DamagePlayer function inside of Emerald_AI.cs for anyone else looking for this (for Invector ONLY). Emerald AI can now pass damage to Invector controller after the latest Invector update. I haven't looked at the other scripts yet.

    at the top add: using Invector;
    Change DamagePlayer Function to below:
    if (CurrentTarget != null && CurrentTarget.GetComponent<Invector.vCharacterController.vCharacter>()){
    var PlayerInput = CurrentTarget.GetComponent<Invector.vCharacterController.vMeleeCombatInput>();

    if (!PlayerInput.blockInput.GetButton()){
    var _Damage = new vDamage (CurrentDamageAmount);
    _Damage.sender = CurrentTarget;
    _Damage.hitPosition = CurrentTarget.position;
    CurrentTarget.GetComponent<Invector.vCharacterController.vCharacter>().TakeDamage(_Damage);
    }
    }

    this is by no means an official fix... just someone trying to help out others while the PROs update their code.

    cheers.
     
    julianr and zenGarden like this.
  33. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    How did you setup Invector and Emerald tags and faction to recognize player as enemy ?
    Also Invector attacks doesn't damage Emerald AI, there must be some changes on Invector code to damage Emerald AI.


    @BHS

    I think Emerald needs a simplification about tags, layers and factions, it's looks like there is too much duplicated not necessary uses of tags and layers making it confusing.

    1) There should be only one layer : Emerald
    For Player and all game AI (whatever their faction is)
    2) Player should have a faction like, AI only needs faction to know if a target is enemy or not
    3) Only Player tag setup matters for other plugin integration, AI should not care about other AI tags.

    About companion :
    It should be a general feature, for example some AI chief could have companions.
    This could be a list of AI objects.
    An AI attributed as companion will follow it's leader whatever it is player or another AI.
     
    Last edited: Mar 24, 2018
  34. Baum_Joshua

    Baum_Joshua

    Joined:
    Oct 5, 2013
    Posts:
    25
    Hello. so I just purchased Emerald AI and I am trying to setup a passive AI for wildlife and everytime i follow the instructions and select Setup AI I get the following error:

    Assertion failed: Assertion failed on expression: 'MecanimDataWasBuilt()'
    UnityEngine.AnimatorOverrideController:set_Item(String, AnimationClip)
    Emerald_AI:SetupAnimations(Animator) (at Assets/Emerald AI 2.0/Scripts/System/Emerald_AI.cs:3398)
    EmeraldAISetupManager:AssignEmeraldAIComponents() (at Assets/Emerald AI 2.0/Scripts/Editor/EmeraldAISetupManager.cs:343)
    EmeraldAISetupManager:OnGUI() (at Assets/Emerald AI 2.0/Scripts/Editor/EmeraldAISetupManager.cs:237)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Any idea what is causing it? Also after i setup the AI the model does not move at all. just sits there.
     
  35. jk350z

    jk350z

    Joined:
    Feb 7, 2018
    Posts:
    4
    How did I setup the tags?

    On Emerald Enemy
    • Emerald Unity Tag: Enemy
    • Detection Layers: Enemy and Player
    • Faction: Undead
    • Enemy Faction: BreakableDoor

    The only way I'm currently using faction is so that the Emerald Enemy attacks and breaks doors (to get to my invector player if hiding in a building).
    On the door
    • I dropped an Emerald_AI script
    • Tag and Layer: both set to Enemy (so both Invector player and Emerald AI can attack and hurt the door.
    • A few settings so the door doesn't move
    • Faction: BreakableDoor

    After updating the Emerald_AI script. I can both receive damage from Emerald AI, and shoot Emerald AI enemies passing damage worked according to the Emerald tutorial.
     
    zenGarden and julianr like this.
  36. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Thankyou for this, saved me some time :)
     
  37. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    159
    I am still learning how to use this asset, it is amazing for what I saw!
    But...
    After the upgrade to Unity 2018.1 beta I got some problems, is there an official fix for this coming?

    Assets/Emerald AI 2.0/Scripts/Editor/PlayerHealthEditor.cs(71,25): error CS0143: The class `UnityEngine.AudioClip' has no constructors defined

    I fixed it temporarily by doing this at every place that it appears:

    AudioClip newAC = null;
    self.hitSounds.Add(newAC);


    Instead of
    self.hitSounds.Add(new AudioClip());


    Like I saw here:
    https://forum.unity.com/threads/two-things-i-found-right-off.511999/

    So it is working now :D
     
  38. FlyMario

    FlyMario

    Joined:
    Apr 30, 2013
    Posts:
    13
    I am considering this pack and I have a question. I also have RPGAIO and I wonder has anyone managed to use Emerald with RPGAIO? Emerald has such nice AI. I would like to be able to get them to work together.
    FlyMario
     
  39. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I found a way to get it work.

    Player tag : "Player"
    Player Layer : "Enemy" so AI will be able to also detect player

    All AI tag : "Enemy"
    All AI layer :"Enemy"
    All AI detection layer : "Player" and "Enemy" (to detect other AI)

    For AI interaction with player choose a behaviour
    attacks player : "never", "Always" ,"OnlyIfAttacked"
     
    Last edited: Mar 25, 2018
  40. Baum_Joshua

    Baum_Joshua

    Joined:
    Oct 5, 2013
    Posts:
    25
    So to update. I've tried with multiple different models multiple different rigs and they are not animating and are generating this error. Any help would be greatly appreciated
     
  41. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @BHS ,

    Sounds a bit counter intuitive (and I know you're waiting for new release of Opsive's Third Person Controller before re-integrating that) but have you thought about integration with Behavior Designer?
     
  42. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Anybody have a suggestion as to how to get Emerald AI to attack vehicles in GKC?
     
  43. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Create two factions "EmeraldFaction" and "GKC"

    Emerald AI tag : "Enemy"
    Emerald AI layer:"Enemy"
    Emerald AI detection layer :"Enemy"
    Emerald AI faction : "EmeraldFaction"
    Emerald AI faction relation : "vehicles" relation "enemy

    vehicles tag : "Enemy"
    vehicles layer :"Enemy"
    vehicles detection layer : "Enemy"
    vehicles faction : "GKC"
    vehicles faction relation : "EmeraldFaction" relation "enemy
     
  44. Demonoid74

    Demonoid74

    Joined:
    Jan 20, 2017
    Posts:
    16
    I wish there was an option for attacking the player and other AI at a certain % chance . Not just Always/Never/or when attacked . That would be an option I would love to see added...For certain games and situations like mine , in a modern town , with different factions going on...it would be far more interesting if the fighting was more randomized . Something like say in the awesome game Bully , where sometimes , not always the different factions would fight each other , attack you etc.
     
    BryanO and Marcos-Elias like this.
  45. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    I'm unclear how to assign a GKC vehicle a faction - they don't have or require a emerald script on them in order to attack and damage emerald ai Entity's.
     
  46. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Actually you need factions, if there is no faction Emerald AI can only recognize "player" tag object.
    I think @BHS needs to create a script allowing to use Emerald AI with other AI systems, a script with
    - damage function
    - faction
     
    julianr likes this.
  47. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    yeah a script that you can add to any object or AI that would be cool for damage or healing.
     
  48. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    I posted the fix a few months ago. do a search in the thread. Is a step that is skipped in the tutorial. I told them to add it but they haven't done so and people keep commenting with the same problem.
     
  49. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Yeah I tried the player tag on vehicles and they dont seem to care.
     
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey everyone!

    Over the next couple of days, I will be going through the integration tutorials to ensure they are all working. I will be updating the sections to reflect the changes made with the newest version of Emerald AI.

    Ensure that your AI is not set to attack the play under the Tag Options.


    Hey there!

    Strange, I haven't yet seen this error yet.

    1) Do you have an Animator component on your AI?
    2) Are you assigning the parent object of your AI to the Setup Manager?
    3) Are you using the Emerald AI Setup Manager?
    4) Do you have an Avatar attacked to your Animator component?


    I haven't yet, but Behavior Designer is its own AI system so integration does seem a little counter intuitive.


    I plan on adding a percentage based features to various portions of Emerald AI within the next couple of updates.


    I agree, this is something I will try to implement to soon.
     
    julianr likes this.