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
    I would like proper AI vision - allowing stealth instead of using a simple sphere collider. Also, I really need multiplayer support :( but it's not around yet so i'm having to write stuff myself - and all the changes get overwritten if I update so its a bummer for me
     
  2. BHS

    BHS

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

    Thanks for these suggestions. Some of these could be useful while some might be a little unnecessary. We don't want to bloat Emerald with too many specific features. Many of these could be handled with some external scripts that you could attach to your AI.

    A birth animation is something that can be added. I can see how it could potentially be useful. This would have an option to be disabled for users who don't want to use it.

    We like the idea of specific areas where AI can wander such as around trees. We're not entirely sure how this will be handled, but it is something that can potentially be added.

    With the next version of Emerald, we will make it easier for users to define the prey the can hunt/flee from. The plan is to implement some type of multiple tag/name system where users can define the animals they want the AI to hunt or flee from.

    This is something that can be done with an external script. You could also just have it lay an egg using the Breeding System. Instead of spawning another AI, it would just spawn some type of egg prefab.
     
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    There is a lot that is planned and being developed for Emerald. We will be discussing it more after our UniStorm 2.2 update is submitted which will be done soon.


    Thanks!

    We have seen these and they are great suggestions.


    Sight and hearing detection is something that is certainly being considered for Emerald AI.


    Hey there!

    This is because UFPS updated the way their damage script works. For an updated tutorial, see the post here: http://forum.unity3d.com/threads/re...y-herds-npcs-more.336521/page-14#post-2631648
     
    Stormy102 likes this.
  4. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    All sounding good, cool. I definitely understand that my ideas can get out of hand :p

    As far as having AI wander around things, have an option to select a GameObject, or GameObject type, like "trees," (I'm not entirely sure how Unity stores trees, because they don't show up in the hierarchy) then put an area around it within which they can wander.

    Thinking about it, that sounds very resource-intensive. It might, maybe, be more efficient to have each AI with this clause determine whether each random movement moves them outside of the range of a "tree." Still have the player select a GameObject or object type, but instead of building something around those, have the AI check if the next movement ends (or stays) within 15 feet or whatever of that object--and if not, recalculate.

    Just an idea, not sure how viable.
     
  5. Theekshana-A

    Theekshana-A

    Joined:
    Sep 27, 2014
    Posts:
    81
    I am trying to use a mesh collider instead of a box collider but it will not let me. And the animal is not attacking me.
    EDIT: They seem to attacking me but everytime I get close I go on top of the animal? and everytime I try to go down I get put back on top of the animal.
     
    Last edited: Aug 3, 2016
  6. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
    Hey I have a little problem with Emerald AI. I set up all the animations and the animator controller but now the only thing that the model is doing it's just following me looping the idle animation, otherwise it's just stuck in a T pose.How can I fix this?
     
  7. Tracomi

    Tracomi

    Joined:
    May 3, 2016
    Posts:
    12
    Also I set all the animations to the legacy thing that u said a while ago.
     
  8. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    47
    It is possible that the animals attack while they are running? And the damage would be inflicted when the animal touches you?
     
  9. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    @BHS ,

    Well I finally bought Emerald AI after nearly 12 months of fluffing about. Just for your reference I was convinced this time to buy because of the 25% reduction cost :)

    I am now about to purchase Muesla's Jurassic Park Volume 1 pack and I'd like to confirm that the static animations from this asset pack can be used in Emerald AI?

    cheers
     
  10. JC_LEON

    JC_LEON

    Joined:
    May 20, 2014
    Posts:
    520
    Hi I purchased the assset but i'm wondering if is there a way to have ranged enemy with weapons ,rifles etc.??and since i have yet my custom Player.cs scirpt that holds health, stamina and other survival aspects.. how can i figure to use my custom health script insted the Emerald health script?

    thannks..
     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This is because your Stopping Distance is too low. Increase it so the AI will stop in front of your player rather than on it.


    You will still need to add all the animations you are using to your AI with an Animation Component, if you haven't already done so.



    Yes, animals can attack while running with Attack While Running is enabled. There is also an option to add a run attack animation.




    Hey there!

    Great to hear. We have a lot of exciting stuff coming with our next update.

    We haven't tested this pack ourselves, but they should.


    With Emerald 1.3, we will have an option within the Editor for calls to custom health scripts. For now, you can follow the tutorial here with implementing your own health system except Step 3, you would add a call to your own health script: http://emerald-animal-ai.wikia.com/wiki/Tutorials#Replacing_Emerald.27s_Damage_System_with_UFPS.27s
     
  12. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Oooh a mention of an update? Care to share any information about whats coming? :D
     
  13. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    47
    Where is "Attack While Running"?
     
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Yes, we will give the details later sometime next week :)


    I believe it is located under the Animation Options.
     
    Stormy102 likes this.
  15. lukamas233

    lukamas233

    Joined:
    Jan 6, 2015
    Posts:
    29
    Hi, I have a question, how do I make a predatory animal fight another predatory animal in Emerald AI!
     
  16. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    Any update?
     
  17. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    @BHS Can you guys please provide a simple script that I could apply to an object that would increase the players health upon collision with the player? I'm stuck on this. Everything else works really nice. Very happy with Emerald AI.
     
  18. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Depends on your player health system. Some very simple psudo code here:
    Code (CSharp):
    1. void OnTriggerEnter(Trigger col)
    2. {
    3.     if (col.tag == "Player)// If our object is a player
    4.    {
    5.        GetComponent<PlayerHealth>().AddHealth(100f);//Call an add health function
    6.        GetComponent<PlayerHealth>().health += 100; // Or add health right on to their health
    7.    }
    8. }
    Reminder: If you want to use this code, the player must have a tag called "Player" and a health script (Insert the name of the class into the GetComponent<NameHere>() and the health variable in GetComponent<>().HealthVariableGoesHere. The collider must be set to IsTrigger otherwise this won't work.
     
  19. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29


    ha! i figured it out the same time you posted this. thanks for this reply
     
  20. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    I managed to get it to work on the player health scrip (built in Emerald AI script) with this:

    Code (CSharp):
    1. public bool GainHealth(int amount)
    2.  
    3.     {
    4.         if (currentHealth < 100)
    5.         {
    6.             currentHealth = Mathf.Min(currentHealth + amount, 100);
    7.             Debug.Log("Player gained health, now at " + currentHealth);
    8.             return true;
    9.         }
    10.         else
    11.             return false;
    12.  
    13.     }
    and this applied to whatever game object you want:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine.UI;
    5.  
    6.  
    7.  
    8.  
    9. public class Heal : MonoBehaviour
    10. {
    11.     public int HealthAmountToGain;
    12.  
    13.     void OnTriggerEnter(Collider collider)
    14.     {
    15.         if (collider.gameObject.tag == "Player")
    16.         {
    17.             if (collider.gameObject.GetComponent<PlayerHealth>().GainHealth(HealthAmountToGain))
    18.             {
    19.                 gameObject.SetActive(true);
    20.                 Destroy(gameObject);
    21.             }
    22.             else
    23.                 Debug.Log("Player is still at full health");
    24.         }
    25.     }
    26. }
    with collider on the character and said game object.

    Works a charm.

    Just had to modify the code slightly from this original source: http://videogamedesign24.com/tutorial-player-health-picking-up-items-causing-damage-in-unity/
     
  21. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    You're welcome. Glad to help ;)
     
  22. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    Has anyone been able to get the Exploder script to work on Emerald AI? Could you share your scripts? Gave it a solid few hours attempt with no luck. :(
     
  23. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    @BHS can you guys please tell me where in the Emaral_Animal_AI.cs script I should put events that will happen upon death of an animal? By events i mean external code snippet that will trigger something to happen.

    I understand there are certain events that will happen depending on what designation an animal would have (ie. if it is aggressive or passive). As a result there is no obvious place to insert other scripts/snippets that would affect any given animal upon it's death.

    Can you please tell me where I should put code that will affect an animal upon it's death. In my case i am trying to apply this to NPC types upon or just before their death.


    Code (CSharp):
    1. ExploderObject exploder = GameObject.Find("Exploder").GetComponent<ExploderObject>();
    2. exploder.gameObject.SetActive(true);
    3. exploder.transform.position = transform.position;
    4. exploder.Explode();
    5.  
     
  24. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    ANSWER: If you are trying to implement the Exploder asset into you Emerald AI project do the following:

    On line #1734 of the Emerals_Animal_AI.cs script add the following:

    Code (CSharp):
    1.  Exploder.Utils.ExploderSingleton.ExploderInstance.ExplodeObject(gameObject);
    1) Add Exploder prefab into the scene
    2) Add "Explodable" component to Hostile AI Example object
    Note that you can't use tag "Exploder" because the "Hostile AI Example" already have a tag, so I am using "Explodable" component instead.
     
  25. BHS

    BHS

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

    Great to hear you figured it out. Thanks for sharing your solution.
     
  26. inakrinat

    inakrinat

    Joined:
    Apr 7, 2015
    Posts:
    1
    Greetings.
    Do you have or plan mecanim support?
     
  27. BHS

    BHS

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

    Emerald doesn't currently have Mecanim support, but it is currently being adding with our next version.
     
    Stormy102 and julianr like this.
  28. pixelvspixel

    pixelvspixel

    Joined:
    Jul 18, 2012
    Posts:
    11
    Hi, I'd like to say up front that Emerald looks like a really solid product. Not only that, but the setup looks incredibly and straight forward, a feature which seems to be lacking from a lot of the competitors. What is troubling is that if you scan all 15 pages of this forum thread (that spans over a year), there is a constant promise of Mecanim support but little answer as to when it might be coming or if something is holding it up indefinitely.
    I know you don't want to back yourself into a corner over a date, and I get that. But it seems like it has been a very long time coming and probably a deal breaker for a lot of people if they are having to decided on a feature that may not show up anywhere in the near future.
    Again, it seems like an outstanding package all in all, which makes it all the more of a shame to have to pass on the asset. I hope you can give a clear path on this single feature.
     
    Last edited: Oct 17, 2016
    Stormy102 likes this.
  29. BHS

    BHS

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

    We understand that Mecanim support is taking a little longer than expected. It is currently being worked on and is nearly implemented. Instead of packing too much into one update, Emerald 1.3 will consist of some minor improvements, bug fixes, and the highly requested feature of Mecanim support to get it out sooner. We understand deadlines and we apologize for any inconveniences. A bug free, high quality, and concise product is our top priority and sometimes that takes a little more time. If everything is on schedule, we should be able to submit Emerald 1.3 within the next 2 or 3 weeks.
     
    99thmonkey and julianr like this.
  30. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    Bug free please! Yes, that's the most important thing :)
     
    BHS likes this.
  31. davidhughes3d

    davidhughes3d

    Joined:
    Nov 30, 2012
    Posts:
    29
    1: I am currently using a send message in order to tell NPC/enemies they are being attacked. Not in front of my PC right now but is something like

    hit.transform.SendMessageUpwards("Damage", damage,SendMessageOptions.DontRequireReceiver);

    or

    hit.transform.SendMessageUpwards("Damage From Player", damage,SendMessageOptions.DontRequireReceiver);


    The enemies are in fact taking damage, however they do not react correctly. For example if i stand back and shoot them they just stand there and take hits until they die. They don't seek out the player or run away or anything (unless i get within their attack radius and trigger them to peruse the player) and yes I have tried every imaginable setup.

    [edit] I also cant get the enemies to show a hit effect, although they groan when are hit, nothing shows up on them like a blood spat as it should.

    I am making a VR game so I must use 3rd party weapon handlers. The only viable solution was to use a Send Message script on the guns. Not sure if this is the right approach. I figured as long as the Player was shooting the enemy it should react but perhaps there is some disconnect or lack of info being sent to the enemy because it is a weapon outside of the Emerald AI solution? Should the send message contain other info? Can you suggest what else I should add in order for the enemies to react accordingly?


    2: Is there an easy way to get NPC's to do a ray-cast attack with a weapon like a gun? IE: I have both creatures (who melee attack) and biped/NPC/enemies (who shoot guns) in my game. I'm pretty sure damage is actually handled both from player and from enemy with raycast (in Emerald AI) if i am not mistaken, but is there a way to get the enemies to "use guns instead of melee" (provide I somehow just hacked the gun model onto the enemy model). I can see that there is a stopping distance parameter, so in theory I could get the enemy to stop a bit back from the player and "shoot their gun". But how would I get the attack to register on the player from a distance? If in fact the enemies are doing raycast to affect the players health? Is there something that I am missing? Can you shed some light on this please. I get that this is mainly for "animals and NPCs" and may not be what was intended for. Please take a few minutes to explain either that this is impossible, could be hacked together, not in the scope of Emerald AI or propose how one may do it. It is a pretty fundamental part of AI in a game (shooting weapons) so it would be nice to either implement it in the system or shed some light on the subject. Obviously no promises are made by you guys in the product description however any attempts to implement additional AI make the whole game fall apart at the seams do to similar declarations and naming in the scripts, for example "damage" and "player health" etc.

    I have held off asking any more questions on this forum barbecue I am ending up answering them myself. These two questions however have me stumped for weeks and i have put a lot of time in trying to find a solution. Thus I am posting on here as a last resort. Please take some time to shed some light on this as I am sure others will have use for this info as well.
     
    Last edited: Oct 18, 2016
  32. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    *cough* Multiple tag support? *cough*

    Make Christmas come early :p
     
    davidhughes3d and julianr like this.
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This is because a target is normally found by walking into the AI's attack radius. If you want to use ranged attack (which isn't officially supported yet), you could increase the AI's Attack Radius the max value (which is ~200) when hit by a bullet. This will allow the AI to grab the player and attack, if there are no other targets in the area.

    Another solution could be to create a script for your bullet that has your player as an object to pass to Emerald when it hits an Emerald target. When this happens, you would assign your player object to the currentTarget variable. Then setting its huntMode to true. This hasn't been tested, but it should work.

    We will be changing the way external scripts are called with Emerald 1.3. We will be using SendMessage with the option for custom calls within the Emerald Editor.


    Our plan is to have this feature finished before Christmas.
     
    99thmonkey likes this.
  34. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    How difficult would it be to use this in a multiplayer game using something like Photon?
     
  35. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Straightforward. Only have the AI running on the server or "master client" and then sync the position and animations.
     
    EddieChristian likes this.
  36. BHS

    BHS

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

    Just a quick update on Emerald 1.3.

    We have Mecanim nearly fully implemented. We have also created a system that will automatically create an Animator Controller, creates all needed states and parameters for Emerald, and assigns it to the selected AI model. We also have made tons of improvements to the system to make it more flexible and no longer dependent on external scripts.

    To get the most up to date information and release notes, you can check out our Roadmap section of our website here: http://www.blackhorizonstudios.com/roadmaps/emerald-ai/

    Emerald 1.3 should be submitted by 11/17/2016. We realize this update has taken longer than initially expected and we appreciate everyone's patience.

    New Features
    • Mecanim support – Mecanim animations will be usable with Emerald. Legacy animations will still be supported.
    • Support for custom function calls to external script with the Emerald Editor. This will be done by using SendMessage instead of calling the script function by name. This will allow users to not have to rely on Emerald’s external scripts and instead use their own. Calls for both Damage and health will be supported allowing users to easily integrate other 3rd party assets such as UFPS and RFPS. Note: SendMessage only supports 1 parameter unless sending the parameter as an array.
    • New option in the Emerald Editor that allows you to choose either the Legacy or Mecanim animation systems.
    • New automatic setup system for the Emerald Editor that automatically creates an Animator Controller, creates all needed states and parameters, and assigns it to the selected AI model. (Users will need to manually assign their animations using the Animator)
    • New Edit Animator Controller button that opens up the Animator Window for editing the Animator Controller on the selected model.
    • When creating an AI using Windows>Emerald AI>Create New AI, the component order is now rearranged so the Emerald Editor is on top. This makes it far easier to edit AI and fixes the issue with it sometimes being created near the bottom of the inspector. However, the order after creation can be freely edited.
    Bug Fixes
    • Fixed SetDirty Error warning message
    • Fixed error that occurred while editing an AI while in runtime
    • Fixed bug that wasn’t setting the Chase Seconds properly
    • Fixed some range calculations that weren’t being calculated properly

    AnimatorControllerCreation.gif

    EditAnimatorController.gif
     
  37. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    This is looking really damn good.
    I see you're using UniStorm in that gif (Can just see the C# prefab :p). If you can implement UniStorm support, with things like sleeping (Maybe for 1.5?) and different activities depending on the time of day or weather, this will set it apart from other AI systems.
     
  38. BHS

    BHS

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

    We have plans for UniStorm and Emerald integration following our 1.3 update. We have a lot of ideas for integration such as schedules based on time of day, weather affecting things like flee and attack range, and more.
     
    FizzyGiant likes this.
  39. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @BHS
    I see that you have mecanim almost sorted out. I am holding back my purchase on that single item.

    One more important item that I haven't seen addressed is all of the videos show melee only. I am using UFPS and have both melee and ranged attacks. Any issues there that I should be aware of?
    Does this asset also provide companion AI?
    Does it support interactive NPC AI like shop keepers, or random citizens going about their daily routines? (I have Dialoguer, so not a show stopper to add conversations.)
    Thanks,
    Mark
     
  40. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Companion AI is upcoming in 1.4. No interactive AI but you can have small-range wondering with your own code on-top. I'm sure @BHS will happily add it to the list.
     
  41. Wizard68

    Wizard68

    Joined:
    Jun 9, 2015
    Posts:
    3
  42. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    If it supports mecanim animations, it's easy to setup. He doesn't need to verify this
     
    julianr likes this.
  43. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    I am interested in schedules based on time of day?

    Can you explain in more detail?

    And is this product mobile friendly?
     
  44. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    The asset author is planning to add UniStorm-based events in the future
     
  45. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Schedules based on time of day are currently possible, with a few modifications. We can post an example later for you, or anyone else who is interested.

    Schedules based on time of day can be done by moving the AI's startingPosition transform based on the current hour (for example UniStorm's hour) with a custom script. You will need to make the startPosition public as with the current version it is set to private (this is fixed with our upcoming version). An AI will always wander near their startPosition, unless they are fleeing or attacking. Moving this position will make an AI move to their altered startPosition. Once they are near it, they will wander in the new area. You can either increase or decrease the wandering area to get the results you are looking for. If you want the AI to stay stationary in its scheduled position, you would just set the wanderRange to 1. This is all possible currently, but we plan on making it much more flexible and customizable with our 1.4 update. We will also be adding the support of time based events for UniStorm making it easier to create custom events.

    We haven't tested Emerald on mobile, but I believe we have had customers use it for mobile. Emerald utilizes Unity's LOD Group component to only allow AI that are visible to be active. This way, AI that are not in sight or out of range (for a certain period of time) are disabled so they are not affecting performance.
     
  46. markfrancombe

    markfrancombe

    Joined:
    May 26, 2009
    Posts:
    155
    Recent buyer here...
    Firstly I must say that I have really only just played a very short time with this, and think that maybe, just maybe its going to be very useful.
    Im afraid it hasn't all be smooth sailing, and I'm still having some trouble.
    Today's plan.. Read this WHOLE DAMN THREAD for hints and tips.

    1. First, it seems a little picky on the model and animations, but of course its might just be the models fault. I bought a few (real cheap) models from asset store to test. BUG BEAR #1 With an asset like this, I think it should really have included 1 simple animal (quadra-ped) model and one humanoid.. the teddy bears are cute, but so far away from anything one might use... anyway. One model worked fine, one didn't... OK the working one was already a Legacy model, whereas I had to do some stuff with the other as it had mecanim stuff (turn animation to Legacy etc) But that one still doesn't work totally fine.

    2. I can see that the demo projects are working FLAWLESSLY, doing lots of things I need, so i'm excited about that, but getting MY models to do exactly the same aint working.
    For example, I have a wolf and a deer, I want them both to roam, as a herd. But if they should get near, the wolves should attack and the deer should flee, however, If the wolves catch a deer, the deer should at least TRY to defend itself. and fight back, So is set to defensive.
    However what I get is that a wolf will run through a pack of deer (ignoring all but one its decided on... instead of picking nearest) and hassle a deer, the deer carries on wandering, and hasn't even noticed the growly wolf thats following it around.

    3. Turning is a bit crappy. They all walk in a straight line. stop... rotate and walk. OK I get that a decent "turn" animation (by which I suppose you mean a "shuffle in place" animation) would help, but what about a walk forward with curved paths? Wouldnt that be more realistic, and I must say Ive never seen horse or deer shuffle on the spot to change direction, they just turn WHILE walking forwards.

    4. And finally-.. to my ACTUAL QUESTION!!
    The project Im working on RIGHT NOW.. needs a quite specific thing, which MAYBE I can do with Emerald, if I think of things a bit differently.
    As Well as some more normal Predator / Prey stuff (as above) I want one animal (a rabbit + familly (in other words lots and lots of rabbits) to have the following functionality. If you move towards them they should scatter and run off... if you stop, and sit (press c for crouch) after a while, a few minutes, they will tentatively come to you untill you are surrounded by rabbits. If you rotate, (mouselook) they will scare a little, if you move (WASD) they scatter again..
    So is something like this possible? I guess Im talking about a variable "thread level", where if you move you have high "Threat" but if you stop "Threat" fades out---

    Any hints very much appreciated!

    Keep up the good work, Im really hoping this works out for me, I can almost see whole games with only this as the code!! IF I can get t to work!!!

    regards

    Mark
     
  47. markfrancombe

    markfrancombe

    Joined:
    May 26, 2009
    Posts:
    155
    OK... second day, still no luck.
    This is most frustrating, So I tried copying one of the demos, the Prey and Predator one. I disable the prey AI, and add my own model, a deer. Add AI component with Window/Emerald AI/Create AI/Create ne AI and with it side by side with the original "demo" AU, I go through every setting and copy everything to be exactly the same on my new AI. (Apart from animations obviously, which I assign, my models animations.
    In that demo, the Predatory AI would almost immediately attack the Prey, which would flee, but eventually get caught and killed (Is that due to cool down? The Prey gets tired? if so... good call) However with MY version, although the deer DOES flee, the Predatory NEVER chases it. I have checked the Predator Tag is correct. The Predator is set to Enemy, so I set the Predator tag to Enemy on my Preys Tag Tab.

    Im sorry but this seems very picky now... so far I have not manage to get one single one of my AIs to either attack me or each other.
     
  48. _invalidusername

    _invalidusername

    Joined:
    Jul 1, 2014
    Posts:
    35
    I haven't used emerald AI in a while but this should be pretty easy to accomplish by changing the scare range (or whatever it's called) of the AI agent. If the user is crouching you can gradually reduce the range, if the user moves you increase it
     
  49. BHS

    BHS

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

    Sorry to hear about your issue. I can try to figure out what's going on with some trouble shooting.

    1) We have tested a wide range of models and haven't encountered any animations not working, even model converted from Mecanim. So, it may be the model. Mecanim support is coming with our next version that will be submitted very soon.

    2) If your animals aren't fleeing properly, it could be a couple things. Make sure that your wolf's Predator and Prey settings, found under the Behavior Options, are set to Large. This will ensure that the wolf can attack large prey. For your deer, make sure that its Prey Size is also set to Large. This will allow it to fit the wolf's hunt category.

    If this doesn't fix your issue, make sure that your model's trigger is being properly setup. This process happens at runtime. Emerald automatically assigns a sphere collider to your model's mesh. You can do this by playing the scene, going to your model's mesh, and checking that the trigger was properly assigned. If it's there, make sure that the trigger radius size is being properly calculated by having Use Visual Radiuses to true, selecting the parent of the model, and playing the scene again. Once your scene is playing, go to the Scene Tab. Your visual radius should match your trigger radius. If it doesn't, there may be something wrong with the model you bought as this process has been universal for every model we've ever used.

    CheckRadius2.png

    CheckRadius1.png

    3) Turning animations have been improved with our newest version. Fleeing has also been improved. AI no longer only run in a straight line. They will have a lot more variation to their fleeing and movement.

    4) We plan on adding line of sight and awareness/alertness functionality following our newest update. Right now, you would need to add custom code to get what you described.
     
  50. markfrancombe

    markfrancombe

    Joined:
    May 26, 2009
    Posts:
    155
    Thanks for the reply: Ill keep this brief.
    1) Animations are now ok I think. I had to fiddle a bit with turning mecani, anims into Legacy, but got that donw now I feel.
    2) Yes they were set to large, but please confirm one thing. If a Predator is set to large, will it attack ALL animals below that size, or only OTHER animals set to Large. For example, I tried changing my Deer to a Chicken, with identical results (except I of course set the chicken to small) The Wolf is the friendliest wolf ever... never attacks or chases the chicken.

    I check the sphere collider being assigned, its happening. Although I notice that on your image the sphere is on the outer of the visual radius rings, mine is on the inner of the rings, in my case thats the "hunt trigger radius".
    3) Ah was that just now, last few days released? maybe I should upgrade then?
    4) Did you see the solution posted above by _invalidusername. Would that be a sensible way to you? Im not a coder, but can access the Emerald component variables by dragging them into a PlayMaker window and adjusting them that way... Im used to this.

    But more importantly, I tried my test project judt now, and was getting an error,
    NullReferenceException: Object reference not set to an instance of an object
    Emerald_Animal_AI.MainSystem () (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1387)
    Emerald_Animal_AI.Update () (at Assets/Emerald AI/Scripts/Emerald AI/Emerald_Animal_AI.cs:1762)

    Its on the Wolf, then on the chicken, then on the wolf.. up to +999 errors... AFAIK I didnt change anything, but must have... Unity IS WEIRD...

    I think Ill upgrade and start afresh... this will be 3 day running on this.. so... currently a bit iffy...

    PS I gave you a "meh" review... I will of course change this when I get it to work... to a MEGA FAB review...