Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[RELEASED] Emerald AI 2.3 - 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:
    273
    ah brilliant and can we add particles to the emotes like water dripping when it drinks ?
     
  2. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    Yes, there's built-in API that can be used through Animation Events and your AI's emote animations. You can also play sound effects using Animation Events. I'll put together some tutorials to better explain this.
     
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    Akshara likes this.
  4. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    273
    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 :)
     
  5. N-Orbit_Studios

    N-Orbit_Studios

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

    AaronVictoria

    Joined:
    Aug 21, 2010
    Posts:
    144
    @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.
     
  7. mikemuk01

    mikemuk01

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

    magique

    Joined:
    May 2, 2014
    Posts:
    3,657
    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.
     
  9. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    - 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.
  10. BHS

    BHS

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

    BHS

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

    unity_7UFP4-iCkwsgjg

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

    drcfrx

    Joined:
    Jan 26, 2013
    Posts:
    37
    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?
     
  14. BHS

    BHS

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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;
     
  16. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    drcfrx

    Joined:
    Jan 26, 2013
    Posts:
    37
    @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
  18. SickaGamer

    SickaGamer

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
     
  20. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
     
  21. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
     
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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
  23. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    332
    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 :)
     
  24. CHACHINOI

    CHACHINOI

    Joined:
    Aug 21, 2019
    Posts:
    1
    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
     
  25. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    332
    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
  27. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.  
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
     
  31. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    Deckard_89

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

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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);
     
  34. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    Yes, that is correct.
     
  36. BHS

    BHS

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

    unity_7UFP4-iCkwsgjg

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
     
  39. SickaGamer

    SickaGamer

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

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    332
    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.
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
  42. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
  43. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

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

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
     
  45. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    332
    That looks awesome! :)
     
  46. SickaGamer

    SickaGamer

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

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    332
    @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
  48. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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?
     
  49. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,016
    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.
     
  50. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    273
    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