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

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Yup, and what's even more interesting is that I made sure that aggro was disabled for each one of the companions and the spawned bad guys, and it only happens with 3 or more companions at once. I think its time to go back to a raw EAI install for testing. As you can tell, I've modded the scripts a bit to get things working the way I want them to. Probably something I added for integration again.

    Kudos by the way. Ever single update so far has added interesting functions and features. I am very pleased with EAI, having bought it so long ago at version 1.(something)...

    Mark
     
    BHS likes this.
  2. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    I have an interesting question for you. If I wanted to say change the detection from an overlapSphere to a overlapCircle projected from waist level, what elements would I need to change? EDIT: Or is there a way to specify the "Y" value for the detection radius?

    I think part of the combat mode "freezing" has to do with the fact that my scene is a model of my home, and with a detection range of 18, the companion AI is detecting things above them in the basement, and below them when they are on the 1st or 2nd floor. There may be a door with a navmesh obstacle blocking the path, but they can still detect the bad guys...
     
  3. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Its not gonna break anything right?
     
  4. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    You purchased this item on Jul 16, 2018. Dear lord, that felt ages ago. Its literly one of the only system assets i use.
    Custom everything else, mind you do do have custom AI as well. Ive debated on going back to unistorm over my custom sky.
     
    BHS and SickaGames1 like this.
  5. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Where is the minimum distance for dynamic wander hard coded? Just the line where it's set would be useful, idk why I'm not seeing it
     
  6. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    I think in system folder emerald ai system script no?
     
  7. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    Regards

    Can you help me?
    Everything works fine for me, my enemy attacks and harms the player,
    But I have the problem that when my character is at a height where I shouldn't attack him, the enemy attacks him and hurts him.

    Can you set the height that the enemy attacks?

    In the image you can see the position of the player and the enemy, the player will be 9 meters high, and the enemy continues to harm him.

    Thanks in advance

    https://imgur.com/a/0tmshq0#kakENTj

     
  8. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    is it possible to use the player damage with made controller (Not asset one)?
     
  9. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Yes
     
  10. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    and player needs a box collider or will a capsule collider do ? (not using any weapons on either ai or player)
     
  11. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    On your own controller? Any collider will work. AI just sends a message on hit.
     
  12. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    ah right my still dosen't seem to cause damage to the player it attacks but it wont send damage
     
  13. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Did you read the documents to set it up?
     
  14. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    BHS discribes here
     
  15. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    yeah no i followed all of this just ai dosen't seem to deal the damage to my player, it deals damage to other ai though
     
  16. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    whats the Damage function for your controller?
     
  17. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    my controller dosen't have a damage function atm i have a health script and damage script, health attached to player and damage attached to ai. My controller is just a basic movement script
     
  18. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    ahh.... well in your health script, what is the message or what not called, in order to damage your health script?
     
  19. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    sorry finally got it damaging my player but its health goes past 0 in minus numbers is their away to stop this?
     
  20. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    im not a coder at all, but in the damaging portion, you would need something in the health script like

    if (Health <= 0)
    do stuff
     
  21. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    alright have something similar :(
     
  22. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Thats why i use playmaker . So in the emerald player damage script, i cause it to send a fsm event to my playmaker health script. To which i can do all kinds of stuff to it
     
  23. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    nvm done it :) thanks anyway though :)
     
  24. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    Thanks for insights. Actual problem turned out to be that I had the 'PlayerHealth' script attached to my player, instead of 'EmeraldAIPlayerHealth'. I think it's an artifact of my older project I reused player components from.
     
  25. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    Anyone know how to delay the game from pausing once player has died ?
     
  26. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    I see there is 'Hit Effect' for when AI takes melee damage in Combat Settings (the 'Use Hit Effect' setting). Why is there no 'ranged' hit effect?
     
  27. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    On the ranged ability, can you use the collision effect? I forget if you can use multiple of those too
     
  28. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Pausing? Like by error? Or by script? I dont remember seeing anything to do with pausing the game in any of the emerald scripts.
     
  29. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    na i mean like when testing game it plays then once my character dies the pause button gets selected but i want to delay this
     
  30. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    this pause action
     

    Attached Files:

    • Test.png
      Test.png
      File size:
      651.6 KB
      Views:
      472
  31. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    On your console window, turn off error pausing
     
  32. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    ah that worked thank you :) forgot about that!
     
  33. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    Also, I'm trying to inflict damage on Enemy AI by calling Damage via script (as shown on last page of current EAI documentation).
    What does the EmeraldAI.EmeraldAISystem.TargetType.AI in that Damage function map to? Should it be Player or AI?

    if (hit.transform.GetComponent<EmeraldAI.EmeraldAISystem>() != null)
    {
    hit.transform.GetComponent<EmeraldAI.EmeraldAISystem>().Damage(emeraldAIAndroidDamage, EmeraldAI.EmeraldAISystem.TargetType.AI, hit.transform, 50);
    }

    Additionally, I had thought that any time that Damage function was invoked the 'ranged combat hit animations' would be triggered, but they never get fired. Is there something else I need to provide to trigger those?

    upload_2019-9-28_17-14-37.png
     
  34. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    to damage AI, I call Void Damage (int , target type, transform, int) to the AIs emerald AI script. I tend to do Player for the target type. but im not entirely sure what that does. I could imagine it does numerous things for targeting and such. but if I call target type of AI or Player, Damage wise it doesn't seem to matter from what ive seen. both still do damage. The range "hit" animation should play when your target is hit, and is in the ranged stance. (not necessarily just at ranged).
     
  35. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    really by looking at the animator. its mainly just a Hit trigger that goes off, if the AI is in movement state, it goes to the Hit animation, if the AI is in the melee locomotion states, the trigger goes to the melee hit animation, and if the AI is in the ranged locomotion states, the Hit goes to ranged hit animations. also, something new I learned. in basic movement state, the AI cant block, according to the animator.
     
  36. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,745
    Heres the promo video i threw together (WIP), EAI:

     
    Last edited: Sep 29, 2019
    BHS, MagiSoftworks and combatsheep like this.
  37. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Looks nice, would be nice to hear footsteps. If you also want a added level of realism. You should look into the spine and tail animator. They are easy to use and make a phenomenal difference
     
  38. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
  39. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    In a future update, could we get an option to not disable additional colliders on Emerald creatures? Having to manually enable each one is a little bit monotonous, especially if you have a lot.
     
    warthos3399 likes this.
  40. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,745
    @p_hergott yea, i saw that will be grabbing that this coming week, thnx :)
     
  41. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Is there an intergration with A* Path finding project?
     
  42. unity_7UFP4-iCkwsgjg

    unity_7UFP4-iCkwsgjg

    Joined:
    Dec 13, 2017
    Posts:
    323
    how can i link my damage script to allow it to damage ai ? does the health located in stats go down ?

    damage script :

    Code (CSharp):
    1.  public int DamageAmount;
    2.  
    3.     private int hitRange = 1;
    4.  
    5.     public bool isDead = false;
    6.  
    7.  
    8.     void Update()
    9.     {
    10.         if (Input.GetKeyDown("e"))
    11.         {
    12.             Attack();
    13.  
    14.         }
    15.  
    16.  
    17.         void Attack()
    18.         {
    19.                 RaycastHit hit;
    20.                 Vector3 forward = transform.TransformDirection(Vector3.forward);
    21.                 Vector3 origin = transform.position;
    22.  
    23.                 if (Physics.Raycast(origin, forward, out hit, hitRange))
    24.                 {
    25.                     if (hit.transform.gameObject.tag == "EmeraldAI")
    26.                     {
    27.                         hit.transform.gameObject.SendMessage("AIDamage");
    28.                         hit.collider.GetComponent<EmeraldAI.EmeraldAISystem>().Damage(50, EmeraldAI.EmeraldAISystem.TargetType.AI);
    29.                         hit.collider.GetComponent<DamageXP>();
    30.  
    31.  
    32.                     }
    33.  
    34.                 }
    35.  
    36.             }
    37.  
    38.  
    39.         }
     
  43. UDN_68a3a08d-b184-416c-8d9f-f1f5b1bedf54

    UDN_68a3a08d-b184-416c-8d9f-f1f5b1bedf54

    Joined:
    Jul 29, 2018
    Posts:
    4
    Hey @BHS great asset, i'm facing an issue that if i shoot AI outside its detection trigger logically it should attack me if its Behavior is Aggressive/Cautious and confidence level is Brave/Foolhardy. It just don't attack keeps on playing Combat idle animation on loop and then it dosent matter if i go close it it wont attack me also, but if i go in trigger distance it works fine like it should. What could i have done wrong, im not missing any animations.
     
  44. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
     
  45. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    No one has this problem? I have placed a box on top of the enemy, the box is very far above it, and it hurts, I have looked in the manual and there is nothing to set the attack height.

    I am using RFPSP, and I have followed the steps of the tutorial and its integration, but this happens to me.
     
  46. FrostedBrain

    FrostedBrain

    Joined:
    Sep 26, 2019
    Posts:
    31
    How can I make my AI flee near death by crawling off? I tried using flee events to play the clip as an emote loop but it didnt work
     
  47. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    Well, this problem has to happen to everyone.

    I open the Playable Demo scene
    I put a ramp,
    and the enemies hit and damage the player, being very far in "Y" from them

    This is not normal, if it is melee the enemies should not hit the player at that height, they do not arrive.

    https://imgur.com/a/z1cvpx8
     
  48. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Physics2D.OverlapCircle is 2D only and will not work. There's no way to set the y value for detection as it's a radius and has no individual axes. However, you could switch the Physics.OverlapSpere to Physics.OverlapBox and set the halfExtents x and z for the distance to check then individually set the halfExtents for the y to control the height. So, something like this:
    Code (CSharp):
    1. Collider[] CurrentlyDetectedTargets = Physics.OverlapBox(transform.position, new Vector3(EmeraldComponent.DetectionRadius, YourDetectionHeight, EmeraldComponent.DetectionRadius), EmeraldComponent.UILayerMask);
    If you wanted the detection to be near the middle of your AI, you could try the addition of the AI's y local scale:
    Code (CSharp):
    1. Collider[] CurrentlyDetectedTargets = Physics.OverlapBox(transform.position+new Vector3(0,transform.localScale.y/2,0), new Vector3(EmeraldComponent.DetectionRadius, YourDetectionHeight, EmeraldComponent.DetectionRadius), EmeraldComponent.UILayerMask);
    Are your AI using the Line of Sight Detection Type? They shouldn't be able to set other AI as targets unless they can see them.
     
  49. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    It shouldn't. It's just some minor bug fixes.
     
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    In the EmeraldAISystem script within the GenerateWaypoint function:
    Code (CSharp):
    1. while (DistanceFromDestination <= (m_NavMeshAgent.stoppingDistance + 2))
    The hard coded minimum distance is used to stop an AI from generating a waypoint that's too close. If an AI generates a waypoint that's below it's stopping distance, it won't move to it.
     
    christougher likes this.