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

Shooter AI – The Ultimate Artificial Intelligence Solution

Discussion in 'Assets and Asset Store' started by nikita68, Oct 8, 2013.

  1. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    do you have a estimated date for the new shooter ai
     
  2. thendricks

    thendricks

    Joined:
    Aug 14, 2012
    Posts:
    48
    This is my AI's setup. All AI's are clones other than the weapons
     

    Attached Files:

  3. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    @dustinwloring1988 + Everybody! - Expect a large announcement very soon! Its got some bad and some good news.

    @thendricks - Is this AI vs AI? Or AI vs Player? We've noticed that you need to change some settings for some player character controllers to work.

    Thanks!
    Nikita
     
  4. thendricks

    thendricks

    Joined:
    Aug 14, 2012
    Posts:
    48
    Mostly AI versus player but there's sometimes friendly bots, happens all the time
     
  5. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    @thendricks - hmm, sometimes we noticed theres a prefab problem. Are the bots prefabs?
     
  6. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    when are you going to say large announcement?
     
  7. thendricks

    thendricks

    Joined:
    Aug 14, 2012
    Posts:
    48
    Yes, They're spawning in via spawn points
     
  8. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    @thedreamer - I hope either this week, or next. We're just finalizing some legal details, and then we'll be able to announce.

    @thendricks - Try drag-and-dropping them in the scene, then breaking the prefab instance. We've heard of reports that this actually solves the problem.
     
  9. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    Can you please help me i have a bug i did the character creation and is how my guy holds his gun

    <iframe width="560" height="315" src="https://www.youtube.com/embed/Xmm5KHPKXOQ" frameborder="0" allowfullscreen></iframe>
     
  10. thendricks

    thendricks

    Joined:
    Aug 14, 2012
    Posts:
    48
    Is there any other way round it, my game relies heavily on AI's that are spawned in, if need be I'm fine with editing the code
     
  11. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I have attempted to import your asset into my project for the first time. (I have never used it.) And I am getting a naming conflict since you are using the global namespace. Specifically you are clashing with another MouseLook.cs script. Is it possible for you to move your asset into its own namespace? (I am asking the other asset developer to also move out of the global namespace as this is not a good practice for third-party assets for just this reason.).

    Thank you.
     
  12. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    Hi
    I'm from Iran and unfortunately I can't buy assets !
    is there any free version?
     
  13. animatedtako

    animatedtako

    Joined:
    Jan 10, 2013
    Posts:
    7
    I ran into the same issue with a character I created in 3DS MAX. This character might have been made in the same program. Unfortunately, the axis on the bones is not correct for Unity. the IK system in shooter ai is attempting to rotate those bones forward, so that he leans over. But since MAX uses a different coordinate system, the model leans to the right. The only way to fix this would be to rewrite part of the code, or re-rig the model. I just re-rigged my model with bones I custom made to play nice with unity. You could also just turn off the IK blend during engagement and use an animation with Unity's built in IK instead.

    Hope that helps!
     
  14. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
  15. IrishDev

    IrishDev

    Joined:
    Jul 18, 2012
    Posts:
    50
    Hi All,

    I am using the Shooter Ai with the UFPS asset and have some issues that I am hoping someone can help me with:

    1) How do you disable the knock down on the zombie prefab?
    I just want the player to have to shoot them once and for them to stay down.

    2) How can you prevent the AI from "seeing/hearing" the player through walls?
    Basically I have a closed door with an Ai zombie behind it but they keep walking through it.

    Thanks
     
  16. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    #1 uncheck know down on the health script for the body
     
  17. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    #2 modifi the code and use a raycast to see if there is anything between the ai and u
     
  18. muhammadadilumar

    muhammadadilumar

    Joined:
    Jun 22, 2015
    Posts:
    11
    Guys i need your help, i'm using shooter AI with my TPS Template (from unity assets store) all thing is just going perfect but when the AI see's my player and start attacking the player wont die and if the player attacks the AI, the AI wont die, in simple words i don't know how to manage or change the health system:(, seriously need your help guys if you do help me i shall be very very thankful to you:)
     
  19. thendricks

    thendricks

    Joined:
    Aug 14, 2012
    Posts:
    48
    Does anyone know how to stop the AI from running to 0,0,0!!! I've asked this several times and no one's given a solution. I don't mind editing code.
     
  20. jkdey

    jkdey

    Joined:
    Dec 19, 2013
    Posts:
    5
    hello, is it possible to get the AI to shoot at a specific location? I'm interested in getting a suppressive fire mechanic working.
     
  21. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I am having a basic issue. I watched the video and then created a new scene, added the Hero from UFPS and the Solder from SAI. I set up the damage model so they work together.

    The problem I am having is that the enemy of the soldier switches to team2 when the game is run, despite me setting it to player.

    Here is a screencapture showing this -- https://www.dropbox.com/s/44f3glfta3ui6t2/SolderEnemyResetting.MP4?dl=0
     
  22. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I am also seeing another issue. In the video is shows how to change the damage that the weapon/ammo does by modifying the UFPS Hero. When I do that, it doesn't work. I set it to 0.3, but when the Soldier is hit, 0.5 points of damage is done. This is consistent with the setting Hit Area Default for the health manager on the solder AI.

    So is this a bug? How do I get SAI to recognize the damage value set in UFPS?

     
  23. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    What is the purpose of "Tag Of Bullet" on the "Gateway Games Brain" Script? I am assuming that if I want to interact with UFPS, that I will need to set this tag on all of the ammo for all of the weapons?

     
  24. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I run a scene that only has a SAI Solder and a UFPS Hero. After they fight and I stop the scene, there are timer objects left in the hierarchy. What are they doing there? Is there a leak? Shouldn't these be destroyed when the game is stopped?

     
  25. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    1)timers are from UFPS look at the forums for the fix.
    2)tag of bullet is explained on this forum somewhere you have to add some code to UFPS hit scan i think
    3) you dont want to set the SAI tag to player on UFPS should be use team1 and team2 for SAI
     
  26. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    1)OK
    2)OK
    3)I am talking about "Tag of Enemy" not the tag of the soldier. This is what is done in the video. It just doesn't stay.
     
  27. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    oh i cant recreate that try reimporting the package as it workes fine on mine
     
  28. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    @dustinwloring1988 I searched and I cannot find the info on "Tag of Bullet" and modifying UFPS hit scan. I will keep looking, but if you've got a link, that would really help.
     
  29. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    Is there a limit to how many times an AI will follow the Patrol Manager path? I ask, because twice now I have left my computer running in play mode while I have gone off to do something, and when I return the AI is just sitting at one waypoint -- not moving any more.
     
  30. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I reimported the Shooter AI asset and the problem still occurs. Namely, I set the Tag of Enemy to Player and it switches to Team2 at runtime, and remains Team2 when the game is stopped and I check the Inspector.
     
  31. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    found this on page 20

    Add this code to the UFPS firing logic:

    Code (CSharp):
    1.  
    2. //apply AI hearing bullet
    3.             Collider[] potentialAI = Physics.OverlapSphere( transform.position, <range of bullet hearing>);
    4.             for(int x = 0; x < potentialAI.Length; x++)
    5.             {
    6.  
    7.                     potentialAI[x].SendMessageUpwards( "BulletFired", transform.position, SendMessageOptions.DontRequireReceiver);
    8.              
    9.             }
    NOTE: transform.position is the position of the bullet where its fired!
     
  32. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    Hey Everybody!

    Sorry for the extremely long reply time! I was away without internet. :(

    @animatedtako - Thank you for the explanation! Thats exactly a problem, and theres no way around it.

    @dustinwloring1988 - Thank you as well for helping out! All your answers were spot on!
    The code you pasted is so that the AI can hear bullets manually.

    @Tinjaw -
    1) Delete the MouseLook script, its just for the demos.
    2) Tag of Bullet can be left out if using standard UFPS. It can add realsim if you set the impact prefab's tags to the bullet tag, but you can also use the code Dustin pasted.
    3) There should be no limit to the amount of times it should go around. Did you run in the editor? That sometimes causes errors over longer periods of time.

    Thank you very much!
    Nikita
     
  33. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    Yes, This was in the editor. I did not try in a game.

    I'll give this some thought. I don't know which solution I prefer. Each has their benefits and drawbacks.

    Thanks for the help.

    What about the "Tag of Enemy" Changing when I run the game? Is that being done intentionally by some initialization code, or maybe I am doing something wrong?
     
  34. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    @Tinjaw -

    1) Try building and running the executable. The problem shouldn't be there.

    2) I think the code option is a better option, as it then affects every bullet, and requires no other setup.

    3) Tag Of Enemy defines which group of objects the AI designates as enemies. You can change this in runtime, though don't do this too often, or the AI won't concentrate on one enemy. This is never changed by the code in SAI, only in editor by you or by some other script. If it changes, it may also be a prefab error, try breaking the prefab instance then.

    Thanks!
    Nikita
     
  35. IrishDev

    IrishDev

    Joined:
    Jul 18, 2012
    Posts:
    50
    @dustinwloring1988
    Thanks for your help.

    I finally figured out what was going on.

    Yes I had to change the "Knock Down Area" on the HealthBody child of the HealthManager object on the ZombiePrefab. The problem was that none of the children on the prefab appear in the Inspector when the object is selected from the Project tab.

    The HealthBody child appears under the HealthManger when the ZombiePrefab is viewed from the Hierarchy tab.

    To address my issue I altered the ZombiePrefab in the Hierarchy tab and then created a new ZombiePrefab that I could use with the GenericSpawnManager script.
     
  36. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    @nikita68 I am sorry to report that the problem exists in the build executable as well. I can send you the scene and the exe if you wish.
     
  37. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    @IrishDev - Prefabbing really is a problem with Unity and SAI.

    @Tinjaw - Yep, please send me via PM an executable/scene.

    Thanks!
    Nikita
     
  38. IrishDev

    IrishDev

    Joined:
    Jul 18, 2012
    Posts:
    50
    @Tinjaw : I encountered the same issue with the Soldier prefab.

    If the prefab is dragged into the scene, the "Tag Of Enemy" parameter is updated to Player and the game started, the parameter re-sets to Team2. The Ai ignores the player.

    This was worked around in the same way I sorted out the ZombiePrefab.

    1) Drag the Soldier prefab on to the scene
    2) Open the Enemy Data Tag Of Enemy" parameter to "Player"
    3) Drag the updated prefab into a new Prefab folder.

    This new Soldier prefab should work if spawned in or if it is dragged into the scene.
     
  39. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    @IrishDev & @Tinjaw - Unity has some bugs in Prefab Breaking. You can also achieve this effect by selecting the prefab then going "Edit" -> "Break Prefab Instance".

    Thanks!
    Nikita
     
  40. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
  41. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    @Tinjaw- Sorry! Must have overlooked that one. Did you setup your UFPS character as shown in the video:


    If nothing still works, commment out in GatewayGamesDamageRegion.cs lines 61 - 70.

    Thanks!
    Nikita
     
  42. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    @nikita68
    I did follow the video and the damage done is what is set in SAI, not in UFPS. I commented out those lines and no damage at all was done. Looking at the code comments, I am wondering if you have UFPS and RPFS reversed, as I think UFPS calls Damage and not ApplyDamage. Furthermore, it looks like UFPS is calling Damage() and not Damage(float).
     
  43. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    Is there any free version?

    I'm From Iran and I can't buy assets. due to some political limits....
     
  44. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    @Tinjaw - That seems to be the case. Try commenting out the Damage() method, so only the Damage(float) method is left. This should force SAI to use the provided data.

    @rbm123 - Sent you a PM :)
     
  45. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    That didn't work. No damage was done with Damage() commented out.

    What seems to work is...
    /// <summary>
    /// Applies the damage. Used by UFPS.
    /// </summary>
    /// <param name="damageInfo">DamageInfo.</param>
    public void Damage(vp_DamageInfo damageInfo)
    {
    //apply damage
    healthManager.ApplyDamageToAI( damageInfo.Damage, deathArea, knockDownArea, knockDownTime);
    }
     
    Last edited: Aug 8, 2015
  46. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I am seeing some odd behavior if I shoot the AI while it is in the process of getting up from a knockdown. The AI goes crazy. I have screen capture here.
     
  47. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    Hi
    I use Realistic FPS (because it's better than UFPS)
    How can I match these packs together to use FPS character from rfps and enemies from Shooter AI ?
    I added soldier and zombie to the scene and add my player to enemy AI . but only zombie can detect me - the soldier just run in a circle! also when I shot the soldier it has no effect!
    I read the manual but there was nothing about this things -
    I have to watch tutorials?
     
    Last edited: Aug 10, 2015
  48. nikita68

    nikita68

    Joined:
    Feb 8, 2013
    Posts:
    289
    @Tinjaw -
    1) Nice work! I'll look into why its not using the default way of conducting damage...
    2) That looks like something goes wrong with the ragdoll, though i thought we had fixed this bug with 2.2.3. Are you using the latest version?

    @rbm123 - Yep, heres the tutorial:


    Thanks!
    Nikita
     
  49. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I believe that I have imported v 2.2.3. How can I confirm that?
     
  50. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I have added terrain to my scene and added a SAI soldier. The soldier doesn't clamp to the terrain. How do I get the AI character to follow the terrain height?

    See http://screencast.com/t/V8c9cu6K