Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[50% OFF!] Emerald AI 2.4.1 - The Ultimate Universal AAA Quality AI Solution

Discussion in 'Assets and Asset Store' started by BHS, Jun 26, 2015.

  1. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    thank you for the swift response and apologies for all the questions just want to make sure it covers everything i need. I just need to check if this asset can allow or has the following:

    herding (like for example a herd of zebra)?
    natural behaviors for example zebras grooming each other (interactions)?
    will there be more emotes in the future releases?
    If I add a collider to the water will my animals still be able to swim as well as drink?
    Can a way point be intercepted and carry on if it collides with a plan to eat?
    pack (like for example a pack of lions hunting)?
    Would the character controller provided work on an animal?
    Needs (Is their the ability to provide needs to animals)?

    once again sorry for all the questions :)
     
  2. A2GStudios

    A2GStudios

    Joined:
    Nov 21, 2016
    Posts:
    52
    Is there an integration for uRPG yet?
     
  3. AaronVictoria

    AaronVictoria

    Joined:
    Aug 21, 2010
    Posts:
    152
    @BHS I have a small suggestion to toss into the hat for upcoming updates. Allowing the user to input their own animator location would be incredibly useful. I've hacked one in on a project I'm working on, but it would have been so much easier to just integrate that into the setup process for those less "programming-capable". In this project the animator is on a "base" component that is an immediate child of the main NPC object.
     
  4. mikemuk01

    mikemuk01

    Joined:
    Dec 1, 2016
    Posts:
    51
    I want to use Emerald AI in a RPG game using a first person player for melee combat. Does Emerald support first person?
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,838
    Your player solution being third or first person is irrelevant. The only requirement is that your player solution can integrate with Emerald and vice versa. Most systems already have integration such as RFPS, but integration is fairly easy even if your chosen player controller doesn't already have it.
     
  6. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    - Realistic herd mechanics are coming with the 2.4 update, but animals can still wander around with various animations and avoid predators animals.
    - I do plan on adding more emote animations after the 2.3 update.
    - AI cannot currently swim, but I also plan on adding this at some point. With the example code I posted previously, it is possible for AI to play drinking animations if the collide with the trigger collider. However, the will not seek out said collider. It is only if they happen to come in contact with it.
    - Yes, you can place as many waypoints as needed to trigger colliders that can then play needed emote animations using the script I posted. If you setup your factions, you can have certain animals chase and kill other AI. The opposing AI will flee, if you've setup your AI's factions and AI's settings to do so.
    - The included character controller is a simple example that allows users to receive damage and inflict damage to AI.
    - There's currently no needs system.
     
    julianr likes this.
  7. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Not yet. I will begin working on this as soon as the 2.3 update is finished.
     
    julianr likes this.
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    I can certainly look into this feature for a future update.
     
    AaronVictoria and julianr like this.
  9. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    ah right brilliant how would it be possible to make predators chase prey in radius? or is this a future thing?
     
  10. drcfrx

    drcfrx

    Joined:
    Jan 26, 2013
    Posts:
    40
    My Player doesn't seem to be detected as a Player by EmeraldAISystem, but as an AI, though the AI creatures detect the Player and attack it as it's supposed. The Player is tagged Player, and on Player layer. The problem is when the creatures attack, their damage isn't sent to the Player. Apparently EmeraldAISystem consider my player as an AI (TargetTypeRef == TargetType.AI and not .Player, I know because I added a bunch of debug.log ). There's probably something wrong with my Player but I can't find what. What could be causing this?
     
  11. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Yes, every AI has its own Detection Radius that it uses to either flee from or attack targets.
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    I did notice something similar while developing the version I'm currently working on and managed to fix it, but it didn't happen very often. I believe the issue was related to the aggro system so try disabling that to see if it resolves the problem for now.

    You can also try look at these line in the EmeraldAISystem script as they may be mislabeling your player.
    Code (CSharp):
    1. TargetTypeRef = (TargetType)TypeOfTarget;
     
  13. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    ah right so it is possible to create a predator prey relationship ?
     
  14. drcfrx

    drcfrx

    Joined:
    Jan 26, 2013
    Posts:
    40
    @BHS Hi, thank you for the answer. I pinpointed the issue with the Line of Sight detection method. With the Trigger one it work as intented, they deliver damage.
    In EmeraldAIDetection line 302+ the Player is identified, but after that the TargetType.Player is lost somehow. I'm super beginner at scripting and cannot figure this out :/

    Also in Trigger detection mode, once my Player is killed by the AI, they continue to attack as if the Target isn't cleared. Is there some parameter I missed somewhere for that?

    Edit: Deactivating the aggro on AIs didn't change the issue.
     
    Last edited: Aug 20, 2019
  15. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,013
    2.3 going to have NPC logic ie at 25% health, cast this spell and do these series of animations?
     
  16. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Yes, you would just customize the Faction System. For example, a wolf could be apart of the Predator faction and will see the Prey faction as targets. The Prey faction will see the Predator faction as threats and will flee whenever they enter their detection radius.
     
  17. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Are you using a custom character controller? Have you tried testing the included demo scenes to see if this problem is still present?

    You also need to make sure that you set your Player layer within the Emerald AI editor as by default the only layer that's detected is the Water:
    PlayerLayer.png

    You need to handle your own logic when the player dies. I've updated the included EmeraldAIPlayerDamage script with the new version to stop AI from attacking once the player's health has reached 0. Since all damage is sent through this script, you just need to apply some code to tell the AI when the player is dead or their health reaches 0, if you are using a custom health system.
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Yes, the Support abilities will only trigger when the health percentage threshold has been met. The logic for this will be expanded with future versions as well as additional support abilities other than healing.
     
  19. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    For those who are interested, I've updated the Emerald AI Demo to version 2.3 to showcase some, but not all, of what's possible with the 2.3 version of Emerald AI.

    Emerald AI 2.3 Demo (1GB)
     
    Last edited: Aug 21, 2019
  20. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    831
    What an incredible AI system this is, i started out using Emerald Animal AI a while back, and really loved it (still do), but after upgrading to EmeraldAI 2.2, its been great, im developing a jurassic type game called Jurassic Extinction (posted in the WIP section) and i couldnt be happier. I do miss the "grazing" and maybe it will be added in, at a future date.

    Its worked out great for dino AI, and the integration with UFPS and Invector 3rd Person Controller, is just great. Ive had no console errors to correct, or any probs so far. Thnx guys, great work on this asset :)
     
  21. CHACHINOI

    CHACHINOI

    Joined:
    Aug 21, 2019
    Posts:
    2
    hello, i start coding and i use vrtk with emerald but i only find integrarions ufps or invector, i want to use the system of shooting the gun vrtk simple to damage the AI but i can not find any script ... could you m help for setting up a script? thank you
     
  22. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    Is their a health system for AI?
     
  23. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    831
    Well health can be set in a few ways:
    You can set base health ( min and max)
    You can set at what point a agent "flees" by percentage of health
    and can set a health "bar" above an agents body (option)
    I wish it had Grazing, and Thirst system that Emerald Animal AI had...
    Right now im just getting used to the system, and mods can be made to the code, but base functions are really good :)

    @CHACHINOI you wont find a script for that integration, unless BHS can dev one, thats a tough integration.
     
    Last edited: Aug 21, 2019
  24. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    ah right will the health work for the AI ? and how would i go about implementing the health to the AI?
     
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Very cool game! Thanks, it's great to hear you're enjoying Emerald AI and that it's working for your project. I would appreciate if you left a quick review on the Asset Store, if you have the time. :)

    Also, AI can play grazing animations. You just use gazing animations in place of idling animations. I have a few ideas of how to improve this after version 2.3 is released by generating waypoints according to objects such as food sources. This way AI can go to food objects and play eating animations.
     
    warthos3399 likes this.
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    In order to damage an AI, you just need a reference to the object that was hit with something like this:
    Code (CSharp):
    1. if (YourTargetReference.GetComponent<EmeraldAI.EmeraldAISystem>() != null)
    2. {
    3.    YourTargetReference.GetComponent<EmeraldAI.EmeraldAISystem>().Damage(YourDamageAmount, EmeraldAI.EmeraldAISystem.TargetType.Player, YourPlayerTransform, 400);
    4. }
    5.  
     
  27. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Each AI has its own health variable built into the Emerald AI system. Users can set the total health an AI has, as well as how quickly it regenerates after receiving damage, all from within the Emerald AI editor.
     
  28. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    ah brilliant would an additional collider or a damage script be needed so that it recognizes when it has been hit?
     
  29. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    284
    @BHS That demo is actually really good.

    Anybody on the fence should try out that demo.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    A collider is applied automatically so there's no need to apply any additional ones. An AI can be damaged by having a reference to the hit AI object and using something like below. This will automatically damage the hit AI according to the YourDamageAmount parameter.
    Code (CSharp):
    1. YourTargetReference.GetComponent<EmeraldAI.EmeraldAISystem>().Damage(YourDamageAmount, EmeraldAI.EmeraldAISystem.TargetType.Player, YourPlayerTransform, 400);
     
  31. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    ah brilliant would i need to put this reference in my create damage script?
     
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Yes, that is correct.
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Thanks! I feel like the previous demo did not show Emerald AI's versatility very well. I'm glad you like it.
     
  34. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    and does the dead animation require anything to work or will it just display the animation once dead?
     
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Nope, all you need to do is apply a death animation to the death animation list (you can use up to 3) and one of them will play once your AI's health reaches 0.
     
  36. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,013
    Any chance that you can add stats to the AIs like mana, stam, armor?
     
  37. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    831
    Im going to leave a review on asset store for sure. Yes, that what ive done is use grazing animations instead of idle, and it works great, also to be noted is EmeradAI works well with flyers, as it can use any animation, but seems to work really well with my Pteranodons, flying up, dive attacks, etc. they look very realistic.

    Great idea with the waypoints/food sources, would be a good addition.
     
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    I wanted to add these features in with the 2.3 update, but I didn't want it to delay the update any further. I have plans to add these, as optional features, after the 2.3 update.
     
    warthos3399 likes this.
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Thanks! That's great to hear Emerald AI has worked so well for you. A really cool improvement with version 2.3 is the significant improvements to AI turning so AI will fully utilize their blend tree turning animations like below, which should look great with your dinosaur models. Cool looking game btw!

    TurnAnimationImprovements.gif
     
    warthos3399 likes this.
  40. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    ah awesome but i do require a damage script or can i just use this asset?
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Are you referring to player damage or AI damage?

    A simple player controller is included that will damage an AI and receive damage from an AI.

    If you are using a custom solution for a character controller/player health, you would need to add calls to your custom health system to Emerald AI's EmeraldAIPlayerDamage script. Then, with your custom weapon system, you would add the damage code I posted above to the object that your weapon system hits.
     
  42. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    831
    That looks awesome! :)
     
  43. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,013
    Another question, if i wanted an AI ti stay stationary or can only move in x radius, how would i do that?
     
  44. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    831
    @BHS Went to integrate with UFPS and got 9 console errors..sent you a conversation request, un less you want me to post here... I even tried the code that was in the tutorial video, as it was different...
     
    Last edited: Aug 22, 2019
  45. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    The Stationary wander type allows an AI to stay in one place and the Dynamic wander type allows the AI to generate random waypoints within its wandering radius. Or do you want the ability for the AI to switch between the two?
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    Yes, I was able to read you message. It looks like there may be syntax errors. Also, what version of UFPS are you using? The tutorial covers version 1.7.5 and not the newer version.
     
  47. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    316
    ah right no what i'm trying to do atm is have AI animals attack and kill other animals. Also have an AI fight back or flee on low health when being hunted by other AI
     
  48. BHS

    BHS

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

    Since there have been numerous request for awhile now with a proper AI's needs/grazing system, I thought I'd write one up real quick, I was also curious of the versatility of Emerald AI. :)

    The AI Needs System will be included with the 2.3 update. For those who want it early, send me a private message via a Conversation, along with your Invoice Number, and I would be more than happy to send it to you early. It should work with the current 2.2 version.

    As for the needs system, it works by efficiently searching for nearby objects of the appropriate layer, when an AI's Current Resource amount reaches 0 (aka it's hungry, thirsty, etc). When this happens, an AI will generate waypoints to the detected resource objects, up to the Max Resource Waypoints amount. When an AI reaches a resource object, users can specify which idle animation will be played based off of the index of their Idle Animation List such as an eating animation. The AI will then refill their resources at a rate of 1 resource per second according to the AI's Wait Time seconds.

    After an AI has reached its full limit, it will switch to the Dynamic Wander Type and wander around its new area until its Current Resources reaches 0 again. It will then repeat the process, but most likely getting new resource objects with each time it generates new waypoints. There is also an option for an AI to die if it doesn't get to resources quick enough.

    Lastly, there is a Gathering Event that is triggered each time an AI successfully collects a resource. This can be used to run custom code to add items to custom inventories or add values to custom variables

    I wanted to keep the system very general so any kind of AI can use it. It could allow an AI to collect resources for a town, allow an animal AI to look for food and water sources, and tons more. AI will also still react to or fight off potential threats. All in all, it should allow for some very cool added functionality. I'm looking forward to seeing what users can create with. Keep in mind, I consider it still in beta stage at this point. :)

    An AI generating waypoints to resource objects when its Low Resources amount is reached.
    DynamicGrazingGeneration.gif

    An AI refilling its resources at a generated resource destination.
    GrazingArrivalOptimized2.gif

    EmeradAINeedsSystem.png
     
    Last edited: Aug 22, 2019
  49. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,317
    This is handled through the faction system. It's what allows other AI to see who is a target or not. An AI will fight back if they are of the appropriate Behavior Type. For more information on the faction system, see the documentation here: https://docs.google.com/document/d/...2njM7Jx9pYlqgbtM8/edit#heading=h.asmf5b22etw8

    An AI will flee when their health is low and if they have the Confidence Type of Brave. You can then customize the amount of health needed for the AI to flee.
     
  50. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    831
    @BHS I agree, its most likely syntax, and im using UFPS 1.7.5, its looking like its the way i inject the code into the script, any chance i can get a working copy of the EmeraldAIPlayerDamage script? (just send if possible in our Conversation) In the mean time, ill try and figure out whats going on, as this hasnt happened before, could be my Notepad++ which i use for coding, and just updated, could be a few different things, lol
     
    Last edited: Aug 22, 2019
unityunity