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] Advanced AI Pro - AAA AI Solution -

Discussion in 'Assets and Asset Store' started by Zozo2099, Feb 3, 2013.

  1. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi
    How you are spawning the UFPS player? tag it as "Player" and try again.
     
  2. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    If your animations are assigned in the "Animations" section of the AI and it does not work then that means that the "Animation" component of your original character model does not has those animations, so unfold the AI in the hierarchy you will find the character model, assign all the animations in the "Animation" component too. If you don't find an "Animation" component then add it manually.
     
  3. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    UFPS takes over on the layers, so if you've set your player up in the scene as enemy or target (layer) it will strip it out. So in the UFPS startup code you'll need to specify its player gameObject to set the layer on startup to target or enemy.

    gameObject.layer = LayerMask.NameToLayer( "target" );
    or
    gameObject.layer = LayerMask.NameToLayer( "enemy" );

    depending on what you have set the layers up as.

    Edit: run your game in editor mode and look at AdvancedPlayer, see if the layer has been removed, if it has set it to target or enemy on runtime and see if this works. If its does then you know its to do with layers.
     
    Last edited: Jun 23, 2014
  4. Soumikbhat

    Soumikbhat

    Joined:
    Nov 23, 2013
    Posts:
    110
    See this is the enemy character selected.
     

    Attached Files:

  5. Soumikbhat

    Soumikbhat

    Joined:
    Nov 23, 2013
    Posts:
    110
    This is the enemy ai component selected
     

    Attached Files:

  6. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    @Soumikbhat

    First I would suggest that you delete the capsule collider component from the soldier character gameobject and put it in the parent AI gameobject instead, otherwise you will have issues.

    As for animations: - Do you have console errors?
    - Does it play the idle animation?
    - Does the AI attacks the player when the player is withing the ranged distance?

    Also check that character 3d model setup is "Legacy" because sometimes when you import a 3d model into Unity it imports it as "Humanoid" by default so you need to switch it to Legacy manually, select the character 3d model in the Project window and you will find that option in the "Rig" section.
     
  7. TheDevGuy

    TheDevGuy

    Joined:
    Mar 3, 2014
    Posts:
    78
    Im am using another kit, Adventure Creator, that spawns it at the location on startup unless specified otherwise.

    The player is already tagged as Player, required by Adventure creator. My target layer on the enemy is set to AttackPlayer, and the players layer is AttackPlayer also.

    Still, the enemy sits there looping his animation.

    No errors or anything. The layer of the player does not change on startup either.
     
  8. TheDevGuy

    TheDevGuy

    Joined:
    Mar 3, 2014
    Posts:
    78
    Do you know what script that that change is made in? i cannot seem to find it in the av_controller
     
  9. Soumikbhat

    Soumikbhat

    Joined:
    Nov 23, 2013
    Posts:
    110
    Yeah I had set the model's Rig to Legacy Mode.
    Deleted the capsule collider, still no help :(
    The model does not play any animation...It remains in T-pose and keeps moving on the terrain (in the T-pose itself)..It wanders randomly and then chases me when I'm close enough..in the T-pose itself.

    It doesn't play any animations though, so it keeps 'sliding' in the T-pose while wandering and chasing the player...
     
  10. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212

    I'll have a look to see if I can find where I placed it, I know it took me some time to work it out.. but then noticed this thread by Zozo2099 (developer of this pack) where layers are reserved for UFPS.

    Released Advanced AI Pro 4.1 [Supports Unity Free]

    This also works just as good.
     
    Last edited: Jun 24, 2014
  11. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    This is not an issue with Advanced AI Pro, the AI behaves correctly and you haven't any console errors, so the issue is with the model itself I think, did you try to play those animations on your model inside Unity editor using the animation window? Are they playing correctly?

    Otherwise send me your model if you want as unitypackage to make it clear.
     
  12. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @Zozo2099 - I'm having an issue with my AI firing at the players feet and missing the player completely. Any idea on what this can be? Using UFPS with a terrain. Works ok if I add the UFPS player into your demo scenes though.
     
  13. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    Hello Julian,

    I have the same problem from time to time. I found out this is due to a wrongly baked navigation mesh.
    I would re-bake the nav mesh and then check again.
     
  14. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @primus88 - thanks for your reply. I'll give that a go.
     
  15. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    Also, try to have the terrain / nav mesh, somewhere higher than 0. Maybe 15-20. I don't know why, but for me it just solves the annoying issue.
     
    julianr likes this.
  16. Soumikbhat

    Soumikbhat

    Joined:
    Nov 23, 2013
    Posts:
    110
    I am using these models

    Are there any issus like v5.3 not executing properly in unity 4.5 or something?
     
  17. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    thanks. Didn't work though! I can see the UFPS player getting hit as the camera jumps, but no damage.
     
  18. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello everyone,

    Good news, Advanced AI Pro is now on sale, 75$ instead of 125$ for ONE WEEK ONLY. Hurry up :)
     
  19. Andrey_Kiselev

    Andrey_Kiselev

    Joined:
    Jun 25, 2014
    Posts:
    9
    Hello!

    I am impressed with your work. I want to buy your asset. But I have some questions.

    You wrote that Advanced AI Pro is compatible now with Realistic FPS Prefab.

    I can use scripts for the player from Realistic FPS Prefab and scripts for enemies from Advanced AI Pro? It is simple to use their such what they are now. They will "see" each other? Whether the additional coding is required to me?

    I am an artist and designer and with a coding at me everything isn't really good. Therefore this question is extremely important for me.

    Thank You!
     
  20. SkermunkelStudios

    SkermunkelStudios

    Joined:
    Dec 29, 2012
    Posts:
    156
    Hey Zozo, great to hear Advanced AI is on special, have been waiting on this one for quite some time to go on special as it looks really amazing, definitely putting down my purchase tomorrow, as soon as I get back to my PC. Cant wait to try out Advanced AI Pro!
     
  21. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi Andrey

    Yes they work together perfectly, I had written the setup process for those interested, very easy step by step, however you need to add a little line of code which will take only 5 seconds from your time :D don't worry, the setup process guide is here:

    http://forum.unity3d.com/threads/re...upports-unity-free.168870/page-8#post-1606612

    If you can not do it then let me know I can modify this little script for you :)
     
  22. Andrey_Kiselev

    Andrey_Kiselev

    Joined:
    Jun 25, 2014
    Posts:
    9

    Great! Thank You!
     
  23. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hi

    How many have this working with UFPS? I'm sure there are more people having the same issue with the player not taking any damage from AI with ranged weapons (melee is fine!), so from my point of view it is in your best interest to support this sales wise.

    It obviously has a conflict, either that or I'm doing something wrong. Your product uses projectiles, where as UFPS uses raycasts on ranged weapons - how and where can we change this in the code, as the player doesn't take any damage, the AI does. At the moment I can't see it working with UFPS correctly?

    However more importantly a reply would be nice to my posts or private message, as I purchased your product on the grounds that it looked very much supported. :) Ideally I don't want a refund but at least some help in the right direction as I'm spending far too many hours trying to figure it out when you know your product inside and out and have experience of other player/camera based solutions. Also happy to pay for you to work on a fix for this which can help others, so I'm not expecting you to do this for nothing.

    Look forward to your reply. Thanks
     
    Last edited: Jun 27, 2014
  24. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi Julian

    The two packages work perfectly together, no issues at all, however you need to setup few steps before, here is the guide I wrote, already tested by my customers :) nothing difficult:

    http://forum.unity3d.com/threads/re...upports-unity-free.168870/page-8#post-1572604

    Cheers
     
  25. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hi Zozo2099 - I have managed to get it to work using UFPS on your demo scenes that use flat meshes using the forum thread above, but not with a terrain, it always shoots at the floor leaving a decal, and I've used all sorts of nav mesh settings - so I'm at a loss. I'll do some more testing, but if you look back another customer has had the same issue and it shouldn't be hit and miss, or have to tweak it often to get it working if both should work without issues after following your fixes on the thread.
     
  26. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    You mean that the projectile's trajectory is towards the terrain?
    In which layer your terrain is? Put it in the layer which you defined as the "View Obstruction" layer for the AI.
     
  27. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Did some more testing, if I jump at the same time as the AI shoots, I get damage. So I added in a Capsule Collider and it worked I got hit without jumping. It seems that when you change the AdvancedPlayer layer to Target/Enemy it removes the character controller or makes it smaller, if that's what the projectile uses to make a hit?

    Then I tried your solution with the terrain, without the Capsule Collider on the player. Even though its needed, it didn't make any difference to the player getting damage by AI.

    Thanks for your help though, much appreciated as it was driving me mad.
     
    Last edited: Jun 27, 2014
  28. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi

    Nice trick you did :D Yes AI projectiles recognizes the collider attached to the target to hit it.

    When I have some time I will test this scenario using a terrain to see why UFPS changes its character controller dimensions.

    Cheers
     
  29. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Thanks Zozo2099 - One thing though, it only takes 1 shot to get hit and die even though I changed the variable for getting hit to Damage, and reduced the projectile hits down to 0.1, then 0.01 which didn't make a difference. So if you can look at that at some point. In the meantime I'll have to go back to another AI solution, but would prefer to use yours as its more suited to our project.

    Thanks.
     
  30. Andrey_Kiselev

    Andrey_Kiselev

    Joined:
    Jun 25, 2014
    Posts:
    9
    Hello!

    When I import asset to my scene, I receive a mistake:

    "Assets/Advanced AI/Editor/AdvancedAiCompanionInspector.cs(163,19): error CS1502: The best overloaded method match for `UnityEngine.GUILayout.Label(UnityEngine.Texture, params UnityEngine.GUILayoutOption[])' has some invalid arguments".

    What does it mean and how to correct it?
     
  31. Andrey_Kiselev

    Andrey_Kiselev

    Joined:
    Jun 25, 2014
    Posts:
    9
    There is one more error:

    "Assets/Advanced AI/Editor/AdvancedAiCompanionInspector.cs(163,19): error CS1503: Argument `#1' cannot convert `Texture' expression to type `UnityEngine.Texture'"

    How fix it?
     
  32. Soumikbhat

    Soumikbhat

    Joined:
    Nov 23, 2013
    Posts:
    110
    Can we have a mecanim equivalent of this asset? It's a great one, but unfortunately nowadays many mixamo models work only with mecanim animations and not with legacy?
     
  33. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Ji Julian

    I run a test using the included DemoScene3 which comes with UFPS as it has a terrain in it, and I used the dummyAI example for ranged attack, I did not get an issues with the terrain when the AI shoots the player, but you are right the projectile kills the player instantly even if the damage amount is a fraction of 1, so I am investigating this issue now. However melee attack works great without any issues when setting the damage amount to fractions of 1 :)

    I will let you know when I have a fix :)

    Cheers
     
  34. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi Julian

    I fixed the instant death of UFPS player issue with AI projectile, give me your Email I will send you the modified script file, are you using UFPS 1.4.7c the last version?

    Cheers
     
  35. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Great! Thanks. PM on its way to you with email. Yes, using UFPS 1.4.7c
     
  36. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I think the issue with the terrain was due to the collider issue, where it was passing through the player and hitting the terrain. Adding in the Capsule Collider solved this issue.
     
  37. Tanshaydar

    Tanshaydar

    Joined:
    Apr 20, 2011
    Posts:
    33
    Quick questions. I was really looking forward to secondary targets and it is great.
    1) Is enemy also listening to secondary targets?
    2) When enemy sees primary target, will it drop secondary targets?
    3) Enemy always attacks to pivot point, how can I change this to center point?
    4) Secondary Targets don't seem to be receiving SubtractHealth message?
     
    Last edited: Jun 30, 2014
  38. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Please delete the existing "Advanced AI" folder and reimport the package again, don't modify the folder structure! Otherwise it might be related to your project.
     
  39. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    All Mixamo store animations are Legacy compatible, download their store asset, preview the animation which you want in the editor and then purchase it.

    Quote From Mixamo Store description:
    Animations are downloaded in .anim format and are compatible with Unity4.x and 3.x. Motions from Mixamo can be applied to any type of rig including Humanoid, Generic and Legacy rigs depending on what type of rig your buying the animation on!

    https://www.assetstore.unity3d.com/en/#!/content/6444
     
  40. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello

    1- No currently it only listens to main target, however I will think of making it hearing its second target too (maybe for the next update!?).
    2- Enemy attacks second target first when in sight even if main target is in sight too.
    3- I did not understand what you mean by that.
    4-Yes thank you for pointing me to that I will make the damage method name applies to second targets too in the next update at the end of this week.

    Cheers
     
    Last edited: Jun 30, 2014
  41. Tanshaydar

    Tanshaydar

    Joined:
    Apr 20, 2011
    Posts:
    33
    Thank you for your response. Damage method name applying secondary targets was important, because I had to change main target on the fly with an external script, which causes problems with whole AI structure (i.e. more than one object in same main target unique layer).
     
  42. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi everyone;

    I took the soldier character from the "Bootcamp" demo and transformed it into AI in a few minutes only, I created a ragdoll of it using Unity "Create Ragdoll" from the main menu.

    Here is the video, enjoy :)

     
    julianr and Tanshaydar like this.
  43. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    View attachment 95354
    View attachment 95355

    Did ya ever get a chance to improve the vision sphere as I suggested a while back? I'm about to work on my AI again, and need to be able to not be scene on rooftops.

    Thanks for your time Zozo, I really appreciate it.
     
  44. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello everyone;

    Update 5.8 is now available to download.

    Changelog 5.8
    • Added "Min Idle Interval" and "Max Idle Interval" parameters to randomize the idle delay of the AI when wandering or patroling waypoints.
    • Now "Damage Method Name" will apply to second target too.
    • Now AI will always look at its target in ranged attack mode.
    • Fixed issue with "Projectile Fx" particle system not being destroyed.
    • Added "Loop Ranged Animation" option to ranged attack section of the AI, can be useful if you want to loop a short shooting animation clip in ranged attack.
    • Fixed issue with character model naming not being recognized by the AI system causing errors.
    @kurotatsu
    I did not forget that, just have to pass through my ToDo list in order :)

    Cheers
     
    Tanshaydar likes this.
  45. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Nice update Zozo2099!

    Is there any issues with Melee AI attacking then remaining frozen when the player moves out of range? If not, must be my settings!
     
    Last edited: Jul 9, 2014
  46. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi

    Currently I did not notice any issues with the melee attack, so I need more information from you:

    You mean the AI view sphere range or the attack range? It remains frozen after playing one melee attack animation? then what? it chases you again normally?
     
  47. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hi. I think it may be down to my animations. Let me investigate further and I'll get back to you.
     
  48. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    yes, it was our end, re-imported our animations and it was fine. Liking the new release by the way.. Keep up the good work!
     
  49. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi

    Here is a little nice tutorial by Unity on how to make dynamic obstacles which our AI can avoid:



    Also just a little hint, the "Projectile Fx" in the ranged attack section of the AI is like a "muzzle flash" particle effect which plays at the moment of launching a projectile, I will rename it to "Muzzle Flash" in the next update so it could be more clear to understand for everyone :)

    Bye
     
    julianr likes this.
  50. SkermunkelStudios

    SkermunkelStudios

    Joined:
    Dec 29, 2012
    Posts:
    156
    Hi Zozo,

    Just recently bought Advanced AI Pro, and really loving it so far, it is so damn powerful and diverse.

    Just wanted to check, is there anyway of creating flying and underwater enemies while also having normal ground enemies present.

    I know for flying/underwater enemies you can raise the height of the nav mesh but that changes all the enemies heights is there a way to get flying/underwater enemies without changing the height of the nav mesh so that ground enemies can still act normally and be present in the scene.

    Also is there a way to make ground enemies go underneath water and become "underwater" enemies (floating/flying). This can also be very useful for enemies such as gargoyles or demons that prowl on the ground but can also fly.

    I was wondering if a height nav mesh might help in this matter, but I suspect that Advanced AI Pro doesnt support height nav meshes yet.

    Please any help on this matter would be greatly appreciated, thanks in advance for any and all help and advice.