Search Unity

  1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

[RELEASED] Emerald - AI (Dynamic Wildlife, Breeding, Predators & Prey, Herds, NPCs & more!)

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

?

Which (in development) feature would you like to see the most implemented with Emerald Animal AI

Poll closed Oct 1, 2015.
  1. Predator and Prey system support (allows animals to hunt and flee from each other)

    12 vote(s)
    17.4%
  2. Pack/Herd Support (allows for animals to stay together and hunt or graze)

    5 vote(s)
    7.2%
  3. Mating Support (allows animal to reproduce Minecraft style to help keep populations balanced)

    5 vote(s)
    7.2%
  4. Combat Support (will include a working example system of fightable and huntable animals)

    10 vote(s)
    14.5%
  5. All of the above (they are all equally as awesome and they all need to be implemented)

    37 vote(s)
    53.6%
  1. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,853
    Hey Mark!

    My post below will explain everything.
     
  2. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,853
    Hey everyone!

    To clarify why a rewrite was needed for Emerald 2.0, I wrote this post. It's also a status update on version 2.0 with details regarding its development.

    While the current version of Emerald works well, it has some drawbacks. When Emerald 1.4 was originally started, it was supposed to be a modification to the current version. However, there were too many factors that makes it difficult to add new features and make improvements. Instead of spending the time to fix everything, it was decided to start from scratch. This is allowing us to do things better the first time and implement features that would've been too difficult with the current version of Emerald.

    For example, Emerald's current Attack mechanics are comprised of two functions, one for running attacks and one for stationary attacks, each consisting of 200+ lines. Emerald 2.0's new attack function currently has just 42 lines and this handles running and stationary attacks. It also looks a lot better than Emerald's current version does.

    One of the best things about Emerald 2.0 is the huge performance increase. AI that are not in view of the camera are automatically disabled, with an option to add a delay. This new technique is miles better than how the current version of Emerald and allows AI to seamlessly be enable and disable. When AI are in their inactive state, they use 0 performance, according to the Unity profiler. A mild stress test was done with 45 AI active at one time, and the results greatly outdid Emerald's current version. A video demonstrating this will be coming within the next few days.

    A full feature list is in the works. Everything that has been mentioned in previous posts will be added. However, the main focus right now has been redoing Emerald's core, which is nearly finished.

    Now, I'm sure Emerald users are eager to see some new videos demonstrating Emerald 2.0. So, I've put this video together demonstrating Emerald 2.0's new Line of Sight feature!

    The new line of sight feature works by making an efficient field of view raycast to detect targets when a target is within its "trigger range". This is to help make the line of sight feature as efficient as possible by only turning on while a target is within range. The length of the raycast is controlled by the AI's trigger range. Once a target is within the AI's field of view, the raycast is disable, the detected object is marked as a target, and the AI will react according to its behavior, which were explained in the post above.

    This works for both the Hostile and Cautious behaviors. The AI's detection state is public and can be accessed via script which can allow for some interesting player and game mechanics. The best thing about the line of sight feature is that it allows players to be hidden when behind walls or other obstructions. No more AI being able to magically detect you through walls! The eye position of this feature can also be customized for added accuracy for each specific model.



    Feedback on the video would be appreciated. We are looking forward to further demonstrating Emerald 2.0 and we appreciate everyone's patience. The new Companion behavior feature will be demonstrated next which will show an AI to follow the player around and help them fight other AI. As for a release date, it's hard to say. The development of version 2.0 has been coming along quite nicely. As long as there are no unforeseen issues, and the beta tests go well, Emerald 2.0 should be submitted by the end of September, but possibly sooner.
     
    julianr, micuccio, Weblox and 3 others like this.
  3. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    121
    Hi @BHS ,

    Awesome Video - Thumbs up !! I tried to setup a similar Project inspired by Skyrim Beast Gameplay. :p

    It has been a while since I last used Emerald AI for my RFPS Project but it has always been one of the best AI packages for a beginner like myself. I do appreciate all the efforts going into the package and the Line of Sight features presented in the video are a great improvement. Also less Code and better Performance is greatly welcome.

    What I am eagerly awaiting is Integration of Unity Event.System. You have already done a great Job with Integrating them into Unistorm with Time Events (I am not sure if I am up to date with the latest Version - do we have Weather Events already? ) and I am hoping for a similar Event System in Emerald. ;)

    I have added some Unity System.Events to an older Emerald Version in my RFPS Project and I am using them a lot throughout my Setup to trigger all sorts of different actions.

    events 1.PNG events 2.PNG

    However adding up to a Solution like Emerald makes the upgrade process a pain and I always try to avoid it. I have already skipped the last Version update. Maybe the Event.System is already there? If not I am having high hopes that you will add those to Emerald 2.0, in a much more professional way that is ...:D

    Thanks for all your efforts and keep up the good work!
     
    Last edited: Aug 12, 2017 at 6:12 AM
    magique likes this.
  4. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,853
    Hey there!

    Thanks, I feel a real testing environment is important for development. :)

    The current version of Emerald doesn't have a built-in event system. The plan is to implement some type of event system with Emerald 2.0 similar to the one that was done with UniStorm.

    You are welcome and thanks!
     
    Weblox likes this.
  5. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,853
    Hey everyone!

    One of the most anticipated new features for Emerald has been the Companion AI feature. The video below demonstrates Emerald 2.0's new Companion behavior type.

    The companion behavior type give AI the ability to follow around a player and protect them from other AI. Two additional settings have been added called Combat Type.

    The Combat Type allows Companion AI to either fight defensively or offensively. If set to defensively, a Companion AI will only fight other AI that are actively trying to attack them player. This gives players the ability to sneak up on other AI without their Companion AI giving them away. If set to offensively, a Companion AI will fight any aggressive AI that is within their line of right or trigger radius, depending on which Detection Type is used.

    Animations, timings, sounds, and more can be customized. If enabled, Companion AI also have the ability to regenerate their health.The health bar shown is optional. Emerald 2.0 has a new health bar system that automatically creates, positions, and sets up health bars for all AI, if enabled. The health bar feature will be demonstrated with the next Emerald 2.0 video.

     
    Mighto360, llJIMBOBll and magique like this.
  6. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    718
    Looks good. Nice work on 2.0. Will there be an API call, or something that would enable and disable the companion feature, so you'd go up to an AI character and you could make them become a companion, or let them go and they would become normal AI or an NPC. Would you be able to have more than one companion? So if you wanted to have a small army for instance follow and help you - that would be cool!
     
  7. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,853
    Thanks! There will be an API call to make an AI be a companion. All AI behaviors can be changed in realtime and they will react accordingly.

    The Companion AI feature supports multiple AI so you can have multiple AI following your player at once.