Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[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. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I tried out the new version in a clean project and using the bear from protofactors animal pack, but having issues with root motion, seems the speed isn't setting correctly. Is there anything I need to change on the bear rm animations?

    Cheers Jim
    https://i.gyazo.com/8ae37a9759e642a81802b46c93855f4e.gif
     
    Last edited: Mar 7, 2019
  2. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Yes, I'm currently working on it.


    Very cool game.

    I don't believe you will have to completely delete everything again. However, I'm working on a mass setup tool to allow users to copy components from one AI and apply it to other AI objects that share the same rigging and animations. PM me if you need it.


    I'll get it packaged up and send you a PM.


    I just tested this and I see what you mean. You should be able to slide the doc over to view the rest of the code. That worked for me. Are you using the Google Docs app?


    Do you mean Invector? I used the most current version when making the tutorial so everything should be working.


    I will be working on the UFPS integration tutorial today. I will post it here as soon as it's done. Yes, it will cover the melee functionality.


    I'm working on it. :) I have a lot going on with Emerald AI, UniStorm, and Crux.


    I will have to test PlayMaker and figure out why it's not visible. What are the requirements for a function to be visible, does it allow multiple parameters or only 1? The damage function requires 2, but supports up to 4. There really is no difference to how it was with version 2.0 other than the two optional parameters.


    I'm working on updating the documentation API today so they will include the script name changes as well as the newly added namespace. Basically, you have to change each reference of Emerald_AI to EmeraldAI.EmeraldAISystem and everything should work fine.


    The tutorial I made has full blocking support. What's the error you are getting?
     
  3. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You need to edit the EmeraldAIPlayerDamage script. This allows you to add a custom function that will be called when the player object receives damage. This script is automatically added to your player. See the commented out sections of how to integrate other assets.


    I'll package it up right now and send it over to you. :)


    It sounds like the player is obstructed by an object or that the AI is not detecting the correct object as the player. Try enabling the Debug tools located under the Docs tab (make sure all of them are enabled). This will tell you which object is the target and which object is causing the obstruction. This will need to be done with each AI you're testing.


    Did you set your Movement Type, located under AI's Settings>Movement to Root Motion? The speeds for root motion animations can be set within the Animations tab. These directly affect the AI's movement speed. So, if your animation speed is set to a low value, it affects the overall speed of your AI. I have tested that exact model so I know it works. You can try posting a screenshot of your settings so I can see if there is something that might be causing this.
     
    llJIMBOBll likes this.
  4. BHS

    BHS

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

    I'm waiting from the reply of the developer of UCC so I can do an integration tutorial. I will be making the UFPS integration tutorial video today. I will also be updating the Integration Tutorial Docs to include all of the new script name changes as well as the new namespaces for those who can't wait for the tutorial videos.
     
    uberwiggett likes this.
  5. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi these are my settings, and root motion is selected under movement type cheers :D

    https://i.gyazo.com/3d15215f58d247ca5411a0b276e9382f.gif


    https://i.gyazo.com/bdf36392de3ed373688ba4da2d1730ea.gif
     
  6. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS Do you have a link to the melee FPS system that you are using. I have UFPS 1.7 but I am looking at adding blocking to it and I am not quite sure how.
     
  7. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Thanks for the images. Everything looks like it should be working.

    Your AI in the previous post looked like it was walking. Was this happening when your AI was trying to attack a target? Also, could you provide a screenshot of your movement blend trees? Have you tried creating a new Animator Controller?


    I use RFPS, but it has been deprecated.
     
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    The UFPS (v1.7.5) Integration tutorial is finished.

     
  9. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268

    Damn it! I would love to get a hold of it. UFPS doesn't have a blocking aspect to the melee portion.
     
  10. Matro

    Matro

    Joined:
    Mar 15, 2013
    Posts:
    38
    What I would like to do is have a group of Ai that follows an Ai leader like children following their mother and when danger comes and the mother defends or runs away the children will hide or run with her.

    So thank you for thinking it might be something you might add in the future.
     
  11. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi @BHS it seems the integration for emeraldaiplayerdamage doesn't support invector 1.2.3 I think injector made some changes and I get errors when I integrate it to 1.2.3. I dont wanna change version of invector as my project is almost finished and all that's left is the ai part which I use emerald ai for it
     
  12. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    The first two images show what it looked like before the latest Emerald AI. The first image shows the same drop down list as before only there's much more options and when you choose "void Damage (int, TargetType)" it gives you the options you see in the next image. Damage amount and who dealt it. Great.

    The third image shows what the closest method might be, in the latest Emerald AI, and there's no options like before. As if Playmaker is interpreting it in such a way that we have to type in the code, but Playmaker doesn't allow it. Previously the options just popped in there. As if you were specifying the requirement of an "int" and a "TargetType" and now that part is just ().

    So what ever you were doing before was perfect...
     

    Attached Files:

  13. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I forgot to mention that I was using UCC from Opsive. I saw your post about waiting for a reply. There is a thread on Opsive forum about integrating Emerald AI with UCC. But I did turn on the debugging options and there are parts of the player that is blocking the AI from firing. I even tried changing the Player Offset Y Position the ranged AI will still not shoot.

    https://opsive.com/forum/index.php?threads/emerald-ai-integration.127/page-2#post-4421
     
    Last edited: Mar 8, 2019
  14. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    Thank you...now leave.
     
    micuccio likes this.
  15. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    I am about to start creating my ranged enemies this weekend. Are you still having issues? If you are, I will see if I get the same ones, and if I can find any work-arounds.

    Mark
     
  16. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    Yea, I'm still having issues. I'm using Opsive UCC and I'm getting obstruction issues. So that's why the ranged AI is not doing anything. I'm currently using this guide to integrate Emerald AI with UCC.

    https://opsive.com/forum/index.php?threads/emerald-ai-integration.127/page-2#post-4421
     

    Attached Files:

  17. Nynex96

    Nynex96

    Joined:
    Sep 15, 2014
    Posts:
    2
    Has anyone ran into the error
    NullReferenceException: Object reference not set to an instance of an object
    EmeraldAI.EmeraldAIBehaviors.CheckAnimationStates () (at Assets/Emerald AI/Scripts/Components/EmeraldAIBehaviors.cs:288)
    EmeraldAI.EmeraldAISystem.Update () (at Assets/Emerald AI/Scripts/System/EmeraldAISystem.cs:917)


    I receive this error when trying to instantiate an Emerald AI Agent into my scene.
    I can unpause the scene and everything, including the AI's act normally. I just don't understand why this prefab creates this error when it spawns. Does anyone know whats going on here? If I have the AI in the scene before it starts it operates just fine.
     
  18. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I just deleted 2.0 and installed 2.2 in my project. However its having problems, in a fresh project it works as expected but in my game project it does not. Example of some issues:
    - AI vs AI scene they dont attack each other
    - Players companion doesnt follow me
    - destination example they walk straight past enemy
    etc also the healthbar and names arent showing above characters.

    Any ideas? I checked tags and layers they seem to be the same as fresh project

    edit: im following ufps tutorial and changing the tags/layers and now it seems ok on the whole.
     
    Last edited: Mar 10, 2019
  19. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Im getting a lot of problems with people not attacking me, they often just stand there idling. Unless I run into them they dont attack me.
     
  20. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    A few observations regarding 2.2:
    1) Sometimes, apparently randomly, when idling, the character will move as if walking, but play the correct idle animation. It's not one particular animation, I have 3 idles. The character sometimes just floats along while idling. Root motion is off, and it doesn't always occur. Puzzling...

    2) The walk animation with the WalkFootstepSound event doesn't play the footstep sound. Run works, but not walk. To get around this, I have simply added RunFootstepSound events to my walk animations.

    3) After setting up for UFPS, both AI and player gives and takes damage. It plays fine, but may have issues in a build, as the console shows:
    Failed to call function Damage of class EmeraldAISystem Calling function Damage with 1 parameter but the function requires 4.
    UnityEngine.Component:SendMessage()
    vp_Bullet:TryDamage() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Bullet.cs:263)
    vp_Bullet:DoHit() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Bullet.cs:183)
    vp_Bullet:TryHit() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Bullet.cs:157)
    <TryHitOnEndOfFrame>d__31:MoveNext() (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_Bullet.cs:340)


    4) When the AI who has a melee attack only, launches an attack and the player moves away, the Damage event is called, even though the player is out of range. He still receives damage. Looks odd. I could compensate for this I guess by speeding up the animation. Is there another way around this?

    I am about to start testing the behavior types (passive-brave, cautious-foolhardy, etc.) in detail. They don't seem to produce the expected results listed in the table. Might have something to do with the Tag Options - AI Attacks Player drop down. So far, the "Only If Attacked" option fails to make the Cautious-Brave AI attack when I shoot him, but it needs more testing in all 9 modes. Correct me if I'm using that option incorrectly.

    Mark
     
  21. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    So it sounds like a lot of issues with Emerald right now? I haven't had a chance to try yet.
     
  22. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Yeah im sort of regretting deleting all my emerald 2.0 hard work, which worked perfectly, now im left with mostly unimpressive AI and I have no idea why :-( If you are close to release just stick with 2.0
     
  23. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS any chance you can look into these issues?
     
  24. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    I still have a backup of the old one just incase this happened
     
  25. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Actually I just set up a new character and it seems to work better again, its almost as if some models don't work right (I used root motion on this one, but not others). But has anyone else had issues with sound? they aren't playing.

    edit: I also noticed the ui settings seem to have a bug, so you cant change position or scale.
     
    Last edited: Mar 10, 2019
    SickaGames1 likes this.
  26. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @SickaGamer & @radiantboy
    Slow down now folks. The sky is not falling, it just got a little lower, that's all. Don't forget I am playing with the BETA settings duplicator too. That's why there is a lot of "seems" and "appears" in my statements. If there is a lot of problems, @BHS will surely sort them out. The errors will have to be proven in a clean install without beta product installed, or confirmed by at least one other user.

    Mark
     
    radiantboy and SickaGames1 like this.
  27. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Also does anyone know how to make the AI attack you directly, he always goes out of view and attacks from the side, same used to happen with emerald 2.0, cheers.
     
  28. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    Lol they run away again?
     
  29. Revelation_Jeff

    Revelation_Jeff

    Joined:
    Jul 17, 2012
    Posts:
    141
    @BHS Where's that ootii integration ;)
     
  30. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    So I'm using Playmaker and Core GameKit to spawn an AI and I'm getting this error. The AI is spawning and it's working. I'm just trying to figure out how to clear the error.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. EmeraldAI.EmeraldAIBehaviors.CheckAnimationStates () (at Assets/Emerald AI/Scripts/Components/EmeraldAIBehaviors.cs:288)
    3. EmeraldAI.EmeraldAISystem.Update () (at Assets/Emerald AI/Scripts/System/EmeraldAISystem.cs:917)
    4.  
     

    Attached Files:

  31. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Yes, this would fall into the herd feature that I plan on adding with a feature update.


    I'll take a look at this today and find out what's happening.


    I have PlayMaker so I will try to figure out a solution for you. My guess is that adding a new function, that has similar parameters will fix the problem. If this is the case, I will add a special function for PlayMaker users.


    It sounds like the player is being obstructed by the player's leg colliders. Try changing them to a different layer and including that layer in the AI's Ignore Layer list. I have reached out to the developers of UCC and I am still waiting for a reply (it's been 5 days now). So, until they get back to me with a copy, I can't do much in terms of integration or support. I will gladly add a video tutorial and support when they do.


    It looks like you may be missing an animation somewhere or something that's happening on Start. Included is a spanwning AI example and that works fine with no errors. How exactly are you spawning your AI?


    Yes, if you are doing a complete project import, sometimes the lags and layers are replaced. This meas you will need to update an AI's tags and layers because the original ones may no longer be present.


    If you are using UFPS, did you uncheck Has Collision Trigger and add the Local Player layer to your AI? These are both essential for your AI to detect your UFPS player.


    1) Can you please send me a PM of your issue so I can try to figure out what's happening? I tested about 50 models during development and didn't encounter this issue. I'm curious as to what's happening.

    2) This is happening because the WalkFootsteoSounds isn't calculating the speed for non-root motion. I have an update planned to address this and the other issues that are happening.

    3) Did you follow the tutorial exactly as what was done in the video? Are you using the tag Emerald AI for your AI?

    4) I think this may be something related to UFPS. I'll take a look at it and address it.


    Yes, I have an update planned specifically to address the mentioned issues. I will submit the update as soon as possible. I just have to pinpoint what's causing them. :)


    They AI should be attacking your players forward position. If possible, can you please send a video of this happening?


    Changing the AI's UI is done from within the editor. I just checked this and everything is scaling and positioning according to what's in the editor.


    I'll try to get a video tutorial up tomorrow.


    Is your AI missing any animations?
     
  32. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    Any idea when Crux 2.0 will be done?
     
  33. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    I just double checked my scripts and they appear to be correct.

    FYI, it happens when the player shoots the AI. The error seems to point to vp_Bullet.cs at line 263.
    Line 263 of vp_Bullet is in red below: (EDIT except it isn't in red because it is in code! It is: ]m_Hit.collider.SendMessage(DamageMethodName, Damage, SendMessageOptions.DontRequireReceiver); )

    Code (CSharp):
    1.     /// <summary>
    2.     /// attempts to do damage using a regular Unity-message, and / or more advanced
    3.     /// UFPS format damage (whichever is supported by the bullet and target)
    4.     /// </summary>
    5.     protected virtual void TryDamage()
    6.     {
    7.  
    8.         // send primitive damage as UnityMessage. this allows support for many third party
    9.         // systems (simply use a 'void Damage(float)' method in target MonoBehaviours)
    10.         if ((DamageMode == vp_DamageInfo.DamageMode.UnityMessage)
    11.             || (DamageMode == vp_DamageInfo.DamageMode.Both))
    12.         {
    13.             [COLOR=#ff0000]m_Hit.collider.SendMessage(DamageMethodName, Damage, SendMessageOptions.DontRequireReceiver);[/COLOR]
    14. #if UNITY_EDITOR
    15.             if (!m_DidWarnAboutBothMethodName
    16.                 && (DamageMethodName == "Damage")
    17.                 && (vp_DamageHandler.GetDamageHandlerOfCollider(m_Hit.collider) != null))
    18.             {
    19.                 Debug.LogWarning("Warning (" + this + ") Target object has a vp_DamageHandler. When damaging it with DamageMode: 'UnityMessage' or 'Both', you probably want to change 'DamageMethodName' to something other than 'Damage', or too much damage might be applied.");
    20.                 m_DidWarnAboutBothMethodName = true;
    21.             }
    22. #endif
    23.         }
    24.  
    25.         // send damage in UFPS format. this allows different damage types, and tracking damage source
    26.         if ((DamageMode == vp_DamageInfo.DamageMode.DamageHandler)
    27.             || (DamageMode == vp_DamageInfo.DamageMode.Both))
    28.         {
    29.             m_TargetDHandler = vp_DamageHandler.GetDamageHandlerOfCollider(m_Hit.collider);
    30.             if (m_TargetDHandler != null)
    31.                 DoUFPSDamage();
    32.         }
    33.  
    34.     }
    Mark
     
  34. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
     
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I'm currently working on it, but I don't have an ETA. It shouldn't be too long though.


    I think you may be editing the wrong script. The script that needs to be edited is the vp_FXBullet script not the vp_Bullet script. If you have edited the correct script, and you are still receiving this error, it may be project related as everything is working correctly on my end. Are you using the 1.7.5 version of UFPS?


    @dinaloraven234

    I'm not sure what your question/response was. :)
     
  36. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141

    Sorry for that mistake what I wanted to say is I think the one that causes the error when I'm integrating emerald ai to invector 1.2.3 is the melee manager. Invector made some code changes in the script that's why I'm getting errors. Can you help me integrate it to 1.2.3 because my project is almost done and I might get some errors when I update invector to 1.2.3 or some other problems that may arise
     
  37. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS What is the priority list? IE when is 2.3 coming out :) and you said you maybe have an addon for flying creatures? What is going on with that! Thanks for all of your hard work!
     
  38. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    No, I made the edits to the vp_FXBullet script, and the damage is working, but the error that I see appears to point to the vp_Bullet script. Yes, UFPS 1.75. I will work on it.

    Mark
     
  39. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    @BHS you said "If you are using UFPS, did you uncheck Has Collision Trigger and add the Local Player layer to your AI? These are both essential for your AI to detect your UFPS player."

    Ive never heard of "has collison trigger" can you let me know where it is ? and as for your second point you just mean add the layer "player" to my AI detection options?

    Also not sure about others but UI options definitely wont let me change them here.
     
    Last edited: Mar 13, 2019
  40. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I also still cant figure out why they dont make any sounds. And projectiles arent being spawned by my ranged attack guys. Any ideas anyone?

    edit: projectiles I see you need an animation event, so will work on that now :)
     
    Last edited: Mar 13, 2019
  41. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    236
    I have checked the Animations and everything is filled. I also deleted and created a new animation. Still the same error.
     
  42. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    Anyone having issues should use Bandicam and take video of what is going on. It is easier for @BHS to troubleshoot if he can see what is happening as well as your setup.....
     
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    I'll checkout the update and see what was changed. I can update the tutorial if needed.


    Thanks!

    Right now, my focus is getting the tutorial and documentation finished with Emerald AI 2.2, releasing a quick update for Emerald AI to address a few issues, getting Crux 2.0 released, and getting UniStorm 4.0 (with volumetric clouds) released. After that, I will begin Emerald AI 2.3. Crux 2.0 and UniStorm 4.0 will add support for weather, time, and seasonal spawning.


    Interesting, I can't seem to recreate your issue and I started a fresh project and went through the tutorial. What version of Unity are you using and did you say this was during a build or while in the Unity editor?


    It's in the UFPS integration tutorial video here:



    I can't recreate the issue and I have tested spawning AI. Did you use the Setup Manager to create your AI?
     
    SickaGames1 likes this.
  44. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    RFPS integration tutorial is up
     
    Weblox and erichey like this.
  45. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    @BHS Flying creature addon? :)
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Oops, forgot that. :)

    I'm not sure, but most likely either before or after Emerald AI 2.3. I'm not sure how long it will take to develop because it will be a completely different asset that will have integrated support for Emerald AI. I do already have a decent working concept though. I would like to do a poll here to see who is interested in the flying asset to ensure it's viable. If a decent amount of users are interested, I think I'll release it on the Asset Store, but as a different asset that supports Emerald AI. It is far too different to simply be an addon for Emerald AI.
     
    SickaGames1 likes this.
  47. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,268
    Sounds great! Flying Dragon Bosses would be awesome! Come on people! Show your support for this!!! Malbers dragons integration would be awesome!
     
  48. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Juhuu, thank you for RFPS Integration (and video). :)
     
  49. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    In 2.2 is there an option to spawn prefabs upon death of an AI?
     
  50. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    In the editor. I mentioned that it works but may be a problem in build as it reports as an error, not a warning. I will create yet another clean project once I finish duplicating all of my AI's.

    Duplicator is working quite nicely. Only suggestion hat I have is once it has finished duplicating, clear the values from the "Emerald AI Duplicator Data object in scene. If I run it once, all is perfect. If I run it again on the next set, it seems to hold the old values and fails on the first run (gives the standard can't modify prefabs directly warning and doesn't create the prefabs from blue to white), but run it again without changing anything, and it works just fine.

    Mark