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. detvog

    detvog

    Joined:
    Dec 23, 2017
    Posts:
    8
    Hello, can anyone help me?
    I work with Ootti. I'am searching an integration for Emerald 2.4 not for 2.2 or 2.0.

    Sorry for my bad english.
     
  2. Eldurin

    Eldurin

    Joined:
    Dec 10, 2017
    Posts:
    19
    I'm having issues with duplicated AI, but the AI is being duplicated with Crux, so duplication is kind of the whole point.

    Is there anything I can do about the fact than an AI will stop attacking a duplicate of an AI that it has already killed?
     
  3. uz986

    uz986

    Joined:
    Oct 29, 2017
    Posts:
    12
    Hi there,

    I am working with Ranged AI, and AI is suppose to throw normal physical objects. I am able to set it up properly and able to do damager and everything else.

    But it throw objects in straight line, but what I need is throw object in a curve like a real object. I am attaching a picture to explain this. So is there is any way to achieve that? would be great help if someone can guide me

    edit: can anyone help me out here??
     

    Attached Files:

    Last edited: Sep 21, 2020
  4. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    324
    I mean Crux is probably using the reset functions on the AI system before duplicating . probably you need to regenerate the spawn ID in Crux I never used it although i own it . something is telling the attacking AI that this new duplicate of AI is dead because you killed it ... my bet is spawn ID .
    the Ai would kill an AI with spawn ID 5 for example , then when you make a duplicate of the killed Ai , it will have the same Id of 5 , so the Attacking AI will never attack it because it's thinking it's dead .
    do click on the upload_2020-9-21_12-45-55.png (screen shot from the store)
    and let us know .
    my issue with duplicating is clear as day , some child game objects of the original Ai gets assigned into the duplicated one .
     
  5. wanglong-2016

    wanglong-2016

    Joined:
    Jun 18, 2017
    Posts:
    5
    List cant add smothing how can i fix it?
     

    Attached Files:

  6. imaginethepoet

    imaginethepoet

    Joined:
    Aug 23, 2016
    Posts:
    44
    Hello,

    I purchased this to work on a game I've had in my head for VR for a few years. I've spent about 4 hours or so getting used to the panels, going through them all and learning.

    I have a character that is a static character - I must be missing an option somewhere, I still want them to attack when approached, I don't want the AI to move I just want it to remain stationary and toss projectiles. I've set this in wander type to stationary. - but the creature still wants to move. I was using the forest golem for an example.
     
  7. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS WHen is the next update coming? Its been sometime :)
     
    Wolf-Heart and mattis89 like this.
  8. cdrinkall

    cdrinkall

    Joined:
    Jun 3, 2020
    Posts:
    1
    Hi

    so I realise this is probably a very dumb question but I've been searching around and just cant seem to figure it out.
    In my game, the player has a permanent companion who follows him round, I've been trying to set a companion to follow my player and cant quite figure out how to.

    here's my follow script

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using EmeraldAI;
    5.  
    6. public class PandaFollow1 : MonoBehaviour
    7. {
    8.     EmeraldAISystem EmeraldComponent;
    9.     EmeraldAIEventsManager EventsManager;
    10.  
    11.     // Start is called before the first frame update
    12.     void Start()
    13.     {
    14.        
    15.             EmeraldComponent = GetComponent<EmeraldAISystem>();
    16.             EventsManager = EmeraldComponent.EmeraldEventsManagerComponent;
    17.            
    18.     }
    19.  
    20.     // Update is called once per frame
    21.     void Update()
    22.     {
    23.         EventsManager.SetFollowerTarget(Transform Target);
    24.  
    25.     }
    26. }
    27.  
    I'm guessing I need to set my "Target" as a variable for my player character? but honestly have no idea how - sorry for the noob question, still very new to unity and C#, but anybody who could shed light on what i need to do or what i've done wrong would be greatly appreciated
     
  9. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I'm curious about this.
     
    Wolf-Heart and julianr like this.
  10. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    me too. A feature that not many AI systems have, would be a plus!
     
    Wolf-Heart likes this.
  11. eldvbear

    eldvbear

    Joined:
    Jul 21, 2016
    Posts:
    9
    I’m no great programmer myself, but you should create a GameObject variable in your variable declarations. Something like public/private GameObject player; . In your Start() method you would find the player component with the following: player = GameObject.FindWithTag(“Player”); or whatever tag your player has. You could also use just GameObject.Find(“”), with your player object’s name in the quotes, but that is less performant. I’m not sure if you can just use that as the target, so you may need to get the player’s Transform. You can set it like so: Target=player.GetComponent<Transform>(); and then in your update method it would like: EventsManager.SetFollowerTarget(Target);

    Again I’m not the best programmer by a long shot, but see if that works. At least that should get you pointed in the right direction.
     
    cdrinkall likes this.
  12. TheQuiet1994

    TheQuiet1994

    Joined:
    Jul 3, 2013
    Posts:
    1
    Not sure if this has been addressed or what the solution is but when trying to play the gameplay demo scene with the topdown setup doesn't work. The player character is bugged out and there are a few index errors. Is there a solution to fix this already? https://i.gyazo.com/6d7704e946c9919d0a91f37a07f5e0d1.jpg
     
  13. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Hello Guys Can Anyone help me setting up home locations for my ai , I want my ai to wander dynamically inside a radius now if player attacked the ai or get close to it ai will star to follow and attack the player but as soon as it go outside the home location radius the ai should get back inside the home radius and start wandering at home location , Can anyone help me setting this simple ai ?
     
  14. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Can we get a video on how to set up Ranged AI or at least include the Ranged AI demo from the video so that way we have something to refer to? I'm trying to set up a ranged AI but it just sits there and doesn't fire.
     
  15. imaginethepoet

    imaginethepoet

    Joined:
    Aug 23, 2016
    Posts:
    44
    please let me know if this is possible thanks!
     
  16. uz986

    uz986

    Joined:
    Oct 29, 2017
    Posts:
    12
    can anyone let me know, if there is any solution for this?
     
  17. maniak_001

    maniak_001

    Joined:
    Jun 13, 2016
    Posts:
    31
    @BHS I've found a bug with the OnPlayerDetectionEvent
    The event is only invoked if the player relation is 'Neutral' or 'Friendly', it is not invoked if the relationship is 'Enemy'
     
  18. agent_Macgyver

    agent_Macgyver

    Joined:
    Sep 1, 2012
    Posts:
    36
    Is there a way to swap out the walk animations at run time? I want my AI to 'sometimes' have a sneaking animation instead of normal walking.
     
  19. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
  20. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I have created an AI using waypoints. Why does the AI move to the first waypoint with no problems but when trying to go to the second waypoint it barely moves using the random waypoint. If I use loop or reverse the AI will move to the waypoints with no problems. It's just random waypoint that the AI doesn't know what to do.
     
  21. maniak_001

    maniak_001

    Joined:
    Jun 13, 2016
    Posts:
    31
    @BHS It seems that you do not frequently visit the forums.
    Is there a better place to contact you?
     
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I've had a few customers use Crux with Photon and they said the integration was pretty easy. I will see if I can make an included UnityPackage for this for Crux and Photon at some point. As for Emerald AI, adding Photon support would be quite a bit more work so this would most likely be a separate addon. I will have more information on this after the 2.4.2 update has been released.
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Velocity with a rigidbody can be found with:
    Code (CSharp):
    1. rigidbody.velocity.magnitude
    You could check this within the OnCollisionEnter function and only allow the damage to be sent if the velocity threshold is met.
     
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    It sounds like either your animation's direction is reversed or your model's world axis is incorrect. I've found this sometimes happens with Mixamo animations if they are not modified within Unity's Animation tab. You can adjust an animation's rotation within this tab as explained here (located within the Clip-specific properties section): https://docs.unity3d.com/Manual/class-AnimationClip.html
     
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    The guide should be the same, but you would need to change all portions of Emerald_AI to
    EmeraldAI.EmeraldAISystem . I will work on updating the Ootii integration guide though.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Hey there. I tried emailing you regarding this, but you never responded. I need to know the version of Unity and Emerald AI you are using so I can recreate this.
     
  27. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    If you want your AI to be fully static, you can try increasing their attack distance to the max value and setting the Obstructed Action (located under the Range Setting within the Damage Settings) to Stay Stationary.
     
  28. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This is a bug that happened when I updated the project from Unity 2017 to a newer version of Unity. To fix it, you have to reassign the demo character's mesh to its Skinned Mesh Renderer and reassign its animations to its Animator Controller. Sorry for any inconveniences. I'll have this fixed with the next update.
     
  29. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    There's a pretty in-depth guide here for creating shooting/ranged AI: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Creating-a-Shooter-AI

    If an AI isn't shooting, but you feel like it's setup correctly, it usually has to do with an obstruction. An AI's current obstruction can be Debug Logged by enabling the Debug Tools: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Enabling-an-AI's-Debug-Tools
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Unfortunately, Unity doesn't allow the swapping animations during runtime with the Animator Controller. However, this possible with an Override Animator Controller component: https://docs.unity3d.com/Manual/AnimatorOverrideController.html
     
  31. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Yeah, sorry about that. I'm working on being more active on the forums. Email is typically the best place to contact me at: Support@BlackHorizonStudios.com
     
    wersw73 and maniak_001 like this.
  32. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Here's a video showing the random waypoint issue.
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    What version of Emerald AI are you using? This was an issue that was fixed as of 2.4.1.

    Is your AI set to the Root Motion Movement Type in the Movement Settings? If so, do your AI's animations support Root Motion?
     
  34. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I'm using the latest version of Emerald AI.

    At first the Root Motion was checked on the Animator component so I unchecked it but the AI did the same thing.

    I'm using animations from the RPG Character, https://assetstore.unity.com/packages/3d/animations/rpg-character-mecanim-animation-pack-63772
    Here's a free version of the animations, https://assetstore.unity.com/packages/3d/animations/rpg-character-mecanim-animation-pack-free-65284

    This is the model I'm using for the AI, https://assetstore.unity.com/packages/3d/characters/humanoids/humans/bodyguards-31711
     
    Last edited: Oct 8, 2020
  35. maniak_001

    maniak_001

    Joined:
    Jun 13, 2016
    Posts:
    31
    @BHS Thanks for the reply

    Can I confirm whether what I mentioned about the OnPlayerDetectionEvent is a bug or intended behaviour?
    (I will also email this question but I thought it would be useful to share)
     
  36. maniak_001

    maniak_001

    Joined:
    Jun 13, 2016
    Posts:
    31
    For anyone interested, I received the following answer in email:

    I believe the intended purpose of the OnPlayerDetectionEvent is for non-enemy AI for things like basic NPC interactions with the player.

    You could try using the OnStartCombatEvent and checking the CurrentTarget variable to see if it's the player.
     
  37. YYfim

    YYfim

    Joined:
    Feb 9, 2018
    Posts:
    1
    Hi guys,
    I'm new to EmeraldAI, have been messing around and playing with the different configuration this powerful tool gives for over a month now.
    I've reached this thread and was amazed from the amount of knowledge, but did know where to start with this 105 pages so I have created a community SubReddit (important: it's not an official developer channel).

    https://www.reddit.com/r/EmeraldAI/

    Hopefully we can share the work and knowledge.
     
  38. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    Hi There i need some help , I Want my Ai not to Chase outside 30 units from its initial spawn location. Currently my Detection Distance is set to 15 ,Chase Distance to 20 Expanded Chase Distance To 25 And Distance Type to Starting Distance Now when Ai Detects player then it chase player to infinity if players speed is not enough to run away so what i want is that AI only chase the player to a max distance of 30 From it initial spawn position , How To Achieve that ?
     
  39. YOAJ1

    YOAJ1

    Joined:
    Jul 17, 2014
    Posts:
    26
    Q1:As you get closer to Both AI, it will start spinning around the player.

    Q2:After going around both AI
    Both AIs don't attack with Combat movement (Ranged) animation

    emeraldAI_setting.jpg
     
  40. XVB75

    XVB75

    Joined:
    Sep 12, 2020
    Posts:
    11
    Any ideas how to make the AI pause after being hit.

    A scenario would be:
    1. AI being hit
    2. Play hit animation (being stunned)
    3. Wait for X seconds before pursuing the player again
     
  41. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    Does anyone know how to get combat text to display with the RFPS 1.45(Latest) player?
     
  42. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    Hi, has there been any updates with the SetFollowerTarget Function? I have a spell the player uses to force the NPC to follow the player for a certain time, however when I cast the spell, and call that function the npc runs past the player and does what looks like a dynamic wander state. I tried to debug, but when I turn on debug for the NPC nothing happens, no rays, no console print outs nothing. I'm using 2019.4.0f1

    I have a pretty decent NPC schedule set up where they do daily things, that all works great, but follow does not. I have tags set right too.

    Any ideas?
     
  43. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS any idea when the next update is coming out?
     
  44. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    What is the link to the proper manual for the latest version of emerald?

    Surprisingly I didn't find a lot about receiving damage from the AI using a custom player controller. I did find the EmeraldAIPlayerDamage.cs script but it doesn't show how to get the damage/attack type the ai used. I was expecting a whole section in the manual about the subject. Maybe I missed it? (or maybe i got the wrong manual)

    I really wish you added events to run custom code. It would be the simplest way to allow customization. At least so we can manage receiving and sending damage.
     
    Last edited: Nov 8, 2020
  45. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Did localized damage make it into 2.4.1? (From and to the player)
     
  46. HypnotistDK

    HypnotistDK

    Joined:
    Feb 14, 2016
    Posts:
    15
    I try to get this working in a multiplayer game with Mirror ("Old Unet") but whatever i do my AI will not detect the client players, only the server player.

    Edit: Well i figured out that it could detect my players if i had a collider on it, and not only a character controller. Don't know why that worked in singleplayer and not in multiplayer.
     
    Last edited: Nov 8, 2020
  47. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello! Im also looking for this, any luck?
     
  48. Kojote

    Kojote

    Joined:
    May 6, 2017
    Posts:
    200
    Hi!

    I would like to set it up in Emerald so that if the player goes below a certain limit in health points, the AI's attack is stopped for a few seconds.

    My question is, is this even possible. If so, how?
     
  49. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    125
    Hey, you can do that. What I tend to do is create my own damage system, and just listen for damage event from Ai, or to ai. Example I set up a head shot event that detects if I hit enemy in head and makes it one shot kill. You could check for player health on damage from ai and do what ever you want.
     
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Root Motion needs to be set through the Emerald AI Editor as there are other mechanics that rely on the Emerald AI Movement Type setting. If your animations are Root Motion, ensure that Root Motion is enabled within Emerald AI: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Setting-up-an-AI's-Animations#step-6