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

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    @BHS Just a tip for the new particle system in Unity 5.3+, you may wanna replace
    Code (CSharp):
    1.  clone.emissionRate = 0;
    2.  
    on line 635 with
    Code (CSharp):
    1. #if UNITY_5_3
    2.             ParticleSystem.EmissionModule emission = clone.emission;
    3.             emission.rate = new ParticleSystem.MinMaxCurve(0f);
    4. #else
    5.             clone.emissionRate = 0;
    6. #endif
    and
    Code (CSharp):
    1. #if UNITY_5_3
    2.                     ParticleSystem.EmissionModule emission = clone.emission;
    3.                     emission.enabled = false;
    4. #else
    5.                     clone.enableEmission = false;
    6. #endif
    on line 1702 to remove the errors in the console. Also, I don't want to be pushy, but Mecanim would be really nice, along with multiplayer optimisation (only running if there is a player within a certain radius would reduce agent runtime calculations) and support for multiple player tags (just for MP).

    Thanks

    Stormy102
     
  2. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    @BHS Also glad to say that the AI system is working now perfectly with the AI running from the player :D Must have been some really messed up prefab so I redid it from scratch. Gotta give it 5* now. Exactly what I wanted. Just want the features I mentioned above to implement and I'm gonna zip it :p +1 happy customer
     
    BHS likes this.
  3. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    @BHS Any idea when to expect updates?
     
  4. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Thanks, we will be sure to update this with the next update.

    AI are disabled when if you set them up with a LOD Group. This allows them to be disabled then they are not in range.


    Thanks! Great to hear you're enjoying Enerald AI.
     
    Stormy102 likes this.
  5. Silvermurk

    Silvermurk

    Joined:
    Apr 29, 2016
    Posts:
    164
    A question to Author.
    Heared alot of your AI work, all positive :)
    So want to try to add it to one of my designs for strange wildlife sim.
    And coutple things i need to ask of you before buying an asset is:
    Can it work off-navmesh? (procedural generation occurs, and i don`t think i`ll be able to pre-cook navs for all spawned and stored parts of near endless map)
    And second one - any way this beauty can make it`s agents jump over said obsticle?
    (meaning can a wolf chasing a lamb for example jump over a fallen tree, instead of moving around lit?
    Thanks. WBR GreyFox.
     
    Dawar likes this.
  6. jf3000

    jf3000

    Joined:
    Dec 31, 2013
    Posts:
    166
    Why am I getting this message:

    Code (CSharp):
    1. "GetRemainingDistance" can only be called on an active agent that has been placed on a NavMesh.
    2. UnityEngine.NavMeshAgent:get_remainingDistance()
    3. Emerald_Animal_AI:MainSystem() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1274)
    4. Emerald_Animal_AI:Update() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1758)
    Terrain selected and baked
     
  7. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    make sure your navmesh agent is on navemesh. not above the nave mesh
     
  8. jailbar

    jailbar

    Joined:
    Nov 21, 2012
    Posts:
    49
    For those of you who may be having trouble with bullet damage on UFPS 1.6 (newest version), I have found a solution that works for me!

    So when I updated from UFPS 1.53 to UFPS 1.6, their new surface system and bullet script is slightly different which stopped my bullet damage from working. After spending about 15 minutes comparing their old bullet script to their new one, there are a few settings that need to be changed in it that some users may easily overlook. Also! The Emerald AI wiki still has a picture of the old layout...

    This is a screenshot of the new layout with working settings for me.



    Obviously the Range, Force, and Damage settings are your personal preference, but these settings are working fine. DamageMode is VERY IMPORTANT! This WILL NOT work on the default setting. The functional choice was 'Both' which seems to be working. It was originally set on DamageHandler. I tried 'None' and did not work, then I tried 'Both' and it seems to function correctly as it did on the old version.

    Also, the 'DamageMethodName' must be 'DamageFromPlayer' as explained on the Emerald AI Wiki.

    'Scan Type' and 'Impact Event' should be set according to the picture for best results.
     
  9. jf3000

    jf3000

    Joined:
    Dec 31, 2013
    Posts:
    166
    Places critter with legs onto navmesh, gets same result, places something completely different, same error.
     
  10. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Sounds like it's something to do with your navmesh. Try rebaking it?
     
  11. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    WHY IT TAKES SO LONG BETWEEN 2 Animal or NPC attacks ?
    ...looks - there is no way to make this gap faster than 1.5 second...
    AND - guys, can we have RFPS adapter, any soon, please,
    because they just updated to V1.6, with addition of nice Bow weapon, etc ...
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Thanks for this!

    We will be sure to update the Emerald Wiki site with this updated info.


    This happens when animals are not properly on the NavMesh. Ensure that your animals are on your NavMesh and that they are not hovering too far above it.



    This is because Emerald takes the length of the AI's attack animation into its attack time to ensure that the animation fully plays before beginning another attack.
     
  13. jailbar

    jailbar

    Joined:
    Nov 21, 2012
    Posts:
    49
    Is it possible to change the mood of an NPC or AI in real time? For example, I want to trigger an event that changes the AI from a neutral personality to a scared/fleeing personality.

    I haven't tried this and was wondering if was wondering if anyone else has.

    Please let me, thanks!
     
  14. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
    Hey,does this contain a player respawn system too?
     
  15. BHS

    BHS

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

    Yes, it's totally possible. You can also set an animal or NPC to defensive which will only attack if attacked first.

    You would just change the aggression variable to 3 when attacked.


    Hey there!

    Emerald doesn't have a player respawn system, but it wouldn't be hard to add.

    You would just watch the player's health with a custom script. When the player's health falls at or below 0, you could delete the player object then instantiate another player prefab to a spawn point somewhere in your scene.
     
  16. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    @BHS So after releasing an update a few months ago, it would be nice to have an update that fixes a few of the small issues that I have, hopefully ASAP:
    1. Multiple player tag support - the ability to have multiple tags like Player, PlayerActive, Building etc. :D
    2. Multiplayer optimisations - the way that I see would be the best is to still render the object with it's idle animation but only run movement/attack calculations when the player is within an "Active Radius" (again, using OnTriggerEnter)
    3. Issues when making changes in play mode - it causes an InvalidOperationException when these are modified - looks like the issue is in GUI.changed and it tries to set the scene dirty.
    4. Namespace the stuff to EmeraldAI or something like that.
    5. Make the enums public :rolleyes:
    And maybe some other new features - not necesserily immediately!:
    1. Mecanim Support - Support for using mecanim animation controller
    2. Integration with UniStorm - animal sleeping etc.
    3. Flying/Swimming AI :cool:
     
    BHS, Dawar and Sliceandkill like this.
  17. BHS

    BHS

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

    Thanks for this. We will make sure these fixes and improvements are taken care of. As soon as we get our UniStorm update finished, we will get the Emerald AI 1.3 update finished.
     
    Stormy102 likes this.
  18. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Great! Any ETA on this? This month/next month? ;):)
     
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Emerald AI 1.2.5 has been submitted.

    We have submitted a small update for Emerald AI, update version 1.2.5. This fixes some issues, such as AI being able to sometimes hit players while being out of range. We have also added a working 3rd person weapon system. This makes it easier for users to use Emerald AI with 3rd person setups without having to program a system themselves. This is also a playable demo that users can test called 3rd Person Example.
     
    Last edited: Jun 20, 2016
    Stormy102 likes this.
  20. minneth

    minneth

    Joined:
    May 8, 2015
    Posts:
    5
    I'm experiencing a few oddities recently. Hoping someone might be able to help.

    First of all, it seems when my enemy AI's attack, they run right for the player then UNDERNEATH the player. I'm sure this has got something to do with the step height or something, but I'm unsure how to fix it.

    I've also tried changing the stopping distance of the AI, hoping it'll stop before it gets right up to the player but this hasn't helped.

    Any advise?

    Thanks.
     
  21. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Are you using the included camera system or are you using a custom one?

    AI should stop before reaching their target. If your AI aren't stopping, trying increasing their stopping distance.
     
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Emerald AI 1.2.5 has been accepted and is now live!

    This is a smaller update, but consists of some important fixes and improvements.

    Emerald AI 1.2.5
    *
    Added a 3rd person weapon system so users can use 3rd person cameras and characters with Emerald AI
    * Added a 3rd person example demo to the Example Scenes
    * Fixed an issue that would sometimes allow AI to attack outside of their attacking range
    * Fixed the warning messages regarding particle effects
     
    Stormy102 likes this.
  23. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Great!! Just as a question, can we make the system as generic as possible? For example, instead of having a playerhealth script, instead can we have an EmeraldAI.EmeraldPlayerComponent with callbacks:
    Code (CSharp):
    1. public System.Action OnAIMove;
    2. public System.Action OnAIAttack;
    3. public System.Action<float> OnAIDoDamage;
    4.  
    So we can just go
    Code (csharp):
    1.  
    2. GetComponent<EmeraldPlayerComponent>.OnAIAttack += AttackFunctionCallback;
    3.  
    And callbacks for the emerald AI too (maybe an emerald AI callback component?)
    Code (CSharp):
    1. public System.Action<string> OnAIPlayFootsteps; // For networking footsteps etc
    2. public System.Action OnAIDeath;
    3.  
    Look forward to your response. Would like something like this and multiple player tag support, along with multiplayer optimisations with the issues fixed that I mentioned for Emerald 1.3
     
  24. redchurch

    redchurch

    Joined:
    Jun 24, 2012
    Posts:
    63
    Any idea why the characters would be popping as they move?

     
  25. BHS

    BHS

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

    Thanks for the suggestions. We would like to make Emerald more like you have mentioned and we have plans to with the next version or two. Multiple tag support is planned for 1.3.


    Hey there!

    We have tested Emerald with many animated models and I have never seen this before.

    Could it have something to do with the character models you're using? It could possibly be their animations. Try using our supplied animated models to see if it fixes your popping issue.
     
  26. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
    Hello,

    I recently bought UFPS and Emerald AI I saw this tutorial (first one):
    http://emerald-animal-ai.wikia.com/wiki/Tutorials
    Damage Emerald AI with UFPS Projectiles and Melee Hits.
    But every time I does that Unity Freezes and stops working.
    Can you help me please?
     
  27. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Post some code and we can see what's happening. There is an updated UFPS conversion a page or two ago, try that instead.
     
  28. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
    Oh nevermind. I fixed that.But now I have another problem every time I press play the Hostile enemy dissapears.
     
    Stormy102 likes this.
  29. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
    I followed the tutorial on the wiki forum.
     
  30. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Have you baked a navmesh? Play in the editor and see if they really "disappear" or go to a weird location on their transform (happens to me sometimes... thanks Unity :confused:).
     
  31. beowulfkaine

    beowulfkaine

    Joined:
    Apr 3, 2014
    Posts:
    185
    Can this be used with the SteamVR Controller? It seems that it might not be compatible with it? Any ideas?
     
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    It hasn't been tested, but we can get it and try it out. If there's any setup process, we will post it here and on the Emerald Wiki.
     
  33. BHS

    BHS

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

    If you haven't got Emerald AI yet, the Asset Store has released some cool new packaged deals on the Asset Store called Asset Kits. These kits allow you to buy multiple assets together to save 20%-40% off of each asset included in the kit!

    Emerald AI is featured in the Survival Asset Kit.

    The Survival Asset Kit includes:
    Emerald AI
    Inventory Pro
    Energy Bar Toolkit
    uConstruct - Runtime Building System


    Where to get and information:
    To buy click here!
    For more information regarding how Asset Store Kits work, click here!

    This is all completely optional, but if you already have some of these assets on your to-buy list, it's a great way to save!
     
  34. BobbleHead

    BobbleHead

    Joined:
    Jul 3, 2012
    Posts:
    33
    Hello,

    with Emerald AI, can I set a 'feeding' area for an animal? i.e would a cow go and eat at hay? How about a bear hunting a rabbit?

    Thanks
     
  35. BHS

    BHS

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

    Passive AI like cows will wonder randomly and graze. There is no specific area for them to feed other than where they currently are.

    A bear AI will hunt another AI if it's within its attack area and if the prey size is less than or equal to the AI's Predator Size.
     
  36. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    47
    I use Emerald AI with Realistic FPS Prefab. The hostile NPC attack me and I can attack it, but the hostile animal doesn't attack me. Why?

    [EDIT]
    Problem solved. To attack the player, the animal wants large predator size.
    However, tutorials for RFPS would be very useful.
     
    Last edited: Jul 14, 2016
  37. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
    Hey I have a little problem I created an AI on an object, attached all the anim that requires but that object (a skeleton) is not using it I mean yeah it wonders around but like "Jesus" I mean he stands in the default postion he is not using the walk animation that I attached.How can I fix this?
     
  38. BHS

    BHS

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

    Do you have an animation component attached to your AI and are the animations that are being used applied to the animation component? If not, it sounds like that's what's happening.
     
  39. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    yes same Problem was on me ,put all components from examplae ai to your mesh ,that will be work.
    By the way i have a other question,how can i disabel this error´s :
    NullReferenceException: Object reference not set to an instance of an object
    Emerald_Animal_AI.OnTriggerExit (UnityEngine.Collider other) (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:2999)
    Your player needs to have a PlayerHealth script attached to it.
    UnityEngine.Debug:LogError(Object)
    Emerald_Animal_AI:OnTriggerEnter(Collider) (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:2761)

    i will not use the PlayerHealth script.
     
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Emerald AI needs a PlayerHealth script attached to your player. It doesn't have to be used and can be disabled. It is used as a reference for determining who the player is.
     
  41. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
    I attached the animation component to the AI and still it does not work.It still stands in the T pose and now I have this errors too :
    The animation state RunJason could not be played because it couldn't be found!
    Please attach an animation clip with the name 'RunJason' or call this function only for existing animations.
    UnityEngine.Animation:CrossFade(String)
    Emerald_Animal_AI:MainSystem() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1334)
    Emerald_Animal_AI:Update() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1762)




    The animation state RunJason could not be played because it couldn't be found!
    Please attach an animation clip with the name 'RunJason' or call this function only for existing animations.
    UnityEngine.Animation:CrossFade(String)
    Emerald_Animal_AI:MainSystem() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1339)
    Emerald_Animal_AI:Update() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1762)



    The animation state RunJason could not be played because it couldn't be found!
    Please attach an animation clip with the name 'RunJason' or call this function only for existing animations.
    UnityEngine.Animation:CrossFade(String)
    Emerald_Animal_AI:MainSystem() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1581)
    Emerald_Animal_AI:Update() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1762)


    The animation state RunJason could not be played because it couldn't be found!
    Please attach an animation clip with the name 'RunJason' or call this function only for existing animations.
    UnityEngine.Animation:CrossFade(String)
    Emerald_Animal_AI:Wander() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:824)
    Emerald_Animal_AI:MainSystem() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1446)
    Emerald_Animal_AI:Update() (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1762
    )
     
  42. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
    Also I attached the animations to the animation component
     
  43. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
  44. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    The Problem is the Animator and the Model is not in legacy rigged,Generic or humanoid but for legacy Animations you must have a Model thats rig in Legacy,delete you Animator and go to Howly Shiet Avatar and rig Legacy.
     
  45. BHS

    BHS

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

    You need to make sure that your AI is using the Legacy animation setup. You can change it by going to the the model options of your model.
     
  46. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Regarding breeding...this is a simplistic question/suggestion, but you might have a "giving birth" animation, not nearly as explicit as it sounds, that simply involves the animal lying down for a few moments before the baby appears (maybe a fade in, rather than sudden pop-in). You might also have something like this for mating (two animals lay down next to each other, the hearts float above their heads, then moments later they get up). I'm thinking of Zoo Tycoon 2 here, that game did it well.

    Additionally, I didn't see it up there, but are you planning to include some type of pregnancy period as well? I can't say it would be super necessary, but it might be interesting. Might involve slightly different dynamics, different aggression levels or behaviors.

    Additionally, migration. Would it be possible to define an animal's "wander area" or whatever based on season? Additionally, can their wander area be defined by features, rather than a specific area on the map?

    Such as, I procedurally generate a terrain and stuff like trees. I want deer to automatically have a "wander area" where there are trees. Is this possible? I suppose it might be possible to use some other, separate system to look for trees within a certain range (say, create areas based on all trees and ten feet around them--and areas where there are lots of trees will be one continuous area, which breaks at rivers and meadows and such) and then define some grid. Would I be able to use that grid then to define the wander area of certain animals?

    Basically, how do I do it at runtime.

    Next, pack hunting. Plans to implement this? Flanking, cutting off members of a fleeing herd...would be great for wolves.

    It would be nice to have our own advanced behavior types--rather than have an animal generically be "Predator," be able to custom-define its behavior with relation to all other entities in the game. For instance, for a cat: Deer->Ignore; Chipmunk->Chase; Wolf->Flee.

    Of course you could take that a step further with herd dynamics...thinking about it...say each deer in a herd has a "power" of 1, while each wolf has a "power" of 3. Thus if four deer are approached by one wolf, they'll turn towards it and stand their ground or attack. But it two wolves approach, they'll run...so many ideas.

    Question for chickens in particular...plan on having eggs? Would be kind of neat to have them lay eggs, and then be able to pick them up (or have an NPC pick them up) and use them in cooking or something.
     
  47. Sphelps

    Sphelps

    Joined:
    Jun 9, 2013
    Posts:
    243
    What is next for Emerald AI?
     
  48. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
  49. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    Animals sleeping sounds great. Seems really simple to add, too.

    Could take it a step further, too, with stuff like audio sensors on the animals...if you make noise louder than some certain amount (within their range of course), they wake up. Or touch them (simply colliding with their model, or attacking them but not killing them).
     
    Stormy102 likes this.
  50. Theekshana-A

    Theekshana-A

    Joined:
    Sep 27, 2014
    Posts:
    81
    Hi there, I am using UFPS, and the animals aren't attacking me. When try to shoot them it also does not have any effects. I have changed the damage method on the bullet and also changed it so there is no damage handler. I also changed the 3 lines in the emerald AI script. I am not sure what I am doing wrong,