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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Great to hear you like that new option.


    Hey there,

    It's great to hear your loving Emerald AI 2.0!

    Not currently, but I plan on adding one. I'll make sure it's added with the next update.


    Ranged combat will not work if an AI's line of sight is obstructed. Is this happening with a player or another AI? Sometimes an AI can overlook a player if their collider position is offset. Try setting your AI's Player Y Offset to -0.1 or 0.1 to see if it resolves your issue. This option can be found under AI's Setting>Combat.


    Hey there!

    Thanks for your suggestions! I plan on improving the factions idea as Emerald progresses. I do feel like it's the right direction and that it is less confusing for users.


    Hey there!

    I can certainly work on improving the Dynamic Wandering rotation speed. It is based off of the AI's alignment speed, which needs to be set to a value of 2.5 to look the best. I can work on separating the rotation speed from the alignment speed so it can individually be adjusted. I can also work on generating waypoints up to a certain degree. Thanks for the suggestions!


    Hey there!

    I plan on making a whole tutorial series showing how to do all sorts of things with Emerald. This would include setting up and feature specific things like setting up ranged combat with custom projectiles. For now, Emerald's Documentation covers setting up a custom model and everything else users may need help with. If you need further clarification or more information, I'd be more than happy to explain things more in-depth. Just send me a PM and I'd be more than happy to help you out.
     
    erichey and Neviah like this.
  2. ChillyMcChill

    ChillyMcChill

    Joined:
    Nov 17, 2016
    Posts:
    57
    Is there support for the Invector Shooter/Melee Template?
     
    julianr and davidhavl like this.
  3. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Yep, it will be available later as Invector is a very popular and usefull plugin.
     
    wood333 likes this.
  4. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    143
    Hi, Thanks for the answer. Could you please tell me how to change the AI's Alignment speed? thanks again
     
  5. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    By default, Emerald sets the Align Speed to 2.5 on Start. In the Emerald_AI script, within the Initialization function, you will see the line AlignSpeed = 2.5f; Set this to whatever value as needed. A value of 1 should get you the results you're looking for.
     
  6. BHS

    BHS

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

    The Invector Third Person Controller integration tutorial for Emerald AI is finished. This tutorial also allows users to block attacks using Invectors blocking system. You can find it here: https://docs.google.com/document/d/...uHce2BVLM3QTq5axg/edit#heading=h.9ko8tymxw1dt

    Also, Emerald AI version 2.0.2 has been accepted and is now live. This should resolve the release bug some users were having, as well as the addition of a couple new features. The release notes of this update can be found here: https://forum.unity.com/threads/rel...aypoints-and-more.336521/page-31#post-3351978
     
  7. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Awesome - thanks for the quick update and tutorial!
     
  8. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    Now pls ootii xd

    Good job and thanks for all Hard work
     
    BackwoodsGaming likes this.
  9. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Cool, all 3 stationary anims are now working as intended. Well done, @BHS!
    The Idle Anim Seconds float is also a good development, but a random slider would yield more realistic results.
     
  10. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    I still get this bug after updating, video provided. After entering it's trigger range, it will be stuck on this animation and do nothing else, and move sideways.

     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    You're welcome!


    Thanks, I can certainly have this option be randomized with the next update.


    If this is the same issue you were having before, and you've updated to the newest version, it most likely something setup incorrectly. Last time you stated that your player had the Ignore Raycast layer, is this still the case?

    If you could answer these questions, it would help me better understand what's going on because I cannot recreate this issue.

    Could you provide the settings for your AI you used?
    What version of Unity are you using?
    What character controller are you using?
    Are you receiving any errors?
     
  12. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    I changed the layer so the player will do his attacks. Thanks, but still got the original issue.
    2017.2
    TheDivisionKit (private seller)
    No errors.

    Movement is Dynamic, ranged and melee attacks, and the other stuff listed in the first screenshot (except the layer was changed per your advice).

    I'll try a blank project next, and see if it'll happen again.
     
  13. Lex_Vector

    Lex_Vector

    Joined:
    Sep 30, 2015
    Posts:
    3
    After following the Invector tutorial, I am running into an issue with Ranged attacks.
    I can send and receive melee damage (works great), but Invector bullets and grenades are having no impact.
     
  14. RoyaleJoons

    RoyaleJoons

    Joined:
    Jul 28, 2016
    Posts:
    13
    Have you added the enemy tag in the shooter manager?
    https://imgur.com/pbkYvU8
     
    uberwiggett likes this.
  15. Lex_Vector

    Lex_Vector

    Joined:
    Sep 30, 2015
    Posts:
    3
    That was all I needed. Thank you!
     
    RoyaleJoons likes this.
  16. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    I
    I would not use the divisionkit for a commerical game. Its contains assets (animation) that are stolen from other assets. A friend got sued when they used the kit and released a commerical with it. just sayin...
     
    uberwiggett likes this.
  17. J0linar

    J0linar

    Joined:
    Dec 12, 2013
    Posts:
    83
    @BHS
    well done the latest update is working out of the box, i know you got your hands full with requests and sorts... but
    always that but i know.
    Is there any chance we could get a update for the death animations as in being able to define more then 1 death animation, something like death_front/death_back/death_left/death_right...
    and i got a question regarding using Emerald Ai with Dismemberment. Am using https://www.assetstore.unity3d.com/en/#!/content/90674 Dismembering Asset from the Store and was wondering if i could hook it up with the Emerald Ai.
    maybe someone here has some experience with it? or @BHS maybe any clues/pointers
    Thanks for any advice
     
  18. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    767
    Is it possible to change the temperament of an AI agent at runtime?

    For example, there is an aggresive monster, but I tamed it and now it behaves as a companion?
     
  19. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    I just bought this asset and have one question. I have a male and a female animal, I have setup the AI for the female, is there an easy way to copy all settings to the male animal without using the setup manager and repeating the same settings?

    Found the solution myself: Multiple object editing:)
     
    Last edited: Jan 20, 2018
  20. RoyaleJoons

    RoyaleJoons

    Joined:
    Jul 28, 2016
    Posts:
    13
    Using Emerald AI with Invector shooter template and it's working fairly well! Has anyone managed to successfully add Invectors Ragdoll component to an emerald AI? I'd love to have more precise hit-boxes on my enemies and a death by ragdoll would be nice but I'm guessing there's a bunch of scripts/code that causes interference when trying to use those 2 together.
     
  21. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    Hey Joons, I'm about to integrate to invector myself. AFAIK there should be no problem with applying the ragdoll, as it's a component you can add from the invector menu system, and the bullets you fire from the controller should still collide with bodypart layers as designed, the only thing Emerald handles is the health and behaviour/decisions of the AI. However you will need to figure out how to enable the ragdoll on death, which off hand I can't recall but if I find it while I'm working I will let you know.
     
  22. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Enable ragdoll on death option would be good, or an animated ragdoll death.
     
  23. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    Not that this is the answer, but I would just say add a new script that destroys the current animal and spawns in a tame animal in game. You know, make it super simple.
     
  24. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @BHS: This. Please include a "spawn gameobject at death" option.
    It's currently doable only within the UFPS integration with UFPS's "spawn item at death" script.
     
    julianr likes this.
  25. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    130
    You might try something like this in your script:
    EAI.SetBehavior(Emerald_AI.CurrentBehavior.Aggressive);

    Note: EAI is the variable name I used, but you can name it whatever you want when you declare the variable (e.g. "private Emerald_AI your_emeraldAI_name;").
     
    goldbug likes this.
  26. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    You specifically advertised integration with GKC. So I bought your asset. Can you post the link to set this up - You advertised a completed tutorial in the documentation on the asset store. But I cant find it.

    - Game Kit Controller (Tutorial covered in Documentation) I bought this last week
     
    Last edited: Jan 20, 2018
  27. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Try testing the Emerald example scenes. If those are working correctly, it something related to your own setup and custom player. Ensure that you have your tags and layers setup correctly. If you are using your own custom player, make sure you are calling its damage function correctly. This can be edited under the DamagePlayer function within the Emerald_AI script.


    Thanks! I plan on adding more death animations support with the next update. I can certainly look into support for the Dismembering asset. When I get the time, I will reach out to the developer.


    Yes, this can be done using the SetFollowerCompanion(Transform ObjectToFollow) function. This function will automatically set the AI's behavior to the Companion Behavior Type and the AI will follow the parameter object.

    This script will find the Footman gameobject and set the Emerald Demo player as its follow target by pressing the K key. This will work for all objects within a scene with the name Footman, this is just one example. If you wanted it to be more precise, you can set it via a Raycast.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class SetBehavior : MonoBehaviour {
    6.     void Update () {
    7.         if (Input.GetKeyDown(KeyCode.K)){
    8.             GameObject.Find("Footman").GetComponent<Emerald_AI>().SetFollowerCompanion(GameObject.Find("Emerald Combat Demo Player").transform);
    9.         }
    10.     }
    11. }
    You can even have a condition such as only allow the AI to be tamable while it's in a cautious/territorial state. After that, it would turn aggressive towards the player. Once again, this is searching for the AI and player by name. You can have it be more precise by using a raycast and getting the AI target directly.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class SetBehavior : MonoBehaviour {
    6.     void Update () {
    7.         if (Input.GetKeyDown(KeyCode.K)){
    8.             Emerald_AI EmeraldSystem = GameObject.Find("Footman").GetComponent<Emerald_AI>();
    9.  
    10.             //If the AI object with the name Footman's bahavior is Cautious and its confidence is not Coward,
    11.             //set the Emerald Combat Demo Player as the AI's follow target.
    12.             if (EmeraldSystem.BehaviorRef == Emerald_AI.CurrentBehavior.Cautious && EmeraldSystem.ConfidenceRef != Emerald_AI.ConfidenceType.Coward){
    13.                 EmeraldSystem.SetFollowerCompanion(GameObject.Find("Emerald Combat Demo Player").transform);
    14.             }
    15.         }
    16.     }
    17. }
    18.  

    I plan on adding a ragdoll on death option with the next update. There will be options to enable an AI's ragdoll components within the AI object on death and an option to spawn a ragdoll object.


    Hey there!

    The developer of Game Kit Controller is currently working on adding integrated support for Emerald AI 2.0. I will be adding the integration tutorial to the tutorial section of Emerald for the time being. The tutorial will be added within the next day or two. My apologies for the delay, I have been very busy.
     
    goldbug and julianr like this.
  28. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    For the time being can you please post a synopsis of the relevant damage code for player and AI and what scripts to mod here. I'd scheduled time to work on this today.
     
  29. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    OK, finally got round to importing this and starting the setup.

    Loving it so far.. so easy :) anyhow.. I have one question (at this stage) :)

    I have my model imported, and animations setup and layers setup and it all works.

    I also have it set to dynamic wander (no waypoints). Is there a setting that controls how big the dynamic radius actually is? I would like to confine the AI to a small area but currently it wanders away all over the map.

    I'm sure it's something I missed in reading the docs, but a pointer to this field would be appreciated.

    Regards

    M
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    You will need to set your layers and tags according to your own setup. For more on Emerald's tag system, see the documentation section here: https://docs.google.com/document/d/...2njM7Jx9pYlqgbtM8/edit#heading=h.bma0yitb4i6q

    1) Open the playerWeaponSystem script and find the line newProjectile.transform.LookAt (hit.point);

    2) Underneath said line, add the following code and save the script.
    Code (CSharp):
    1. if (hit.collider.GetComponent<Emerald_AI>() != null){
    2.                                         hit.collider.GetComponent<Emerald_AI>().Damage((int)weaponSettings.projectileDamage, Emerald_AI.TargetType.Player);
    3.                                     }
    3) Open the Emerald_AI script and find the DamagePlayer function. Remove everything within this function and add the following code within it. Once finished save the script.
    Code (CSharp):
    1. if (CurrentTarget != null && CurrentTarget.GetComponent<health>()){
    2.             CurrentTarget.GetComponent<health>().setDamage((float)CurrentDamageAmount, Vector3.forward, this.transform.position, this.gameObject, this.gameObject, true);
    3.         }

    Hey there!

    Great to hear! :)

    To adjust how far an AI generates dynamic wandering points, you need to adjust the Dynamic Wander Range.

    WanderRange.png
     
    MaliceA4Thought likes this.
  31. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    Got it, ty very much, I knew it would be in there somewhere:)

    M
     
  32. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    Invector integration worked a charm. Looking forward to the love/hate integration further down the track. Just wanted to say thank you and show appreciation for your efforts with ongoing support with bug fixes and assistance. Loving the asset mate,

    Cheers.
     
  33. kevios105

    kevios105

    Joined:
    Jan 22, 2018
    Posts:
    6
    Is there a Function for Breeding? At The Last emerald 1.35 Version there was a breeding Function ...
     
  34. francescobr

    francescobr

    Joined:
    Apr 2, 2017
    Posts:
    45
    Hi, I'm searching for an asset to manage non humanoid AI with Invector TPC. I looked at the tutorial but I'm a bit worried about changing those lines of code, since after doing that every Emerald update would break that functionality. Is there any way you could add an option so that your code knows that we're using TPC and switch to the correct code, instead of us having to modify your script?
     
  35. LightMiner

    LightMiner

    Joined:
    Nov 2, 2013
    Posts:
    7
    Hello there, I have a problem here I couldn't solve it..
    When I change the scale of my characters "enemies" the distance gets messed up and not accurate.. When I attach emerald ai script to the "enemy" character and I set the attack distance for example to "1.5" which is the minimum value the enemy attack from a lil bit far distant and not very accurate, and it won't let me set the value any less.. I think the only way to get it working is by setting all the objects as the same scale as in "Emerald ai" demo scenes.. but I can't use this solution, as I already developed my project with a certain scale which is the default anyways. so how can I solve this issue..? I hope my explanation was clear..
     
  36. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Thanks for the response - I think I got it working so far... Dont forget the GKC close combat system when making the tutorial please. It doesn't work on projectiles or ray cast its based on the colliders in the hands and feet the script is hitCombat.cs I think you put this after this line:
    if (currentlyEnabled) {

    Code (CSharp):
    1.     if (col.GetComponent<Emerald_AI>() != null){
    2.              
    3.                 col.GetComponent<Emerald_AI>().Damage((int)hitDamage, Emerald_AI.TargetType.Player);
    4.             }
    Please confirm - I haven't had a chance to test it yet.

    also what is the difference between

    Emerald_AI.TargetType.Player

    and

    Emerald_AI.TargetType.AI
     
  37. VENOMOUS09

    VENOMOUS09

    Joined:
    Dec 27, 2014
    Posts:
    37
    please help , on the asset story it said

    - Game Kit Controller (Tutorial covered in Documentation)
    where / how do you configure it.
     
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    You’re welcome!


    Thank you! It’s great to hear you’re loving Emerald and that the integration with Invector worked well. :)


    I’m hoping to have breeding support added with the next version or two. It’s currently being rewritten as the other portions of Emerald were.


    Hey there!

    I’m currently working with every developer that’s willing to add integrated support with Emerald. However, some developers, such as TPC don’t have a custom define that allows their code to only be compiled when their asset is present. Without a custom define, adding integrated support isn’t possible. I have been in contact with the developer or TPC to see if a custom define can be added so integrated support can be added.


    Hey there!

    This is most likely because of your AI’s Agent Radius. This is what the Nav Mesh System uses to determine when your AI is within range of objects. Making this radius bigger should allow it to properly use your Attack Distance of 1.5. The Agent Radius can be found under AI’s Settings>Nav Mesh Settings.


    The code that I posted allows the player to damage AI with all projectile weapons. I’m not fully familiar with GKC yet so I’m not sure how to use the Close Combat feature. I have reached out to the developer to ensure nothing was missed with adding support.

    The Emerald_AI.TargetType.Player code allows the AI to know what type of target is attacking. This is needed for properly detecting whether damage should be called for an AI or a player object.


    Hey there!

    Yes, the GKC integration tutorial is currently being worked on. It should be finished later today. When it’s done, I’ll be sure to let you know.
     
    francescobr likes this.
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Mark_01, BryanO and AGregori like this.
  40. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    It won’t be more than a couple of days. I’m going to start working on the ootii integration tutorial tomorrow :)
     
  42. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    would give more than 1 like for this if I could... been waiting for this :) I'll be testing it as soon as it is available :)

    M
     
    Salja likes this.
  43. kevios105

    kevios105

    Joined:
    Jan 22, 2018
    Posts:
    6
    Thank you! because the Breeding option is very important for us and our project :)


    Is there anywhere a tutorial for setup a companion AI ? The Companion AI follow the player and attack the Enemy but the Enemy only attack the Player not the Companion AI and i try all diffrent settings with the layers and tags .. iam little confused .... (i use invector with emerald) ... a video tutorial would help very much to understand how to setting up the AI right...

    Sorry for my broken english ;)

    greets
     
  44. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    will your ootii integration also allow for damage caused by the motion packs to be inflicted on Emerald AI controlled creatures?

    M
     
  45. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    353
    i can make in 5 mins a ootii integration but i never become the block to work
     
  46. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    Tried it with a new controller, Invector this time. Seems like once I move (and thus forcing the AI to rotate while attacking) it'll get stuck in this turning animation loop.

     
  47. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Strange. What is your Angle Needed to Turn set to? It looks like it may be as too high. Also, try testing out the included demo scenes. If they work fine, it has something to do with your AI’s settings. I have tested the included Emerald example AI with Invector and they had no issues rotating.
     
  48. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    Changed angle needed to turn from 10, to 45 and it worked. Thanks for the help, sorry for bugging you so much x.x
     
  49. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    Got another little problem (unsure if this is double posting)

    The projectiles are spawning for ranged combat, but they don't appear to be moving anywhere. Are they colliding with the agent that fired them?

    I was trying to follow the Invector Integration tutorial for Emerald AI. Also, it's worth noting I used the projectiles included in Emerald AI, and yes I did hit 'apply'.

    Video for reference:


     
    Last edited: Jan 24, 2018
  50. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Hey got a few questions for anyone who can answer -

    1. Does Emerald AI 2.0 Work with 2d Projects?
    2. Is anyone working on a 2D project with Emerald AI? If so how is it?