A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by BHS, Jun 26, 2015.
would emerald ai work with sleepless footprints asset?
My Emerald AI deer roams until encountering a couple of benches around a campfire, where it gets stuck. I placed a capsule nav obstacle around the area, but the deer still gets stuck attempting to reach a point inside the nav mesh obstacle. Can I create an AI exclusion zone or something to solve this?
Hello! @BHS Is Astar A* pathfinding project supported?
Hey there! There isn't currently a built-in way to do this, but I plan on adding some API soon that will allow you to do so.
I'm working on one more update that will fix the remaining minor issues and add a new character controller system. After this, I will work on the update that will add more animations.
I totally agree. I'll be sure to add this with the next update.
I haven't tested it, but it sounds like you should be able to add footprints with an Animation Event on your AI's walking or running animations.
The AI shouldn't pick waypoints that it can't reach because it uses the same position API to ensure the generated point is on NavMesh before assigning it. Try searching for the line NavMesh.SamplePosition(NewDestination, out hit, 4, 1) in the EmeraldAISystem script. Try adjusting the 4 value higher to see if it allows the generated waypoint to be better placed.
Not yet, but I plan on adding support at some point.
If you're using the Dialogue System for Unity, try this in the Sequence field of the NPC's first node:
Hi, im usin urpg and I got the emerald ai to damage the player by following the docs but I cant get the player to damage the ai. I tried
if (other.gameObject.tag == ("Enemy"))
other.gameObject.GetComponent<EmeraldAISystem>().Damage(damage, EmeraldAISystem.TargetType.Player, transform);
but no luck
Nevemind this helped
Oh, well try using the PlayerWeapon3rdPerson instead, but attach it to your main player object. Have you tried using the included example player to see if everything is working correctly? I plan on adding an improved weapon/damage script to work universally with first or third person. I'm hoping to have this update submitted sometime next week.
Right, but what I was referring to is other events for example the one I have to put on the animation for cast spell such as: EmeraldAttackEvent
What other events are there.
Same issue here.
If anyone is interested in Playmaker integration, here is my initial set of Playmaker actions for EmeraldAI. I haven't fully tested this so please consider it an Alpha version. I don't know yet if I'll do any more work on this. It depends on if anyone uses it and if there are more requested actions.
I recommend extracting the files into the EmeraldAI folder, but you can put it anywhere in your project if you want.
My characters fight each other even they have same faction value.
The faction values are controlled by script, please see code below.
Did I miss something?
First of all, great asset, I've been making my through it and getting it to work with the Opsive UCC. So far I have gotten everything to work, I can damage the EmeraldAI, they can damage me, and they can damage each other. But, when I set the Emerald AI "characters" up for ranged, it is like they are shooting into a wall, none of there projectiles moves past the transform, whether they are shooting at the Opsive character or each other, the projectile acts like it hits some kind of collider. I'm using Emerald 2.3. I've tried removing everything in the scene but it doesn't seem to help. Any ideas?
I have an AI character that is not attacking my player. The AI detects the player, turns, then runs toward the player but when he reaches the player it goes out of combat mode and continues walking and pushing my player as if it were simply blocking its path to the the next way point. I have other AI characters that are set up the same way and they are attacking the player. This is just a different model.
Most of the events listed in the docs can be called with an Animation Event. They aren't just limited to calling them through code.
Relevant animation specific events are the follow:
Plays a idle sound when called (This can also be done automatically within the Sounds tab)
Plays a walk sound when called
Plays a run sound when called
Plays an attack sound when called
Plays a warning sound when called
Enables the AI's Weapon Object
Disables the AI's Weapon Object
I'll look into the issue with the projectiles firing too low.
When is this being called? Is there enough time for the Emerald AI system to be initialized? There's a possibility that Emerald AI is overriding the faction modifications, if your script is called first.
Very strange, this is the first time I've heard of this issue. My guess is that the AI's Box Colliders on your AI may been generated too big. Try adjusting them to fit within your AI's mesh. Also, ensure that your Ranged Transform is properly assigned to where you want the projectiles to spawn from.
If you're still having issues, a video of the problem would better help me understand what's happening.
What's this AI's Distance Type (Located under the Detection Options) set to? If it's set to Starting Distance, the max distance may be being exceeded making the AI return to its starting position and exiting out of combat mode. Try using the Target Distance or increasing the Chase Distance to see if it resolves the problem.
Since you stated that your updates are not going to be as huge but smaller and more often, any idea when the next update comes out?
Actually, after observing the behavior, it's not that it isn't finding the player. It is actually finding the player and attacking and will continue attacking and locking onto my player as expected. It's only after I land a successful attack that the enemy will simply ignore me and just keep walking and pushing me to where ever it wants to go.
I'm hoping no more than a couple of weeks.
I'm just about finished with a new demo character controller system for a much more polished player combat example. The current one is a bit..dated. I'm also working on a brand new "Combat Text System" that will work globally for all AI and even players with customizable text colors, fonts, animation types, and more all controllable through the Combat Text Manager. Best of all, it uses Unity's UI system and no longer uses the outdated Text Mesh component. I'll be making a status update on all of this sometime tomorrow.
What parameters are you passing when damaging the AI? If you are using:
Damage (int DamageAmount, TargetType? TypeOfTarget = null, Transform AttackerTransform = null, int RagdollForce = 100)
Ensure that you are also passing the AttackerTransform or the AI may be getting a null target which could make it lose its reference to your player.
Honestly, I'm not sure. I'm not much of a coder, I just used the steps provided by the Invector AI integration tutorial by BHS. Where would I find the code you referenced and how would I check?
I’m encountering 2 problems with an AI agent in my game - possibly related:
1. I have an enemy using waypoints and he works fine until he sees the player Once the player is detected, the AI has omniscience and is able to find the player no matter where he hides. Is this a layer issue? Is the agent seeing through walls, etc. because they’re on a different layer? I selected "water" for the layer as that is what is in the tutorial video.
2. The second issue is that the enemy will follow the player for a while and then stop moving apart from to face the player (no matter where the player is on the level, the AI will turn to face him).
(You guys need a proper forum instead of an 89 page thread!)
I'm sorry if this has been brought up before, but I'm experiencing an issue in which when given a destination, the AI moves to it, but stops close by. Is there a stop distance number I can set programmatically so that they stop exactly at the destination in certain scenarios?
I also noticed something similar for combat. AI will go only as close as they need to be to reach with melee, but if something is walking away from them, they will have issues keeping up because they'll approach it, attack as it walks away, and repeat the process until the target stops long enough to be hit. Can the attack range be set to a distance larger than the "combat range" as it were?
I have a sound issue. I set up an Emerald Ai animal with an idle sound. The sound plays, but it doesn't come from the animal, it sounds the same whether I am near the animal or far away.
Make sure the AudioSource is set to 3D spatial blend. And set your Max distance as well.
@BHS I have a request for next update. I'm working on integrating EmeraldAI with ORK and am planning to have EmeraldAI handle all the locomotion, enemy detection, etc, but have ORK drive the actual attacks so that I can be more specific in having the AI attack a certain way or cast a spell, or use an item, etc.
The problem I have is that even though I removed all Attack animations from Emerald, it still tries to initiate an attack. The code randomizes attack index so that it is never less than 1 no matter what. Even if I change TotalAttackAnimations to 0 in code, the attack randomizer still runs and tries to perform an attack.
At a minimum, I would like to see a fix where if TotalAttackAnimations is set to 0 in code that the attacking code would not run. Ideally, this would still work even if there are actually 5 attack animations in the list. That way, I could duplicate the attacking code and pick specific attacks and drive them from my own code. Another possibility is to simply have some flag that specifies whether attacks are driven by Emerald AI and instead of checking the TotalAttackAnimations it would check to see if EmeraldAI is in charge or not. Maybe call the flag something like EmeraldControlsAttacks and default to true.
Spacial Blend is full 3D and I am adjusting the Max distance, etc. It's getting better. Thanks for the tips.
The Invector integration tutorial passes the Invector player when damaging an AI so I'm not sure why the AI would lose the target reference. Did you setup your layers and tags correctly?
API and a damage example can be found here: https://docs.google.com/document/d/...2njM7Jx9pYlqgbtM8/edit#heading=h.ocdxmxz2k2sx
1) Are you using the Trigger or Line of Sight Detection Type (located under the Detection Options)? The Line of Sight feature will only target a target if it is unobstructed, whereas the Trigger type ignores this. Ensure that you are using the Line of Sight Detection Type.
2) Are you receiving any errors when this happens? This is the first time I've heard of this issue.
If you want an additional support method, Discord is a great alternative: https://discord.gg/XpWYzjp
If you want to manually set the stopping distance for an AI, you can use:
However, setting the AI's Stopping Distance to the minimum amount of 0.25 should allow the AI to stop right on its destination.
As for the combat stopping distance, this is needed or the AI would walk right on their target's position. The reason the AI attacks right when it arrives to the target's position is working as intended, but this depends on the game and combat type. To remove this feature, find the following line and comment it out (located in the EmeraldAIBehavior script). I will add an option to enable or disable this with the next version.
EmeraldComponent.AttackTimer = EmeraldComponent.AttackSpeed-0.25f
Have you tried stopping the AttackState function from being called in the EmeraldAIBehavior script? AttackState(); is located twice within said script and handles the is responsible for triggered all attacks. Commenting them out should work. I can look into a better solution for this as you've mentioned though.
Oh, yeah, I had no problem fixing the code to do it myself. I just thought a solution on your end would be best so future updates wouldn't need code changes again.
Has anyone used Final IK with EAI, and if so how difficult was it to integrate the two?
I can't seem to get the EAI ranged gun combat on my enemy character to look realistic. This is a VR project, so may be more glaring when there are small offsets, but I find my enemy always seems to be aiming its gun a bit too far left or right of the player.
It seems Final IK has AIMIK which appears to streamline this aiming aspect greatly, but given its steep price tag, want to make sure it won't cause issues on my existing EAI setup.
Thanks for the reply. Yes, I have detection set to "Line of Sight." The Obstruction Ignore Layers is set to "Ignore Raycast" and under Tag Options the detection layer are set to "Default" and "TransparentFX."
Gotcha. It shouldn't be a problem to add something like this. My only concern is it possibly confusing other users. Maybe I will make it more of a hidden option.
Yeah, I was going to suggest that as well. If you make it public, but don't expose in the editor than it can be accessed in code, but no one will even know it's there and they can't accidentally turn it off.
If your AI's aiming is off (which I'm assuming you are using the Head Look feature), try using a "dummy" object as the player instead of the actual VR player to ensure the AI are aiming at the right position.
Final IK is supported and I've made an integration tutorial for it. However, this only covers the foot IK and not the aiming.
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).
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.
Looks great! Thanks for the quick update!
I really like the red outline on the enemy being targeted. Nice.