Search Unity

[ON SALE - 50% OFF!] Emerald AI 2.3 - The Ultimate Universal AAA Quality AI Solution

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

  1. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    Hey everyone,

    Emerald AI 2.3.1 should be submitted within the next week or two. This update fixes quite a few bugs and includes quite a few improvements as well as some new systems.



    New Combat Text System
    The old combat text system is being replaced with the new Combat Text System. This new system works globally for all AI and can even be called for player damage and is handled through the Combat Text Manager. It uses Unity UI system and no longer uses the outdated Text Mesh component. The decision for a global combat text system was made because adjusting individual AI could be tedious, since most AI use the same settings anyways. The combat text system is optional and can be disabled through the Combat Text Manager.

    The combat text's color supports customizable colors for the following:
    • Player's Damage Text Color
    • Player's Take Damage Text Color
    • Player's Critical Hit Text Color (The new Emerald AI player controller has critical hits and is explained below)
    • AI's Damage Text Color
    • AI's Critical Hit Text Color (Melee AI can now deal critical hits too. All damage is sent to the EmeraldAIPlayerDamage script where it is automatically displayed on the player)
    • Healing Text Color (AI can now display their healing done)
    In addition to colors, there are all sorts of settings that can be adjusted for the combat text system such as its animation type (Bounce, Upwards, Outwards v1 (demonstrated in the demo video and my personal favorite), Outwards v2, and Stationary), font size, font type, and more. Users should be customize their settings and find a style that suits their game's needs. I'm always willing to take suggestions on this to add more settings and animation types with future updates. As for what the types of games the combat text system supports, it supports 3rd person, top-down, and even first person shooters (similar to Destiny).

    CombatTextManager1.png

    CombatTextManager2.png

    New Player Controller System
    The current player controller is a bit dated. It's never really received an update. While Emerald AI is not character controller system, I feel having a solid example for rapid prototyping is important. It allows users to have a high quality example system for running through their scene to damage other AI. The code itself is also useful for users who want examples with implementing their own character controllers.

    The new player controller is a top-down style and is controlled via the mouse's position (similar to Diablo). It has adjustable damage amounts, critical hit support, active target indicators (both shader based and projector shader based), tons of sounds support, and more. Everything you see in the above demo video is included with the next update.

    New HUD Health System, Sounds, and Bug Fixes
    As shown in the video above, everything you see is included with the 2.3.1 version of Emerald AI. There's also a new HUD health system, new sounds, particle effects, and of course bug fixes. I will post a list of these when the 2.3.1 update has been submitted. The issue with AI's projectiles firing too low at players has been found and resolved.
     
  2. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    829
    Looks great! Thanks for the quick update!
     
    BHS likes this.
  3. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,683
    I really like the red outline on the enemy being targeted. Nice.
     
    BHS likes this.
  4. Musonica

    Musonica

    Joined:
    Jul 25, 2017
    Posts:
    5
    Hey I'm implementing a turn based combat system. What i'd like to do is have a squad of say 5 AI entities with behaviour states (melee attacker, range attacker, healer / support, wizard etc.)

    At the start of your turn you issue attack or move waypoint commands, when the orders for all 5 are issued, the AI fight mode activates

    Basic logic: entity move to position, if in melee range do melee attacks else if at range do range attacks and spells

    Each AI entity will do say 2-3 attacks or special abilities then go into combat idle animation in a particular turn order.

    I would be most grateful for some advice on how to Emerald AI could be used to help accomplish this!
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,683
    This possible if you use some higher level control logic to manage your AI units. I wrote a bunch of Playmaker actions for just this sort of thing. It will also require one small code change, which @BHS is looking to add to the next update, which relinquishes attack control from EmeraldAI and lets another script dictate that. As it is out of the box, though, you won't be able to accomplish it.
     
  6. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    653
    Is the Invector Integration tutorial/video still valid for Emerald 2.0 - 2.3.0.2 ?
     
  7. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,683
    The tutorial docs get you a working integration, yes.
     
    wood333 likes this.
  8. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    585
    I have a couple of issues with raindeer AI's.

    My character approaches them and they are setup as cowards but they just keep walking in a straight line regardless.

    So...

    First: I want to get the AI's to run away when within a certain distance or when seen. Like a coward would.
    Second: Is there anything that can be done about a group of say 4 raindeer spawned with crux walking in a straight line all together in unison?
    Third: the deer don't seem to pay attention to steepnes and walk up and down slight cliffs/hills without changing from their straight line path.

    Unity 2019.2.11

    Thanks
     
  9. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    829
    @BHS what are the chance you do a little bit of a visual script piece to make the AI do more complex movements/attacks ect..?
     
  10. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    290
    is this still implemented with emerald ai?
     
    Hawk0077 likes this.
  11. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    290
    my ai companions i've also notice when following the player if i stop they carry on walking any ideas how to make them follow and stop when my player stops but also wander around?
     
  12. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    141
    @BHS I can't wait for the update. I'm really looking forward to the combat text. ;)
     
  13. bholland

    bholland

    Joined:
    Mar 24, 2017
    Posts:
    13
    BHS, thanks for the reply, I took a video of it happening and have a screenshot of the only collider on the AI. The transform for the projectile is well in front of the weapon. I have set the ranged projectile to many different prefabs, I'm using this one, cause it shows what is happening the best. I'm using the Opsive UCC if that makes any difference. The same thing happens when the AI's are shooting at each other. The video is here https://twitter.com/brion_holland/status/1193237590217900034?s=20
     

    Attached Files:

  14. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    94
    This is an example of what I am talking about. The character sometimes acquires the target and attacks, sometimes (more often than not) the AI just pushes the character around. This is using the Invector integration. I set it up exactly as directed in the tutorial. The tags and layers are correct otherwise I could not damage (or take damage) the enemy.

    AI Pushing Player
     
  15. F0GZ

    F0GZ

    Joined:
    Feb 22, 2018
    Posts:
    29
    I cant play hit animation on my "zombies". They recieve damage, with that all ok. But they just walking to player, dont play any hit animations. Help me please!
     
  16. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    389
    Cant wait for the update, looks great, mostly for the new sounds/particle effects :) Wanted to show a short vid of a fight with Dilophosarus, EAI has been a god send to the project:

     
  17. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,111
    Increase the mass of the player, on the rigid body?
     
  18. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    389
    @Nitrox32 please check your "stopping distance" (Ai Settings/Movement), it sets the distance that an agent will stop before waypoints or a target (or complete a attack animation).
     
    julianr likes this.
  19. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,111
    that'll help too. I use invector, and had to increase the characters mass or the AIs to match as sometimes the AI slide into you and push you, or vice versa. this may be fixed now though. Not updated to the latest Emerald yet.
     
    warthos3399 likes this.
  20. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    389
    @julianr yea ive run into that prob before, my dinos were pushin the player around while attacking, and no damage dealt. So i adjusted the Stopping Distance (the attacks were actually behind me, and i could see inside the dinos body).

    As soon as i set the dino farther away during attacks, damage was done, and the close up look was great.
     
  21. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    290
    whats the max amount of companions you can have ?
     
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    This should be possible with some custom modifications. The only limitation currently is that there's no way to manually trigger an attack. I plan on adding the ability to do this through code with the next update.
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    Make sure you have your tags and layers setup correctly. These are what allow AI to tell what is a target and what isn't. Also, if you want your AI to flee from the player, make sure you have AI Flees From Player set to Always. This is located under the Tag Options.

    Herd functionality isn't yet added, but a work around could be to assign one of the 4 reindeer a the companion behavior type so the other 3 reindeer follow the 4th.

    Use the Dynamic Wander Type. It allows you to control the max allowed steepness that waypoints can be generated.
     
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    I've considered this for a future update, but it wouldn't be for at least a few updates.
     
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    Not currently, but herd and breeding mechanics are what I have planned for the 2.4 update.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    What animation is being used for firing? The AI seems to drop near the ground before or while firing. Unity colliders, when attached to the parent of the AI, do not follow animations. This may be why your projectiles are having issues (they may even be hitting the ground because of the AI dropping to the ground).

    You also have a few errors in your Unity console, are these related to Emerald AI? If so, what are they?
     
  27. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    They should stop where your player is according to their following stopping distance. If you are using Root Motion animations, ensure you have the Movement Type set to Root Motion in the Movement Settings.
     
    julianr likes this.
  28. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    Make sure your attack stopping distance is set high enough. I'll see if I can recreate this, but I've never encountered it with Invector.
     
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    AI will only play hit animations when not attacking or moving. This is to avoid player exploits where players can continuously trigger the hit animation and never allowing the AI to properly attack or move. If your hit animations are not working entirely, make sure they are enabled under the Animation settings and that you have applied hit animations to the hit animations list.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    Awesome :) Looking great!
     
  31. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,045
    There's no cap. Each follower that a companion has is independent to that AI.
     
  32. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    290
    bhs i am using navmesh but i notice the companions get to close to my player and then walking into them and don't stop when my player does ?
     
  33. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    585
    Thanks Not sure about the tags as I set them up whilst setting the AI to attack. But they are set to Always Flee (but they dont) and steepness is set to dynamic and steepness setup also.
     
  34. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    94
    Thanks. I tried that already. Increasing the mass of either the player or the enemy had no effect.
     
  35. Nitrox32

    Nitrox32

    Joined:
    May 9, 2017
    Posts:
    94
    I was able to make it work although I think I need more testing. I found that my stopping distance was high enough because my enemy would attack. If I stood there and didn't respond to the enemy attacks, the enemy would not try to push me around. However after I attacked the enemy would simply push me around. Changing the mass of the player had no effect. This is what I had to do to make it work. First, I had to disable the box collider that Emerald AI uses. I tried to remove this component but Emerald AI won't let me. I added a capsule collider to the AI and made its radius larger than the obstacle avoidance radius in the nav mesh agent. I'm not sure why it works now but I can say that if I turn on the box collider that Emerald AI needs, after the first player attack the AI just pushes my player around. A bug perhaps?
     
  36. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    389
    Stopping Distance is a big thing in that situation, and no, you cant remove the EAI box collider, but you can shut it off. Honestly changing/increasing the Mass wouldnt work in that senario, you think it would, but it doesnt. Glad you got it figured out, but just make sure that by increasing the capsule collider radius fits and doesnt cause any other probs down the line. Just as a side note, have you also tried decreasing the obstacle avoidance radius?

    Best of luck bro :)
     
  37. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    205
    Maybe the hit animations should be put on another layer, like an "upper body" layer, so they can still play without having to stop general movement.
     
    warthos3399 likes this.
  38. AaronVictoria

    AaronVictoria

    Joined:
    Aug 21, 2010
    Posts:
    144
    @BHS Another suggestion for something I hacked into my project for the time being. We have passive NPCs that required "Line of Sight" to allow the player to sneak up behind them to pick their pockets or steal from them. So I had to remove the restriction that forces passive AI entities to use the trigger detection type. I also had to hack in support for passive AIs to detecting the player without always require the " && EmeraldComponent.AIAttacksPlayerRef == EmeraldAISystem.AIAttacksPlayer.Always", as once again these are non-combat NPCs that we can sneak around. In our case, they aren't required to always attack the player.
     
  39. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,683
    You can also use Playmaker and have your AI start as Passive and then when some event happens change their Temperament so they attack.
     
  40. AaronVictoria

    AaronVictoria

    Joined:
    Aug 21, 2010
    Posts:
    144
    Yea that's how I have it coded now, but I need Line of Sight always to ensure that the NPCs always have their native blindspots.
     
  41. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,683
    Yea, that's strange that he forces Trigger detect on Passive AI. That restriction should be removed.
     
  42. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    290
    would their be a way to say have the ai on aggressive or passive then when the player gets within distance make the ai change to a companion (like a taming method)?
     
  43. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    653
    The EmeraldAIPlayerDamage script has changed in the latest version, and I am not able to use the Integration video to get it correct for Invector Integration, damage to the player. I had it working in the previous version when the YouTube tutorial matched the script. The other scripts in the integration still match, and are working fine. What should the EmeeraldAiPlayerDamage script look like for the integration, now?

    EDIT: I have damage Ai to Player working now, but I am only using part of the Integration tutorial, and completely ignoring the code segment the tutorial instructs me to insert.
     
    Last edited: Nov 12, 2019
  44. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,683
    Yes, you can do this in code. Or you could use my Playmaker actions, which have those actions coded for you.
     
  45. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    290
    ah right how would i go about doing this in code? :)
     
  46. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,683
    Well, you can download my Playmaker actions and just look at the code and copy and paste into your own scripts.
     
  47. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    290
    don't have playmaker :( would work without ?
     
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,683
    Playmaker actions are just a way of wrapping up code to be used in Playmaker. So, you can just strip out the code from the Playmaker action and put into a regular script.
     
  49. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    290
    ah right brilliant :) where can i download ?
     
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,683