Search Unity

[Released] Advanced AI Pro - AAA AI Solution -

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

  1. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hi Zozo - I'd like to detect if the AI (Enemy) has come in contact with a wall or object by a tag name so I can play animation, where abouts would I add this?
     
    Last edited: Mar 10, 2015
  2. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    This is easy, you add this piece of code any where in the Enemy script:

    Code (CSharp):
    1.  private void OnCollisionEnter(Collision collision)
    2.     {
    3.         if (collision.transform.tag == "you tag name")
    4.         {
    5.            bot.GetComponent<Animation>().CrossFade("animation name", 0.1f, PlayMode.StopAll);
    6.         }
    7.     }
     
  3. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    great thanks. I was trying to add it somewhere else, but it didn't work as expected.
     
  4. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    Thanks a lot.
    I haven't yet been able to test it so far because I need to bake navigation mesh again but before that I have to update my shaders which is a long and painful process (especially without internet :eek:). Thanks for confirming, I'll be in peace at least for that side :D
     
  5. Mikeedee

    Mikeedee

    Joined:
    Jan 5, 2015
    Posts:
    42
    This sounds perfect for my company project but there is one major issue.
    Unity's Navmesh can't be baked at runtime so we can't use it.
    Would you consider adding support for A* pathfinding project for example?
    Since it's free everyone can use it and I've seen it bundled with other AI packages so from a legal standpoint, you could do it.
    If not, can you provide some pointers on what we would need to change/add ?
    Cheers !
     
  6. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    Hi, i need help with something. In my scene i have the soldier prefab that works. It can kill both the player and the zombies. But the zombie can kill the player but only chase the soldier and not do damage to it. It just keep running after the soldier when the zombie notice him. Player can also kill the soldier. Any idea what im Doing wrong?
     
  7. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    Im wondering if this can have something to do with scaleing ? It would be best to scale the zombie/soldier before i Add the enemy ai script true the gameobject menu? Because if i scale the enemies after the ai script is added, either true the model that is a child of the parentobject , or from the top parent object this can affect something ? Cause im using the soldier from this package, but i have changed the scale from 1 too 4.
     
  8. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    hi sry for the trouble, anyway i figured out what i did wrong.
    My capsule colliders where to big, when i decreased the colliders both on the soldier and the zombie everyone can attack everyone
     
  9. hatez

    hatez

    Joined:
    Mar 24, 2015
    Posts:
    2
    Hello, pls make a new video tutorial, i think the actual tutorial is very outdated. Because i have a little problem: i placed a dummy, add Advanced AI component, set up waypoints, attached the FPS Player to the target variable, but, the dummy cant wandering or reaching the waypoints (i setup the animations). In the documentation not very clear the layer options..can u explain these? Thank for your reply. :)
     
  10. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi

    Did you get any errors in the console?
    Did you assigned your player's layer in the "Main Target" layer of your AI?

    Also tag your player as "Player" (tag only the main gameobject holding the collider of your player)

    If you are using "UFPS" then you need to read the guide for it.

    Waiting for your answer

    Cheers
     
  11. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello

    Update 6.9 is now available.

    Changelog 6.9
    • Fixed an issue with Defender AI keeps playing the following animation in idle state.
    • Fixed an issue with melee attack sending damage to target while the latter is beyond the arrival distance of the AI.
    • Added Min and Max values of the melee "Attack Interval" for more randomized behavior.
    Cheers
     
    Last edited: Apr 2, 2015
    julianr likes this.
  12. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    I updated the Pdf documentation, added how to use the "Shadow Zone" prefab, this can be useful in stealth games when the player hides in shadowy unlit areas, so it can not be detected by the AI.

    You find the "Shadow Zone" in the "Prefabs" folder of the "Advanced AI Pro", add it your scene, and adjust its size in the inspector as you want it to be, done.

    Cheers
     
  13. Ryan199gamer

    Ryan199gamer

    Joined:
    Oct 29, 2014
    Posts:
    4
    How do i get it to work with UFPS 1.5.0 they changed the "vp_hitscanBullet" script. The enemy damages me but I cant damage them.

    Code (CSharp):
    1.  
    2.             // do damage on the target
    3.             if(m_Source != null)
    4.                 hit.collider.SendMessageUpwards(DamageMethodName, new vp_DamageInfo(Damage, m_Source, vp_DamageInfo.DamageType.Bullet), SendMessageOptions.DontRequireReceiver);
    5.             else
    6.                 hit.collider.SendMessageUpwards(DamageMethodName, Damage, SendMessageOptions.DontRequireReceiver);
    7.  
    8.             // prevent adding decals to objects based on layer
    9.             if ((m_Renderer != null) && NoDecalOnTheseLayers.Length > 0)
    10.             {
    11.                 foreach (int layer in NoDecalOnTheseLayers)
    12.                 {
    13.  
    14.                     if (hit.transform.gameObject.layer != layer)
    15.                         continue;
    16.                     m_Renderer.enabled = false;
    17.                     TryDestroy();
    18.                     return;
    19.  
    20.                 }
    21.             }
    22.  
    The block of code from 163 till 183
     
  14. JesterMaster

    JesterMaster

    Joined:
    Oct 29, 2014
    Posts:
    34
    Hi

    How can you make Ai to jump up?

    I have navmesh jump enabled. My enemyes are only jumping down, but when player is higher ground they don't want to jump up. This make the player very easy job to kill all the zombies. :( Just jumping on top of the car and all the zombies are easy kills.

    UPDATE: Hi no worries I figured it out :)

    But is there any chance that you could optimize the code little bit so it would run more smoothly on mobile?
     
    Last edited: Apr 6, 2015
  15. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    I’ve set up a Defender AI called A, and its main target layer is another Defender AI called B. Object B’s main target layer is the game’s player character, called C. In other words, object C is the player, object B follows the player, and object A follows object B.

    When I execute a SendMessage(“FollowTarget”, true) to object A, it starts following object C instead of object B. Is this a bug, or am I misunderstanding the behaviour?
     
  16. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello

    You need to assign object B transform into the "Target" slot of Object A (you find it in General Parameters), otherwise Defender Ally will always follow the gameobject tagged as "Player" by default.

    Hope that helps

    Cheers
     
  17. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Fantastic, many thanks Zozo, it's all working correctly now.
     
  18. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    You are welcome. Any other issue please post it here.

    Cheers
     
  19. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    I've run into another issue. In one scene I have a large group of enemies in a confined space using ranged weapons. Unfortunately, the enemies at the back are accidentally killing some of the enemies at the front while firing at the player character.

    It’s actually quite funny to watch, but is there any way to eliminate this friendly fire?
     
  20. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    @Zozo2099 can you fix this error please:

    Assets/Advanced AI/Showcase/Scripts/StepsHandlerExample.cs(5,13): error CS0246: The type or namespace name `CharacterMotor' could not be found. Are you missing a using directive or an assembly reference?

    It is not hard to fix myself, but would be great to be fixed in AdvancedAI. Every time i install a new patch from U5 i get this error. Standart Assets are all imported from my side.

    Thank You.
     
  21. ermanozcan

    ermanozcan

    Joined:
    Nov 17, 2013
    Posts:
    5
    Hi
    is your pack mobile optimized , can it work with 2 processor 1 gb ram android device ?
     
  22. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Yes the scripts are well optimized and already been used for mobile projects.

    Cheers
     
  23. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Zozo, any thoughts about this? Is this normal behaviour? I've modified the Advanced AI Pro source quite heavily, so I'm not sure if this occurs in a fresh implementation.

    Ideally, I'd like to eliminate friendly fire completely, so the enemies couldn't kill each other.
     
  24. tahir-ul-nasir

    tahir-ul-nasir

    Joined:
    Nov 23, 2013
    Posts:
    4
    hi .everyone in this package as i reduced the navigation ranges of Enemy results in odd behaviors of Enemy
     
  25. tahir-ul-nasir

    tahir-ul-nasir

    Joined:
    Nov 23, 2013
    Posts:
    4
    if want to Eliminate Chase mode of Enemy i Could not..........:(
     
  26. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Zozo, could you explain the purpose of “Message AI on Death” please? I can’t find it in the manual. If I enter “EnemyHasDied” in that field, will it execute a method called “EnemyHasDied()” if the AI dies?
     
  27. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hi

    Yes exactly, this is a method (function) to call on your Enemy AI gameobject when it dies.

    Cheers
     
    daisySa likes this.
  28. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Hello, getting an error here with the Easy Weapons and AdvancedAI packages:

    Assets/Easy Weapons/Scripts/Projectile.cs(24,14): error CS0101: The namespace `global::' already contains a definition for `Projectile'.

    There seems to be a projectile script in both packages. What can i do?
     
  29. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Are you using ranged attack for your AI? If not then you can safely delete the Projectile script from Advanced AI folder. You find it in the "Scripts" folder.
     
  30. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Yes i am using ranged attack. But i have changed it to use a namespace and it works now.
    Thank You.
     
  31. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    For naming convention, I really liked how this plugin came up with and not only I have never had any naming conflict, but also it was so easy to find the script for the job it does. I am surprised how you let Projectile script slip like that Zozo :D
     
  32. AGaming

    AGaming

    Joined:
    Dec 26, 2013
    Posts:
    103
    Good afternoon, I consider this AI to purchase. But I have some questions:

    1) Whether the packet was optimized for mobile devices, I know that earlier, it was very heavy, especially when two enemies stood nearby, and one told another that attack it.
    2) Problems with cycling of playing of sounds are corrected?
    3) Problems with search of a way to the purpose are corrected?
    4) If you in the latest version nevertheless optimized for mobile devices what at the same time can be put quantity of AI at the level?
     
  33. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello

    Thank you for your interest in Advanced AI Pro.

    I fixed all reported sound effects and navigation related issues in the last updates, so now everything works as intended. Also I heavily optimized the code to run at better performance for all platforms, by example in the "Epic Battle" demo scene, there are more than 30 AIs attacking each others with 50-60 FPS using a laptop, so for mobile you could have several AIs at the same time without any problem, I have some clients working on mobile projects and they are satisfied in general!

    Anyway if you find any issues after purchasing then you should consider posting here and I will fix it as soon as possible as I did before for other customers, thanks to all of my customers for their issues reporting, I was able to improve my product and to make it highly optimized.

    Hope I helped

    Cheers
     
  34. AGaming

    AGaming

    Joined:
    Dec 26, 2013
    Posts:
    103
    Well, I just bought it for $ 62.50, and will look. Hope in case of problems, you will support. And that last comment in the Asset Store, I was a little rastroilas.
     
  35. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Thank you and looking forward for your feedback.
     
  36. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Is there a playable demo so you can see the AI behaves?
     
  37. AGaming

    AGaming

    Joined:
    Dec 26, 2013
    Posts:
    103
    I have a couple of questions to you:

    1. How to implement automatic turn?

    2. Why did the bullet flies are always in a straight line when the player slightly rising to the top?



    3. Why, if a player moves forward, the bullet ricochets off him, without causing any damage?

     
  38. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello

    Nice project you have BTW :)

    1- I did not understand what you mean by automatic turn!!

    2- Projectiles are normally oriented towards the target even if it is higher or lower than the AI, go to the example scene included "Ranged Attack" and then get higher on the platform, you will see that the AI will shoot you from below and you can get hit.

    3- Sorry but I can not reproduce your issue.

    What type of projectile prefab are you using? If it has a sphere collider then try to increase its radius a little bit it might help so it collides easier with the player.
     
  39. AGaming

    AGaming

    Joined:
    Dec 26, 2013
    Posts:
    103
    1. I want to implement, machine gun fire, where the attack shots go one by one. (AK-74)

    2. Yes in the demo stage everything works fine, but as soon as I put to UFPS Mobile prefab, AI cease fire if the player is higher than the AI bot.
     
  40. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    1- Yes, set the "Projectile Delay" to "0.1" in "Ranged Attack" tab, and assign a continues AK-74 sound effect to "Ranged Attack Sfx" in "Sounds" tab, so you will get your desired effect.

    2- Try to increase the radius of the collider component in the projectile prefab used by the AI, so hopefully it will get a better chance to hit the player from above.

    Cheers
     
  41. AGaming

    AGaming

    Joined:
    Dec 26, 2013
    Posts:
    103
    1. Thanks, that helped.

    2. The bullet is still flying at a right angle, and if a player is a little on the higher elevations, bots can not inflict damage.
     
  42. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello

    Here I uploaded two webplayer demos of the "Epic Battle" and "Soldier AI" just to demonstrate to you how it works, download the zip file via mega then extract it, and open the html file to play:

    https://mega.co.nz/#!t8NBCYbK!bDBDWmpE3rPzRtJAgXEzU0tDizN2Hsnm1vfbilU16eo

    If you have any questions please feel free to ask.

    Cheers
     
    Zaddo67 likes this.
  43. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello

    Update 7.0a is now online.

    Changelog 7.0a:
    • Fixed issue with Waypoint patrolling throwing an error when AI does not have a "Got Hit" animation clip.
    • Fixed issue with AI Enemy not causing damage to AI Defender when melee attacking.
    • Renamed "Main Target" in AI Defender to "Target To Defend".
    • Added "Soldier AI" scene to Showcase scenes.
    • Updated the Pdf documentation.
    Cheers
     
  44. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi,

    the price of this asset is quite high in comparism to other assets, so i would like to know a bit more about this asset.

    - Do you have a well written, well commented (just the complicated parts of code, i don't mean every line or methods) code?
    - Is it simple to extend your asset? (Im pro in coding, i mean ,if i want to extend somewhat in your code, it shouldn't be depends on 1000 parts in your code)
    - I have the UFPS asset, can you link a demo or video, how it works in UFPS? Can you please also link a demo or video for Realistic FPS Prefab. The demo in Realistic FPS Prefab looks amazing, much more better than the UFPS one, so im not sure that i will go with UFPS. In the Realistic FPS Prefab are so much more things... (e.g. Jump in water, move under water...)
    - Which one would you prefer for your asset, the Realistic FPS Prefab or UFPS?
     
  45. Zozo2099

    Zozo2099

    Joined:
    Jul 15, 2012
    Posts:
    478
    Hello

    Thank you for interest in Advanced AI pro

    1- The code is not commented, but it is not difficult to understand and modify. Anyway you can always contact me if you want to modify parts and/ or add new methods as I already did that before with other customers and helped them.

    2- Advanced AI Pro works well with both UFPS and Realistic FPS Prefab so I would say no particular differences, there are setup guides for both and it should be fully compatible.

    Cheers
     
    Last edited: May 18, 2015
  46. Ryan199gamer

    Ryan199gamer

    Joined:
    Oct 29, 2014
    Posts:
    4
    @Zozo2099 Please Help
     
  47. AGaming

    AGaming

    Joined:
    Dec 26, 2013
    Posts:
    103


    An asset is not difficult to apply to UFPS, but you should know. That the asset does not quite fit the shooter. It is more suitable for the use of AI zombies.
     
  48. AGaming

    AGaming

    Joined:
    Dec 26, 2013
    Posts:
    103



    It's just awful, just go to my pc i5. In a typical scene. I was tired for a month to deal with problems. Namely

    - Character animation is not transferred to the Chasing the animation Idle.
    - The character can not attack a target standing above the AI, the bullets fly just nowhere.
    - From time to time during a patrol walk animation does not play the character moves to the position idle.
    - Aggressive NPC released immediately and 40 bullets per shot.

    I can enumerate a lot of mistakes and omissions. But I think I've had enough. This is a wonderful asset, but not finalized. Either this is a problem with UFPS Mobile ...
     
  49. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Thanks for this demo.
     
  50. Stupido1

    Stupido1

    Joined:
    Jun 5, 2015
    Posts:
    2
    how i can change the layers in asset "advanced AI pro" :Enemy Layer,Main target n View obstruction? thanks
     

    Attached Files: