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

    alexgemini002

    Joined:
    Jan 15, 2020
    Posts:
    24
    dear developer:
    can you have a offcial document about integration emerald ai and survival engine. survival engine has it's own health system. there have something need to be consider:
    1. how to sync survival engine's health system and emerald ai health.
    2. the AI can damage the survival engine player similiar to other tutorial
    3. how the AI damage other survival engine AI , maybe different faction.
    4. how survival engine range combat damage emerald ai.

    thanks for taking time.
     
  2. trblst

    trblst

    Joined:
    Feb 18, 2015
    Posts:
    14
    Why don't you integrate them and document it yourself? Asking the developer to do this is asking him to halt development of his asset AND asking him to acquire a license to be able to test and integrate with a 3rd party asset that he may not own. Integrating assets also requires an understanding of the 3rd party asset as well, I don't feel that's fair to ask.
     
  3. alexgemini002

    alexgemini002

    Joined:
    Jan 15, 2020
    Posts:
    24
    I only figure out how to do survival engine player using melee weapon to damage a emerald ai . That's why I ask developer to help if they had time.
     
  4. Kim-sung-il

    Kim-sung-il

    Joined:
    Sep 19, 2015
    Posts:
    2
    For example, in the battle between AI and AI,
    (Assuming that you are using an LBD)
    What are the criteria for judging the hitting point when attacking each other?
    Does the damage corresponding to the area go in based on the area where the weapon touches?
     
  5. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    32
    Any news on release date?
     
    trblst likes this.
  6. ImminentWaffle

    ImminentWaffle

    Joined:
    Oct 19, 2013
    Posts:
    7
    I'm having an issue that I think started with the Puppet Master Integration. I've got an AI firing a rifle using an Offensive Ability to spawn and fire the bullet. After my AI was integrated with Puppet Master, the spawn point of the bullet and the Ability Effect was offset slightly to the right of the emission point I had set. Was recommended by someone on the discord to set the Mode on the PM component to Kinematic, which fixed the bullet, that now emits correctly out of the barrel of the gun, where the emitter is set. The ability effect (flash and smoke) still is offset to the right of the emission point. It looks like that *sometimes* it emits from the correct spot, but mostly is offset. Any ideas?
     
  7. NeoWatchowsky

    NeoWatchowsky

    Joined:
    May 20, 2014
    Posts:
    24
    Hello!
    I'm about to buy this plugin but I have some questions before.
    1 Can I use this in VR?
    2 I have URP in my project can I convert this to URP?
    3 I'm using Playmaker is there support for this?
    4 The main reason to buy, I want an animal to run away and when I shoot it it dies. Is this acheavable?
    5 Has the plugin some animal models with animation?
    Thanks for the answer.
     
  8. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS Its been crickets... Any word on your next update?
     
  9. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    1) Yes, if you want to add damage to a custom controller, you can follow the guide here: https://github.com/Black-Horizon-St...d-AI#setting-up-custom-damage-with-emerald-ai
    2) Yes, there will be one demo material that cannot be converted, but it is not needed and can be replaced with any URP material.
    3) PlayMaker isn't directly integrated, but it is supported. Here's one guide on how to do so: https://forum.unity.com/threads/rel...ality-ai-solution.336521/page-69#post-4703873
    4) Yes, there is a Coward AI behavior that allows AI to flee from attackers and die when their health reaches 0.
    5) There are a few example animated models, that are from Unity's 3D Game Kit, used in various example scenes to showcase functionality.
     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Yes, I've been busy working on it. I did state that I would discuss it when I feel like the features are where they need to be, but I understand I haven't been very transparent with what the upcoming update will offer.

    Here's a few big features I'll mention. These are pretty much integrated and are undergoing testing and polishing. I'm probably a few weeks away from showcasing these with demo videos.
    • Reactive Dodging (the ability for AI to attempt detect and dodge incoming projectiles and melee attacks)
    • Reactive Blocking (the ability for AI to attempt detect and block projectiles and melee attacks, when within range of an enemy).
    • Hit Recoiling (the ability for an AI's attack to stop if its target is blocking and play a recoiling animation)
    • Strafing (the ability for AI to strafe around their targets).
    • Brand new IK system with both Humanoid and Generic Rig support.
    • Decoupled and shareable Animation Profiles (so any AI can share animations, given they share the same rigging).
    • Ability to mix range and melee attacks within one attack type.
    • Customizable arcing support for projectiles (through Ability Objects) allowing projectiles to have varying arcing and randomized paths.
    • Customizable projectile amounts (through Ability Objects) allowing users to control how many projectiles are spawned from a single EmeraldAttackEvent with customizable time between each shot.
    • Proper hit animation canceling (allows any current animation to be interrupted to play an AI's hit animation)
    • Plus lots more
     
    timerace, julianr, shyamarama and 2 others like this.
  11. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Sounds like a lot of good updates! Are there any big updates that will help shooter type games? I know a cover system isn't probably in your next update but a lot of what Emerald has is really good for animals/RPG type AIs and could use a little more mechanics for shooter games.
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Yes, this update will also help with shooter type games. Abilities like throwing a grenade will be possible (due to the new features and improvements made with the new update). AI who are using dodging can then detect and dodge grenades that land near them. AI can also have two ranged weapons so they can have a primary ranged weapon and a secondary (for something like a pistol). I have plans for adding some type of cover system some time after the release of the new update.

    My goal for all this is to have a flexible AI system where users only use the features they need and do not have to manage features they are not using. An AI can be as complex or as simple as someone wants.
     
  13. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    190
    Is there an approximate ETA or concrete plans and updates regarding A*Pathfinding? Especially for runtime generated or changing scenarios this would be really useful.
     
  14. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Sounds great! I usually Emeald a ton for RPG games but I am hoping you can also the shooter side of it as well :) ty!
     
    BHS likes this.
  15. Blackghost

    Blackghost

    Joined:
    Oct 2, 2012
    Posts:
    111
    Hello, How do I go about assigning multiple ranged attack transforms for an AI?
     
  16. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Once I'm finished with the new update, I will look into A* Pathfinding support. If it integrates well, I will add support for it through an update. There's no ETA for this at the moment.
     
    valentinwinkelmann likes this.
  17. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    It will be possible with the upcoming update to have as many customizable attack transforms as needed, but with the current version, you would need to update this manually through code.

    You would need to assign this to the RangedAttackTransform variable (located with the EmeraldAISystem script).
     
    Blackghost likes this.
  18. Blackghost

    Blackghost

    Joined:
    Oct 2, 2012
    Posts:
    111
    How would I go about scripting it without breaking the code?
     
  19. Loki18000

    Loki18000

    Joined:
    Apr 1, 2015
    Posts:
    75
    Hello, sorry for the super long delay! With this asset in VR using the Quest 2 it acts very strange. It inverts the movement so looking up will look down and so on. The whole game will just shake too. It still works fine without the asset with animated models and there is no errors either.

    Maybe it's just some confliction of some type. I don't really need AI of this level in my current project so it's fine to move along without it. No idea what is causing the issue.
     
  20. Blackghost

    Blackghost

    Joined:
    Oct 2, 2012
    Posts:
    111
    public Transform[] RangedAttackTransforms;

    for (int i = 0; i < RangedAttackTransforms.Length; i++) {
    Transform RangedAttackTransform = RangedAttackTransforms;
    // rest of the code that uses RangedAttackTransform
    }

    RangedAttackTransforms = new Transform[] {
    transform.Find("RangedAttackTransform1"),
    transform.Find("RangedAttackTransform2"),

    };

    Is this the correct code?
     
  21. Nikodemus

    Nikodemus

    Joined:
    Nov 28, 2014
    Posts:
    32
    WIll there be AOE damage attacks in the next update?
     
    micuccio likes this.
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    This sounds like it's related to the screen shake feature. Ensure that you don't have the CameraShake script in your scene. One of the Grenadier from the Shake Screen Example has this script on it that's called through an On Do Damage Event. I'm not sure if this is what's going on though.
     
  23. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    That looks like it should work.
     
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Yes :)
     
  25. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Can't wait! Excited to see what you have done.
     
    BHS likes this.
  26. alexgemini002

    alexgemini002

    Joined:
    Jan 15, 2020
    Posts:
    24
    dear developer:
    when some player attack the emerald ai enemy, it will cause emerald into getHit state. and it will reset current attack time counter, so If player attack much frequent than enemy, the enemy will never hit back , this is very bad for range enemy, am I understand correctly? is there an options to let enemy not reset attack time counter even it get hit ?
     
  27. heartingNinja

    heartingNinja

    Joined:
    Mar 26, 2015
    Posts:
    35
    Is there a way to set the Chase Distance to closer value to Detection Distance? Or better have if not Chase if no Line of Sight for a time.

    I am guessing this is were I need to make changes but not sure.

    Code (CSharp):
    1.  AttackState();
    2.  
    3.                 //If our target exceeds the max chase distance, clear the target and resume wander type by returning to the default state.
    4.                 if (EmeraldComponent.MaxChaseDistanceTypeRef == EmeraldAISystem.MaxChaseDistanceType.TargetDistance && EmeraldComponent.DistanceFromTarget > EmeraldComponent.MaxChaseDistance)
    5.                 {
    6.                     DefaultState();
    7.                 }
     
  28. trblst

    trblst

    Joined:
    Feb 18, 2015
    Posts:
    14
    I've seen this issue too. WIth melee as well.
     
  29. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @BHS You can test this with RFPS melee attacks and the AI stands there and takes a beating without attacking..
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    If you set an AI to have a min and max attack speed of 0, it should prevent this.
     
  31. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    An overlap distance is needed to prevent the possibility of AI getting stuck between the return to start and attack state. However, you can adjust the cap of this by doing the following.

    Within the EmeraldAIEditor script, find the lines below and change the 5 value to something lower:
    Code (CSharp):
    1. DetectionRadiusProp.intValue + 5
    If you are wanting the AI to give up on a target based on not seeing a target for x amount of seconds, attach the included AdvancedLineOfSight script to your AI.
     
    heartingNinja likes this.
  32. alexgemini002

    alexgemini002

    Joined:
    Jan 15, 2020
    Posts:
    24
    If I set min and max attack speed to 0 , how could different enemy have different attack interval? I think emerald need not reset attack time counter when it get hit , this is what most game do. could you consider make a patch for this? really need it.
     
    SickaGames1 likes this.
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Within the EmeraldAIBehaviors script, find the following line:
    Code (CSharp):
    1. if (EmeraldComponent.m_NavMeshAgent.remainingDistance < EmeraldComponent.m_NavMeshAgent.stoppingDistance && !EmeraldComponent.m_NavMeshAgent.pathPending && !EmeraldComponent.IsMoving && !EmeraldComponent.IsAttacking && !EmeraldComponent.IsGettingHit)
    And change it to:
    Code (CSharp):
    1. if (EmeraldComponent.m_NavMeshAgent.remainingDistance < EmeraldComponent.m_NavMeshAgent.stoppingDistance && !EmeraldComponent.m_NavMeshAgent.pathPending && !EmeraldComponent.IsMoving && !EmeraldComponent.IsAttacking)
    This should remove the condition of getting hit so the AttackTimer can still increase and generate an attack when needed.

    This is all improved with the upcoming update as there's customizable flags/conditions that are used for actions like attacks. This should allow things to work better with the current version for now though.
     
    Last edited: Mar 30, 2023
    trblst likes this.
  34. trblst

    trblst

    Joined:
    Feb 18, 2015
    Posts:
    14
    Are we still looking at the update this month? I’ve been holding off on writing code that integrates with Emerald AI since you said there will be an overhaul.
     
  35. Acreates

    Acreates

    Joined:
    Dec 12, 2016
    Posts:
    41
    Hello,

    Melee works perfectly.

    Range, I have the AI shooting each other, however no damage is incurring. Same layers, tags and factions as melee. Did I break something when I used copy/paste of an Ability?
     
  36. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I’m really aiming for the end of this month, but with the magnitude of this update, the ETA may go into next month (May). I’m planning on doing a status update soon that will discuss the new update and everything that’s coming with it.
     
    iChuy, julianr and SickaGames1 like this.
  37. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    Hold you to that!
     
  38. trblst

    trblst

    Joined:
    Feb 18, 2015
    Posts:
    14
    Will there be a beta going out beforehand? Just wondering. Trying to get a head start on looking through the code.
     
  39. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Enable the Debugging Tools to see if the projectile is colliding with something other than your AI.
     
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    I don't think I plan on doing a beta, but if that changes, I'll post about it here.
     
  41. Acreates

    Acreates

    Joined:
    Dec 12, 2016
    Posts:
    41
    I created a new project, synced to head in Perforce and the same problem.

    I deleted Emerald, the. redownloaded Emerald and now it works.

    I suspect that copy and pasting abilities breaks something, and instead use the create>ability instead from the project
     
  42. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    Got a curious one for yas, I am using the emerald IK for look at ranged combat.

    I notice that when firing the bullet (ability object) is spawned at the location of the rangedattacktransform. This transform is parented to my characters hand and as such, is obviously prone to character movement.

    The projectile spawns from the rangedattacktransforms position in the editor (the current position of the transform) before pressing play. It maintains this offset every time it fires. Even if the character moves around it will still fire with the same offset.

    So my character is in T-pose in editor;

    upload_2023-4-11_18-56-22.png

    The gizmo is the ranged attack transform which is parented to the hand bone. All good.

    Notice the green ray which is just my own script on this transform which just does;

    Code (CSharp):
    1. Debug.DrawRay(transform.position, transform.forward * 100f, Color.green, 0.1f);
    To show that its pointing in the forward direction.

    I made 2 extra objects for debugging which is just a yellowcube and a greencube.

    During update, yellow is;

    Code (CSharp):
    1. yellowcube.position = GetComponent<EmeraldAISystem>().RangedAttackTransform.position;
    You can see during play the yellow cube is positioned at exactly the rangedattacktransform.position;

    upload_2023-4-11_19-3-55.png

    But the bullet spawns at the editor position before I pressed play, same as my debug ray which has not disappeared (also weird).

    If I add this to the CreateEmeraldProjectile();

    Code (CSharp):
    1. FindObjectOfType<mycustomcomponent>().greencube.position = RangedAttackTransform.position;
    During play you can see the green cube before firing;

    upload_2023-4-11_19-6-14.png

    And then after;

    upload_2023-4-11_19-6-45.png

    So the green cube has moved to the rangedattacktransform position. Which is the position during editor, not during play.

    I then modified the EmeraldAISystem.cs from this;

    Code (CSharp):
    1.         if (TargetEmerald == null)
    2.                              CurrentProjectile = EmeraldAIObjectPool.Spawn(m_EmeraldAIAbility.AbilityEffect, RangedAttackTransform.position, Quaternion.LookRotation((CurrentTarget.position + (CurrentTarget.up * CurrentPositionModifier)) - RangedAttackTransform.position, transform.up));
    3.                          else
    4.                              CurrentProjectile = EmeraldAIObjectPool.Spawn(m_EmeraldAIAbility.AbilityEffect, RangedAttackTransform.position, Quaternion.LookRotation(TargetEmerald.HitPointTransform.position - RangedAttackTransform.position, transform.up));
    5.                      
    To this;

    Code (CSharp):
    1.                       if (TargetEmerald == null)
    2.                             CurrentProjectile = EmeraldAIObjectPool.Spawn(m_EmeraldAIAbility.AbilityEffect, FindObjectOfType<mycustomcomponent>().yellowcube.position, Quaternion.LookRotation((CurrentTarget.position + (CurrentTarget.up * CurrentPositionModifier)) - RangedAttackTransform.position, transform.up));
    3.                         else
    4.                             CurrentProjectile = EmeraldAIObjectPool.Spawn(m_EmeraldAIAbility.AbilityEffect, FindObjectOfType<mycustomcomponent>().yellowcube.position, Quaternion.LookRotation(TargetEmerald.HitPointTransform.position - RangedAttackTransform.position, transform.up));
    5.  
    So when i fire, the bullet should spawn at the same position as the actual rangedattacktransform and yellow cube (which is the same position);

    upload_2023-4-11_19-12-46.png

    And the bullet spawns correctly.

    What magic is this?
     
  43. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    found it
    upload_2023-4-12_19-42-58.png
     
  44. timerace

    timerace

    Joined:
    Feb 27, 2019
    Posts:
    27
    @BHS hello, will you add the Stats system in the upcoming update?
     
    SickaGames1 likes this.
  45. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Interesting, are you copying the ability object in the Project tab? I have never had issues copying abilities.
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    That is strange, I'll have to look into this. Thanks for providing your solution.
     
  47. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Is this what was causing the Ranged Attack Transform position issues?
     
  48. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
    Hey there, I'm going to try and get stats integrated with this update, but there's a chance it may need to be included with an update after the initial release of the upcoming version. I'm working on getting the upcoming update out as soon as possible and I'd like to not have to push its release back any further.
     
    SickaGames1 likes this.
  49. heartingNinja

    heartingNinja

    Joined:
    Mar 26, 2015
    Posts:
    35
    Any help on this problem would be great.

    When the enemy AI sees my player at a location the enemy AI can not reach it just freezes. If I go back onto a location that the enemy AI can reach it works again. I would like the AI to get closet to where the player is, more important trying to get it to leave attack mode if it does not see the player using the Advanced Line Of Sight script.

    When the player get back to an area that the enemy can reach the enemy runs toward the player even if out of sight for a long time.

    Enemy AI getting closer to the location of player and using the Advanced Line Of Sight script when the enemy AI can not reach the player is what I am trying to solve.

    Using Nav Mesh Components not build in Unity Nav Mesh.

    Edit: I see the CheckPath void in EmeraldAISystems. Added a debug where you have //Path is valid and AI finds a path then just stops because there is not real path.

    Thanks
     
    Last edited: Apr 18, 2023
  50. jiforstudiogames

    jiforstudiogames

    Joined:
    Sep 12, 2022
    Posts:
    1
    Hello, I have a problem and I can't make the AI with ranged weapons, it just can't aim at the player in any way, I need a similar implementation as from one of your demo videos, can you please share this demo scene? I have all the right assets from this video, but I can't set up the AI like you have
     
    khushalkhan likes this.