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

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi @BHS
    Your Rfps and Ufps tutorial is clear and great.
     
    erichey likes this.
  2. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Thank you!


    Hey there!

    From my understanding, the Collision Trigger is only responsible for using UFPS with platforms. The UFPS Player is still able to collide with objects. Without doing this, UFPS creates an additional collider around the UFPS Player that blocks raycasts which would stop AI from being able to detect the UFPS Player as a target. If you need to have the Collision Trigger enabled, you can have a script set it to the Ignore Raycasts layer on start.
     
  3. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Hi, using a mech i need more then one spawn point for the bullets. (rockets, laser...). Will this be possible in a future update?
     
    wwg likes this.
  4. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    @BHS

    Some bugs have been fixed, but there is still bugs.
    Why did you responded saying it was all ok and bug free in the Asset Store review ?

    I added a ranged AI in "Emerald AI playable demo (third person)", but there is the same bugs :
    Code (CSharp):
    1. if (angle <= 45 && hit.collider.gameObject == CurrentTarget.gameObject && !IsTurning){



    Another bug :
    Code (CSharp):
    1. if (DistanceFromTarget <= TooCloseDistance && !BackingUp && !IsTurning && WeaponTypeRef == WeaponType.Ranged && BehaviorRef != CurrentBehavior.Companion || DistanceFromTarget <= TooCloseDistance && !BackingUp && !IsTurning && WeaponTypeRef == WeaponType.Melee){


    Why did you removed all ranged AI from the demo maps ?

    You really need to stress test your AI, users will drop many characters in the same place unlike your demos.

    Make a similar scene with many ranged AI and many melee AI, run around some time and the game will crash.





    I'm not asking Skyrim AI, the plugin staying simple is better for users like me able to add their own code.

    The AI really needs some basic improvments that would benefit users not able to code it :

    1) In "ranged combat against player example" , the AI is not very reactive, when the player gets close, ranged AI continues attacking in melee range and reposition itself only after some seconds.

    2) In "Ranged combat example", the two ranged AI never moves and just keep attacking with ranged attacks, it's good for hack n slash but it's too static and unrealistic.
    An option to let AI randomly after a delay decide if it must do some side steps in available random directions would make it more dynamic and realistic.

    3) Ranged IA has 6 as distance for "too close", when the player runs as close as possible to AI, the ranged AI sometimes goes weird turning in some directions before deciding attacking again or step away.

    You included recycle, health reset and regen when player leaves combat, that's great options :)

    There is good update, but bugs crashing the game needs to be resolved.

    About the title "AAA quality AI", i know it's advert lol
    (I would only call it "AAA" when it would be as capable as Skyrim AI)
     
    Last edited: Jan 8, 2018
    mattis89 and AGregori like this.
  5. Legorobotdude

    Legorobotdude

    Joined:
    Feb 19, 2016
    Posts:
    41
    Hello, is it possible to create AI that have guns with this AI? Thanks
     
  6. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Yes if you mean weapon with projectiles, no if you mean raycast based modern weapons.

    @BHS
    I made some code changes to debug for you.

    This is the bug fix after PhysicsRaycast with a new condition checking objects are not null.

    Code (CSharp):
    1.  
    2.        //Check for obstructions and incrementally lower our AI's stopping distance until one is found. If none are found when the distance has reached 5 or below, search for a new target to see if there is a better option
    3.            if (Physics.Raycast(new Vector3(transform.position.x, transform.position.y+EyeHeight, transform.position.z)+transform.forward, (direction), out hit, (AttackDistance+RunAttackDistance))){
    4.  
    5.                 if (hit.collider != null && hit.collider.gameObject != null && CurrentTarget != null && CurrentTarget.gameObject != null)
    6.                 {
    7.  
    8.                     if (angle > 45 && hit.collider.gameObject != this.gameObject && hit.collider.gameObject != CurrentTarget.gameObject || hit.collider.gameObject != CurrentTarget.gameObject && hit.collider.gameObject != this.gameObject){
    9.  
    10.                        TargetObstructed = true;
    11.  
    12.                        if (AIAgent.stoppingDistance > StoppingDistance+5 && !BackingUp && !IsTurning && WeaponTypeRef == WeaponType.Ranged){
    13.                            AIAgent.stoppingDistance -= 5;
    14.                        }
    15.                        if (DistanceFromTarget <= TooCloseDistance && !BackingUp && !IsTurning && WeaponTypeRef == WeaponType.Ranged && BehaviorRef != CurrentBehavior.Companion || DistanceFromTarget <= TooCloseDistance && !BackingUp && !IsTurning && WeaponTypeRef == WeaponType.Melee){
    16.                            StartCoroutine(TooClose());
    17.                        }
    18.                    }
    19.              
    20.                     //If our AI's view becomes obstructed, and the object is another potential target, switch targets to the said AI it is most likely obstructing our AI's view of its original target.
    21.                     if (angle <= 45 && TargetObstructed && hit.collider.gameObject != this.gameObject && hit.collider.gameObject != CurrentTarget.gameObject && hit.collider.GetComponent<Emerald_AI>() != null){
    22.                        SearchForTarget();
    23.                    }
    24.                              
    25.              
    26.                     if (angle <= 45 && hit.collider.gameObject == CurrentTarget.gameObject && !IsTurning) {              
    27.                                     TargetObstructed = false;                                    
    28.                     }
    29.                 }
    30.  
    31.            }
    32.  
    But this is not enought, the error happens again
    Code (CSharp):
    1. if (angle <= 45 && hit.collider.gameObject == CurrentTarget.gameObject && !IsTurning) {      
    We must re check objects not null , because SearchForTarget() can change objects values we checked before.

    This is the bug fix with twice the same conditions check.
    I don't think it's a solution as it just stop some existing bug to happen.

    Code (CSharp):
    1. //Check for obstructions and incrementally lower our AI's stopping distance until one is found. If none are found when the distance has reached 5 or below, search for a new target to see if there is a better option
    2.             if (Physics.Raycast(new Vector3(transform.position.x, transform.position.y+EyeHeight, transform.position.z)+transform.forward, (direction), out hit, (AttackDistance+RunAttackDistance))){
    3.  
    4.                 if (hit.collider != null && hit.collider.gameObject != null && CurrentTarget != null && CurrentTarget.gameObject != null)
    5.                 {
    6.  
    7.                     if (angle > 45 && hit.collider.gameObject != this.gameObject && hit.collider.gameObject != CurrentTarget.gameObject || hit.collider.gameObject != CurrentTarget.gameObject && hit.collider.gameObject != this.gameObject)
    8.                     {
    9.  
    10.                         TargetObstructed = true;
    11.  
    12.                         if (AIAgent.stoppingDistance > StoppingDistance + 5 && !BackingUp && !IsTurning && WeaponTypeRef == WeaponType.Ranged)
    13.                         {
    14.                             AIAgent.stoppingDistance -= 5;
    15.                         }
    16.  
    17.                         if (DistanceFromTarget <= TooCloseDistance && !BackingUp && !IsTurning && WeaponTypeRef == WeaponType.Ranged && BehaviorRef != CurrentBehavior.Companion || DistanceFromTarget <= TooCloseDistance && !BackingUp && !IsTurning && WeaponTypeRef == WeaponType.Melee)
    18.                         {
    19.                             StartCoroutine(TooClose());
    20.                         }
    21.  
    22.                     }
    23.  
    24.  
    25.                     //If our AI's view becomes obstructed, and the object is another potential target, switch targets to the said AI it is most likely obstructing our AI's view of its original target.
    26.                     if (angle <= 45 && TargetObstructed && hit.collider.gameObject != this.gameObject && hit.collider.gameObject != CurrentTarget.gameObject && hit.collider.GetComponent<Emerald_AI>() != null)
    27.                     {
    28.                         SearchForTarget();
    29.                     }
    30.  
    31.                 }
    32.  
    33.  
    34.                 if (hit.collider != null && hit.collider.gameObject != null && CurrentTarget != null && CurrentTarget.gameObject != null)
    35.                 {
    36.                         if (angle <= 45 && hit.collider.gameObject == CurrentTarget.gameObject && !IsTurning)
    37.                         {
    38.                             TargetObstructed = false;
    39.                         }
    40.                 }
    41.  
    42.             }
     
    Last edited: Jan 8, 2018
  7. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151

    That settles it.. I'll be waiting.. I bet theres a bit fight between Emerald and ICE....:p
     
  8. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    lol

    About ICE , it's a great plugin to make complex AI without coding, but i gave up because of some issues like pooling broken after update and others bugs. It was not stable enought.
    It lacks demos tutorials to explain how to create common behaviours, there is many simple behaviours i could not figure out to do them while they took me some minutes in nodeCanvas.
    Perhaps i'll come back using it when it will get more updates and bug fixes.

    Because the AI i'm making is not wildlife or complex AI animals, but simple rpg AI, Emerald is lot more appropriate , it's lightweight, easy to use, while performance is also better.
    And it's easy to extend with my own code for rpg and some new AI features.
     
    Last edited: Jan 8, 2018
    BryanO likes this.
  9. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Yes. I stopped using it too.. but in 1.4 pooling works. And theres an update coming in the weekend , with more demos and tutorials on youtube how to set up it all. ...

    Yes I feel emerald works good with rpg and its coming great but.. I gave quite complex situations and wildlife so..
     
  10. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I just tried Ice last update and pooling is still broken with pool and recycle on.
    New spawns creates a new objects in scene list instead of re using previous ones (previous ones are just deactivated , they stay in the scene).
    Culling is not working with a distances like -7 and 7, creatures are always visible.
    Many demos are still broken or work randomly , for example cover demo gets sometimes all creatures staying around one position or creatures keeping running against a cover whatever the player is around.
    Letting demos broken shows a plugin not fully working and broken, when they are supposed to showcase your product capabilities and stability :rolleyes:

    I know the author doesn't have lot of time to put in the plugin , but what i expect from plugins i put money on is to get all advertised features fully working and good stability (not random issues behaviours, not working features or bugs).
    I think Ice is trying to cover too much AI features (wild life creatures, characters, melee, fps ...) while it should cover less and got them working perfectly and stable.
    Anyway many other users get Ice working as they need for their needs, so that's also cool lol
     
    Last edited: Jan 8, 2018
    mattis89 likes this.
  11. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @zenGarden : Emerald is broken too, and it's not just the (severe) Ranged issues you posted.
    Stationary types are locked in an anim loop, playing their initial anim indefinitely without randomly progressing to other anims.
    Dynamic waypoints are buggy for Passive types, as they are locked in a circle loop.
    Just from the top of my head.
     
    mattis89 likes this.
  12. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Waypoint for passive creature works fine, you got only two possible behaviours with waypoints : loop and reverse.
    Using "dynamic" instead of waypoints in wander type also works, the creature wanders randomly around.

    There is a bug , i got two idle animations for stationary creature, but second animation never plays. This is what i call a small bug lol

    BTW, most plugins i baught about complex AI have bugs, but crashing bugs like Emerald has should not happen.
    The only way to get things working prefectly as you want is with AI designer systems like FSM,BT,Goap (Bolt FSM, Playmaker, NodeCanvas ...).
     
    Last edited: Jan 8, 2018
  13. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    What I need is a bugfix from BHS, not you confirming or downplaying the bugs, to be honest. Trust me, dynamic waypoints are broken too if you wait 30 sec or more. These "small" AI bugs add up and make the asset less than useful in an actual Steam game.
     
    mattis89 likes this.
  14. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I have no issues, after three minutes, the creature continues following waypoints when it's waypoints , or continues walking randomly around when it's dynamic.
     
  15. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    I too haven't had any troubles with waypoints or dynamic wandering. The only iffyness I've encountered is the ranged types running backwards really far and then forwards again when they are too close.

    I've also primarily been using 5.6.4 but I haven't tested fully in 2017.1 yet.
     
  16. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Well, I'm using 2017.2.1 with Emerald 2.0.1, and my dynamic AI's are all broken: they wander around, do only 1-2 sec of their grazing anims (never complete them), and lock into a small circling loop soon after.
     
  17. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I'm using latest 2017.3 , and only big issue is the crashing bugs resolved with a temporary fix i posted.

    Can you post a screenshots of Temperament panel and AI / Movement / wait settings ?
    I have two passive creatures and they just wander as expected.
     
    Last edited: Jan 8, 2018
  18. BHS

    BHS

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

    Because there are so many posts regarding some of the release bugs, I will do a group response.

    Every bug that has been posted here is being tracked and fixed. I am in the process of responding to 10+ emails a day, working on creating integration tutorials and documentation, tracking and fixing bugs, and responding to the forums.

    I am well aware that there are some bugs and I am in the process of fixing them. I am hoping to have an update that will be submitted within the next 3-5 days. If anyone would like the update sooner, I would be more than happy to provide it early. I apologize for inconveniences and I will get an update out as soon as possible. :)
     
    Last edited: Jan 8, 2018
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I'm looking into your issue with dynamic waypoints and have not been able to recreate it.

    If you want your AI to generate waypoints after more than 1-2 seconds, set your Min and Max Wait Seconds to a higher value. This is what controls how often a waypoint is generated. This option is found under AI's Settings>Movement>Wait Settings. Also, ensure that your AI's animations are set to loop.

    The dynamic waypoint option generates random waypoints within a radius. If you want it to generate in a larger radius, set your Dynamic Wander Range to a higher value. This option can be found under Temperament>Wander Type. You can set it up to a value of 300 which will allow your AI to have a much large wander radius that doesn't look like it's wandering in a circle.

    Also, I was able to pinpoint this issue and fix it.
     
  20. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    98
    Last edited: Jan 9, 2018
  21. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    I have the same problem as @Gregorik . My AI will be stuck on one animation (is it idle? is it turning? I don't know which one it is) and will just repeat this nonstop. I can get the AI to detect me and run to me, but it will not do any attacks, melee or ranged, no matter how many times I set up AI with different models, options, etc.
     
    AGregori likes this.
  22. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Okay thank you @BHS. My Wait Settings are way high, so it's not that, but I suppose it's a local problem on my setup. I'll have to figure it out.
     
  23. VENOMOUS09

    VENOMOUS09

    Joined:
    Dec 27, 2014
    Posts:
    37
    I need the Game Kit Controller (setupTutorial) can you please post how to setup with this


    thank you
     
  24. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @BHS, please look into this NullRef before releasing the new version, getting it constantly on 2017.3.0 from multiple AI's on the scene:

    NullReferenceException: Object reference not set to an instance of an object
    Emerald_AI.OnTriggerExit (UnityEngine.Collider C) (at Assets/Emerald AI 2.0/Scripts/System/Emerald_AI.cs:1234)
     
  25. BHS

    BHS

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

    Right now I'm working on a getting a quick update out to address some bugs with Emerald AI. After that, I will continue making integration tutorials. The Scifi Top Down Game Template has been added to the list of assets to cover.


    Hey there!

    The idle issue has been fixed with the newest version I'm currently working on.

    Can you please tell me your setup as it will help me better find the issue. From what I tested, Stationary AI are reacting to targets fine. Ensure that your AI are using the proper tag and layer. Please refer to the documentation section here to explain how Emerald's tag system works.


    Hey there!

    I'm working on a quick update for Emerald AI. After this, I will continue making integration tutorials. The developer has plans to integrate Emerald AI with Game Kit Controller so there will be no tutorial needed. I can provide more information regarding this when it's available. However, I will still make a tutorial covering integration with Game Kit Controller and Emerald AI for now.


    I was able to find out what was causing this issue. This is happening because you have an Emerald AI tag on a non-AI object that doesn't have the Emerald AI script on it. You need to use the Non-AI tag, located in the Detection Options, for non-AI objects. I have fixed this error by checking for the Emerald AI script before calling it, which resolves the error from happening. This will fix will be included with the update I'm currently working on.

    Non-AI Tag.png
     
    Mark_01 and AGregori like this.
  26. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi @BHS

    About tags, i find the system really confusing.
    When it's not Unity tag system you should use another world like "faction" or "category" for other stuff.
    It should really need simplification and "faction" manager to define clans and their affinity before simply setting them in AI instead of setting them per AI.

    Will you plan adding ranged raycast based AI ? modern weapons, magic beam spell, sci fi.
    I hope you took a look at my previous bug fix.

    Last, do you have some estimated month when you think you'll got new features ?
    - better ranged AI navigation and behaviours, move when hit instead of staying static, positioning differently around player when possible, can randomly strafe around before attacking again
    - actions and actions chains
    - random for decisions and actions
    - priorities for decisions and actions
    - melee combat ticket system around the player ?

    Well i don't know what is really planned and what features we proposed can be considered and what features are perhaps too much and making the plugin too complex so the user should code it instead to customize the plugin as he wants.
     
    mattis89 likes this.
  27. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    From what I gather, the tagging system seems to be correct, as the AI will successfully do:
    1. Walk around the level (when it's not bugging out in the idle animation)
    2. Detect me and RUN straight to me
    3. Run AWAY from me if I come too close

    What it can't do, is use an attack animation, or start attacking, or send a projectile, or use a melee strike. I'll provide a screenshot in another post as I'm not home yet.

    Also, I agree with the above poster, please use the words Faction, or Category, or something other than Tags as it might be still confusing me and I wouldn't know it.

    ***Edit - Inspector view of the AI models:




    Player's Tag and Layer are:
    1. Player
    2. Ignore Raycast

    Also, ignore the Faction 1+2 stuff. Just put it in there to keep me focused.
     
    Last edited: Jan 11, 2018
    zenGarden likes this.
  28. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    98
    Thank you, I will be waiting, I will continue to work in another game for now. No need to be fast on that.
     
    BHS likes this.
  29. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @BHS, the Passive Dynamic idle/grazing animations issue is ongoing (on my rig). It's relatively subtle but annoying, especially for future players of an actual game. So: with high Wait Time settings and a wide dynamic wander radius, NPC's interrupt their own grazing animations regardless of wait settings, and they often get stuck circling around themselves.
    Again, it's not immediately noticeable, but it's effin' annoying when meeting NPC's in a game. I can provide a video capture if needed.
     
  30. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    I would totally want to see that..
     
  31. BHS

    BHS

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

    I totally agree with renaming the target tags to faction. I took a look at your previous fix. I believe I found a permanent solution as I was able to test 100 AI (50 vs 50) without receiving an error. I tested this about 20 times with all sorts of different settings using ranged vs ranged, melee vs melee, and melee vs ranged.

    Emerald AI uses raycasts for its ranged combat. If a target becomes obstructed, the AI will move closer to get a better shot.

    Thanks for the rest of the suggestion. I think those would fit well with Emerald.


    The reason your AI cannot attack is because you have your AI using the Ignore Raycast layer. Raycasts are needed to properly calculate an AI's attack so they can't hit through walls and they don't fire projectiles when their target is obstructed. If an AI is using the Ignore Raycast layer, the AI cannot see it as a properly target. Using a different layer will resolve your issue.


    The idle animations not changing have been fixed with the version I'm working on. It should be submitted within the next couple of days. If you need it early, PM me and I'll send you the fix early.

    As for your other issue, I'm not sure what it could be as I have yet to be able to recreate it. If you could provide a video, it would be appreciated. My only thought is that it's an alignment bug, that I fixed with the new version that isn't yet released. Having a video of the problem would allow me to determine this.
     
    Neviah and AGregori like this.
  32. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    If there is no line of sight, like melee AI all around the player, whatever ranged AI comes closer won't change anything.
    This should be a player script to check one direction per frame with raycast for example to expose available line of sight.
    Anyway it's more advanced AI than rpg game AI, and perhaps its' better each user code such advanced features if he needs them instead of adding too much to Emerald making it become too complex.

    Good job.
     
    Neviah likes this.
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Emerald has a separate raycast for melee attacks. This is the 45 degrees attacking limit you see in some of the code you've posted of Emerald. This is also responsible for keeping AI from attacking through walls or obstructions.

    Thanks!

    As for the factions suggestion, is this along the lines of what you were suggesting?

    Emerald AI Factions.png
     
    Neviah likes this.
  34. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    (Never mind the 13 fps, it's because of Profiler under 2017.3.0: I can make a 100 fps vid if needed).
    So the video shows the 3/3 self-interrupted grazing anims and the circling.

     
    Last edited: Jan 11, 2018
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Thanks for providing the video.

    It's a little hard to tell, due to the frame rate, but it looks like your AI is circling because your AI's Stopping Distance and its Agent Radius are too low. This makes the AI unable to reach the generated waypoint, which is why it keeps trying to circle around to reach it. Increase your Stopping Distance to about 4 or 5 and your Agent Radius between 0.5 and 1 to see if this resolves your issue. This may also be causing the interrupted idle animations issue.

    The Agent Radius can be found at AI's Settings>Nav Mesh Settings and the Stopping Distance can be found at AI's Settings>Movement.
     
  36. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Stopping distance was 5 in the video, I changed Agent Radius to 1 and it's all the same: interrupted idle anims and circling. So it remains unresolved.

    (I forgot to turn off Profiler recording in the video, so it took an incredible 60-70 fps hit, a known major bug in 2017.3.0, to be fixed in a later patch.)
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    My apologies for the inconvenience this is causing. I have tried recreating this issue with many AI and have not been able to recreate it, even with your exact settings. This leads me to believe the issue is related to your scene or AI model. As soon as I can recreate it, I can provide a solution.

    Try seeing where the AI's dynamic waypoint is being generated. You can see this by doing the following:

    Select the NavMesh tab
    NavMeshSettings.png

    Watch your AI in the scene view while this tab is active and in runtime. You will be able to see where the waypoint is being generated.
    NavMesh Waypoint.png

    If your waypoint is being generated too high or too low, your AI would circle around trying to unsuccessfully reach it. Maybe the issue is related to your generated NavMesh. If you could provide a screenshot of it, it might help me pinpoint what's happening.
     
    AGregori likes this.
  38. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @BHS, thank you for taking the time with this issue. (I've actually erased ICE from my project the other day as it proved way too convoluted for the purposes of my urban adventure game -- so I'm looking forward to using Emerald exclusively, with or without this particular bug/issue).


    Unity_2018-01-11_22-09-17.png Unity_2018-01-11_22-10-09.png Unity_2018-01-11_22-10-18.png
     

    Attached Files:

    Last edited: Jan 11, 2018
  39. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I don't understand the need of layer, or why is there Player tag or UI Tag , or why Non Unity tag exists , why you need tags ?

    For example why not using a general Faction manager panel, because factions can be used by many different prefabs AI

    Number of factions : 3
    Factions list :
    - villagers
    - hunters
    - monsters

    You could define factions affinity in the same panel selecting each faction, then defining affinities :
    Faction select : "villagers"

    - Friendly list factions for "villagers" : list select : "hunters"

    - Neutral factions for "villagers" : list select : none

    - Enemy faction for "villagers" : : list select : "monsters"


    While for each AI prefab you could specify if you need what tag the clan AI must attack first :
    Monster Melee prefab example creation :
    - Faction : "monsters"
    - Enemy faction priority character tag : "Player" (some other tag or none)

    So for each new prefab AI you would need only two infos to definie it's clan :
    - faction
    - optionnal enemy priority tag

    It's very simple while there is no more confusion about tags , non entity tags, layers or UI tags.
    Just make it simple.


    Does it happens with Emerald AI prefabs if you use one in your scene instead of your character model prefab ?
    Could you provide some small prototype scene download we could check ?
     
    Last edited: Jan 11, 2018
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    You’re welcome, it’s great to hear Emerald is your system of choice.

    Thanks for providing the screenshots. When I get the chance, I’ll look further into this to see if I can figure out what’s going on.


    Unity Tags are needed to differentiate Emerald AI objects from scene objects. A Unity Tag is the best method for this as it doesn’t need to rely on any script.

    The reason Emerald uses Unity Tags for AI units is because some systems, such as RFPS, are dependent on Unity Tags. This would severely limit users to only being able to use the tags the system supports.

    Specific layers are used to allow Emerald’s search function to only include objects of the appropriate layer. This significantly helps improve performance. Without it, the search function would pull hundreds of scene objects wasting valuable performance.

    Thanks for your suggestions. I’m not entirely sure how the faction system will work, but for now, I’ve simply renamed the word tag to faction. This is so I can submit the update to get everyone the bug fixes they’ve been requesting. After that, I will design a better menu for the faction system.
     
    Neviah likes this.
  41. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    As any Emerald AI has a script there is no gain avoiding script variable.



    ok.

    I don't know, but as i presented it, i would see something very simple.
    While your system is confusing about "player tag", "Ai attacks player", Ui tag, non UI tag.
    For example you don't need "AI attacks player" when factions affinity is defined, it's automatic.
    Anyway, Emerald works so it can stay as it is.
     
    lawsochi likes this.
  42. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Not all objects have a Emerald AI script. Emerald AI agents need a way to differentiate players from AI and other non-AI objects. Your tag suggestion, from what it sounds like, would require all objects to have a Emerald AI script. How else can an AI tell the different from a player and a non-AI object, efficiently, without a tag or script? The UI tag is used so the UI system is only enabled when the object of the appropriate tag is within range. If it's not, the UI system is disabled.

    Not relying on scripts or any other external source, for object detection, is going to be the best and most versatile for users. This is why I was able to easily integrate each character controller system as these are dependent on their Unity tags.

    I am trying to keep Emerald AI as versatile as possible. I do like the Enemy, Friendly, and Neutral category suggestions. While I agree I can add some type of further refinement to the newly renamed faction portions, right now, my focus is getting the bug fixes you and others have been requesting. After that, I will get started on some of the features you have been suggesting.
     
    zenGarden likes this.
  43. BHS

    BHS

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

    Emerald AI 2.0.2 has been submitted and is awaiting approval. This update addresses some of the release bugs users have found. If I have missed anything, please be sure to let me know.
    • Switched tag checking to .CompareTag() as it's more efficient.
    • Added a slider to Stopping Distance to keep it from having a value of less than 1 as a value below 1 could result in an AI being unable to reach their waypoint.
    • Added a slider to Agent Radius to keep it from having a value of less than 0.1 as a value below 0.1 could result in an AI being unable to reach their waypoint.
    • Added an option to adjust an AI's Avoidance Quality from the editor. This is located under AI's Settings>Nav Mesh Settings.
    • Fixed an error that happened in larger battles that resulted in a NullReferenceException error. A stress test was done with 100 AI (melee vs melee, melee vs ranged, and ranged vs ranged) to ensure the issue had been resolved.
    • Fixed an issue where where all of an AI's idle animations wouldn't play when using the Stationary Wander Type.
      • An option has been added for users to customize the amount of time it takes to switch to the next idle animation when using the Stationary Wander Type. This can be found under the Wander Type option when using the Stationary setting.
    • Fixed an issue that caused an AI's alignment to be off, and to not rotate properly, if its Base Offset was lower than 0.
    • Fixed an issue that didn't allow AI to properly detect Non-AI objects.
      • For users who want to add custom code to damage non-AI object from projectiles, this can be found within the projectiles script. This will be added to the documentation.
      • Added an information note to the editor clarifying that the non-AI object layer needs to be added to the AI's list of detectable layers.
    • Renamed AI Tag to Faction and renamed Total Target Tags to Opposing Faction as using multiple references to tags could cause some confusion. The Faction is the name used to control combat reaction with other AI. This is the name other AI will use when looking for targets.
     
    llJIMBOBll, Mark_01, lawsochi and 4 others like this.
  44. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Thanks @zenGarden for your concern, that's a good question. I'll upload a small scene here.
    I'd like to hear from @Neviah if his pretty similar AI issue is resolved.

    "An option has been added for users to customize the amount of time it takes to switch to the next idle animation when using the Stationary Wander Type."

    An amazing option, it'll be very useful in the wild!
     
    Last edited: Jan 12, 2018
    zenGarden likes this.
  45. erichey

    erichey

    Joined:
    May 5, 2017
    Posts:
    20
    Hi,
    I'm loving Emerald AI 2.0 so far! Is there a checkbox for ragdoll on death anywhere?
     
    Neviah likes this.
  46. CentViRe

    CentViRe

    Joined:
    Dec 6, 2016
    Posts:
    15
    I have problem with Range combat. Attack distance it maximum 40, but enemy attacking only if nearby like melee
     
  47. lawsochi

    lawsochi

    Joined:
    Oct 24, 2016
    Posts:
    107
    Hello everybody.
    It is very pleasant to see how Emerald AI grows and improves. Thanks to the author for his activity. I really liked the proposal with the factions. for the user it is more understandable, but inside, "under the hood" this can work as tags, if this is most effective.
    A switch is a living object / not animate object, it will make it easier to perceive the setting of the case when ai should interact with non-ai (example with boards as previously written, or for example, ai may be afraid of fire and escape from it).
    In addition, the introduction of fractions as concepts will help, I hope, in the future to make a system for changing the relations between factions, for example, if I attack members of a neutral faction, then upon reaching a certain threshold this faction becomes hostile, and vice versa, the faction's help , treatment, etc.) will change the relationship well, the best. It's not very hard to do, I'm not mistaken))) ?. it was a very cool feature))
    In any case, thanks for your good work!
     
  48. micuccio

    micuccio

    Joined:
    Jan 26, 2014
    Posts:
    143
    Hi there, I am using Emerald with success since a bit now, but still I have an issue concerning the Dynamic wandering. The issue is related to the unrealistic fast rotation that the AI has when the new generate Waypoint is in opposite direction of its current orientation. It's very uncanny and break the immersion. could be possible, before generating the Waypoint to check the angle? and if bigger than, for example, 30 deg, to find another point with a lower angle? I hope not to be too confuse.

    Best regards,

    Dom
     
    Mark_01 and AGregori like this.
  49. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    You can change the rotation speed ?

    You would limit a lot the wander feature if your AI direction would not exceed 30°, it would not be a wander.
    I think only keeping new waypoints that have some minimum distance would allow to have a slower rotation along the distance.
     
    BHS likes this.
  50. taralees

    taralees

    Joined:
    Aug 29, 2014
    Posts:
    41
    Question .
    Do you guys / gals have you any Videos on getting started - Like start to Finish....I have a Learning problem...anyway I bought the Emerald AI and the same animals you showed in your videos for Unity . but it seems I still don't understand what to do....

    Thanks