Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Tactical Shooter AI - Asset Store Pack

Discussion in 'Works In Progress - Archive' started by squared55, Mar 2, 2015.

  1. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Hooray! Glad the issue was resolved! I have a bit of a break in my schedule, so I'll see about getting started on another video.

    Yeah, I'm not sure why the default ones worked either. Maybe it's because I manually assigned the layermasks or something in the code.

    Anything else you still need answers for? :)
     
  2. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    I tried to change SendMessage to SendMessageUpwards in bullet script. didn`t helped me . Is there 100% way to make bullets do the damage to player withought upgrading to 1.5.1 and redoing all UFPS stuff again?
     
  3. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    This is an awesome tutorial!
     
    arnesso and squared55 like this.
  4. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Hi man.
    Sory for what happened in the past)
    Hope you not angry wit6h me no more)
    I`ve been impolite and childish.
    I guess i owe you apology.
    Cheers!
     
    squared55 likes this.
  5. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    You said the explosions worked, right? What happens when you set the bullet's hit effect prefab to an explosion? Just decrease the size so it doesn't hit multiple people and it *should* work. Also, make sure the BULLET's layermasks (not the Controller!) are set up such that they include the layer than your player is on (which may change at runtime, so watch out for that).

    I'll try sending the UFPS dev a message, see if he has any ideas.
     
  6. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    So I have a really basic question, what is the property for changing the targeting distance for primary weapons? I checked the docs but I only found the secondary weapons property.
     
  7. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    i
     
  8. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    did all you said here.
    Honorable 99thmonkey knows best about UFPS, but ithink he`s still angry with me to give any advice.
     
  9. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    I`ll sure do that!
     
  10. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Don`t mean to be to gready but (here`s stupid question) - how it is possible to make m203 grenades explode upon collision with other gameobjects?
     
  11. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    GunScript>Misc. Params>Min/Max Dist To Fire Gun.
    Note that this only started making an appearance in more recent versions, so you may have to upgrade.

    If you're using the standard bullets to move the grenade, slap a rigidbody onto the bullet and make it's hit and miss effects are the explosion. If a regular grenade, unfortunately, there isn't any way out of the box to make it detonate on impact. I suppose you could modify the OnCollisionEnter method to immediately call "Detonate();" alongside "Warn();" Make sure to add the curly brackets. "{}" to the if statement. Possibly add a boolean toggling this so that you can still use the same script for standard grenades.
     
  12. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Thanks. I definitely have to upgrade.
     
  13. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Just started dev'n again and I noticed this weird issue... the AI looks down right after they kill an enemy so it makes them not kill any other enemies even if they right in front of them?

    http://postimg.org/image/lkgeeacxb/
    http://postimg.org/image/43zkorhab/

    Also when I dmg an enemy is there a way for them to know where I am or start reacting in any way? If they dont see me even though Im killing their friendlies and shooting all around em they dont respond unless Im "lucky" enough to be in their LOS and when I'm slightly above the enemy, they have no idea I'm right there (image below shows this) I've attached the Create Sound Script and put the script in my bullet, and still no success :'(
    http://postimg.org/image/8v3rz6a83/
     
    Last edited: Apr 1, 2016
  14. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818

    That's a new one. Does the issue happen with a new, empty scene, and all agents?

    They should notice you no matter what as long as you have LoS to them when they take damage. Have you made any changes to the bullets? Where is the target on your player located? Is it possible that it's being blocked by a collider? BTW, the CreateSoundScript in the current version is glitched- I forgot to call StartCoroutine on the IEnumerator. Either do that or make the CreateSound method line the only thing in the Start or Awake function and it should work fine. There is a working version a page back if you are lazy. :)
     
  15. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Is that a fact?
     
  16. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Had bin killing them with your script attached to bullet and they went on withought changing their behaviour a bit.
    But as soon as i get in to Theyr line of site they start attacking me. That is so far the only way to alert them that i bare witnessed working myself.
    Tried to make ambush on them but they ignored me killing them one by one (didn`t rush for cover after first shot fired just marched on)
     
  17. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Yes, the agents from the pack look down (in the debug mode) but they still aim and shoot new targets


    I use the rifle bullet provided in your pack, no changes were made there.

    I applied the TargetScript on the root object of the UFPS player (I can be shot at / take dmg once they see me)

    UPDATE: I applied another TargetScript to the head mesh, seems like they see that now?? Just curious how or what the functionality is on their visibility... where should the target script be, which mesh?
     
  18. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Indeed. Want to see for yourself? Open the UFPS demo on the asset store page, turn around and run through the basement to sneak up on one of the agents and shoot them in the back. The shot agent will instantly turn and fire on you.

    The variables must be properly configured for your game. Sounds also do nothing if they are already engaged in combat. You probably also need to crank up the sound radius.

    Sounds like the arm colliders or something were blocking the line of sight. Ensure that the layer the agents is on is NOT party of the controller's layermask.
     
    Last edited: Apr 4, 2016
  19. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    @RangePlusOne Have you solved the issue with your bullet damage?

    Also, just a heads up, I'll be extremely busy for the next few weeks, so response times will probably be slower. After that though, I'm very close to putting out an update that will support dodge/roll animations. :)
     
    animatedtako likes this.
  20. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Can you add to next uptate injured state for AI or slow death (so he could crawl, scream and move some small
    time before respawning).Given the body can stay renderable for specified time i guess one could put audio clips
    in damaged and death fields.What would be the best way for mesh to do one of few animation clips before ragdoling
    to his rest? should agent stay enabled after health is at zero. or activate death animation when his health reaches low
    numbers?
    Would it be hard for you to make Agent, and what would be the hardest aspect for this topic?

    I made 10 spawners with agent prefabs in respective fields for each spawner point.
    Only 1 of them spawns agents though spawner point is prefab it self.
    Any ideas hot to make all of them spawn agents?
    Thanks!
     
  21. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Sound script that would be responsible for animation clips instead or along sounds is big advantage for ai visual enrichment. Guess this is peace of cake for you, or is it?
     
  22. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    The next update is planned to be a small one and pretty much only be the dodging. Of course, everything with respect to future releases is tentative and completely subject to change.

    I will take it into consideration for some future update. If I did decide to implement it, it would really depend on if I can get the injured animations and aiming to work well. Aiming while standing up and crouching is one thing, aiming while on your back and supporting yourself with an arm or a wall is quite another. It'd be very easy to make it look awful.

    Am I correct in assuming you want it to look like Call of Duty's last stand mechanic?

    You would need to make a custom behavior for that at the current time. You would have to dynamically assign it when you detect the agent is low on health. Don't do it when they reach zero though, because that causes the game to delete everything related to the AI itself leaving just the ragdoll.

    You would also have to manually open up and modify the animation controllers to support your animations because mecanim, for some reason, doesn't support playing an arbitrary animation via code, AFAIK.

    Randomly choose a spawn point from an array, like you tried to do with the agents a page or two back.

    Some animations that would be triggered by game events are on the to-do list (namely flinch/taking damage/death animations) and hopefully will make it into some future update.
     
    Last edited: Apr 7, 2016
  23. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Agents walking in place is first thing that kills the look of the game.
    Anything you plan to adress that?
    They also stuck in whatever current state and can not exit it.
    Some of them can turn and start slowly walking away in the middle of the firefight.
    Issue that need to be adressed asap imho.
     
  24. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Turn off dodging for now. This glitch is why I'm focusing on just the dodging. :)
     
  25. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Submitted a version to the asset store that should fix this glitch. It technically includes dodging animation support, but it's pretty rough and you'll have to manually modify the animation controllers. Full version will follow with updated wizards, but I want to get this glitch fix out ASAP.
     
  26. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    Waiting for RFPS support, still no? :(
     
  27. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Not yet, no. When my schedule clears up, I'll look into it.
     
    QuadMan likes this.
  28. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    That would be siiiiiick!

    Yep, it's all good to go - as far as I can tell :D Looking forward to when you're back!

    Here's what I've been able to create using your asset and UFPS :D


    I do have a request for the next update, the ability to disable npcs colliders on death. I find myself stumbling over their bodies xD or is there a way to do this already?
     
    Last edited: Apr 9, 2016
  29. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    So, if anyone's wondering what me TODO list currently looks like, it's this:

    1) Fix up the dodging

    2) Add RFPS support

    3) Overhaul the way the way the behaviours transition to a more traditional state machine. What this means for you is that each behavior would have a set of events (say, OnSeeEnemy, or OnHearSound, or OnTakeDamage). You would then be able to specify exactly what behavior the agent will use when those occur. For example, you could have an agent who would charge the enemy, but take cover when they take damage. Or you could have an agent who would run back to a given point when they spot an enemy. And so on and so forth.

    4) Add support for hit/flinch/damage animations. Possibly custom death animations.

    5) More polished cover animations.

    6) Parkour. This is pretty limited by the animations I have, but right now I think I can add vaulting over chest-high walls and jumping over gaps. I also want to add climbing up/down stuff and eventually wall jumping/running, but I don't have the animations for those yet.

    7) A "last stand" mechanic.

    8) Team strategies. This is pretty vague right now, but what I'm envisioning is that you would specify a target location, and then flanking routes along with some key locations. The agents would then dynamically form a squad and attack in more a coordinated manner.

    As usual, this is very much subject to change, but that's where I'm at right now. :)


    That looks awesome, man!

    It's not in there already, but what you could do is make a script that utilized the OnAIDeath method. What you'd do is store both the colliders and the rigidbodies in separate array. Then you'd use a loop to iterate through them, and for each collider you'd disable it and for each rigidbody, you'd set the Kinematic value to be true.

    Alternatively, you might be able to just modify your project's physics settings so that the layer the player is on doesn't interact with the AI's. Or you could increase the step height of your Character Controller.
     
    animatedtako likes this.
  30. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    Are you considering any other tie-ins with other Unity assets? There's a lot of things about there with potential, I imagine.
     
  31. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    I'm open to suggestions, but I make no promises. :)
     
    Alexarah and hopeful like this.
  32. canaljuegos32

    canaljuegos32

    Joined:
    Jun 29, 2015
    Posts:
    63
    Is the sound detection removed from the AI?
     
  33. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    No, why? (Keep in mind you must use the TSAI sound method calls.)
     
  34. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Thanks! I just realized, is there any option to give the soldier footstep sounds? :-O just realized how quite it was without the ambiance.

    Also I've recently noticed the AI won't play Death Audio? Here's an img of test audio clips I made myself to see how it works, everything else seems to work pretty good - any suggestions? I'm not sure why there's an "Odds To Play ______" and a slider? Can you provide insight? Thanks man!
     
    Last edited: Apr 10, 2016
  35. Alexarah

    Alexarah

    Joined:
    May 1, 2014
    Posts:
    110
    Hi does anyone know where the api of Tactical Shooter AI is? I would like to have a better reference than what's in the Doc Manual that comes with it.
     
  36. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Odds to play is the odds that the sound will play when the event is triggered. So you don't have the agents shouting "RELOADING!" every single time they run out of ammo.

    There is no option for footstep sounds in TSAI at the moment. The death sounds not playing seems like a glitch, probably caused by the AI destroying itself instantly on death. I'll look into fixing it.

    Unfortunately, the docs and the code are all I've got at the moment. Sorry.
     
  37. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Could you programm pawner so that multiple spawpoints could spawn agents and not just one of them end up working.
    I failed few times doing that.
    Thanks.
     
  38. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Could you please post what code you've got so far so I can work off of it? :)
     
    Last edited: Apr 12, 2016
  39. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    129
    hi
    when I\m running Demomap2 or Demomap this ERROR appears


    ArgumentException: Input Button Fire1 is not setup.
    To change the input settings use: Edit -> Project Settings -> Input
    ParagonAI.MoveCameraScript.Update () (at Assets/Paragon Shooter AI/Paragon AI/Csharp/Helper Scripts/MoveCameraScript.cs:51)

    when I add Fire1 ti inputs it become disappear and continue giving me the error!
     
  40. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    You can just delete the MoveCameraScript, it's only there for the asset store demos.
     
  41. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Try this:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. public class SpawnPoint : MonoBehaviour {
    4.     public GameObject[] prefabs;
    5.     public Transform[] spawnPoints;
    6.     void Spawn () {
    7.         RaycastHit hit;
    8.         Vector3 spawnPos = transform.position;
    9.         if (Physics.Raycast(transform.position, -Vector3.up, out hit))
    10.         {
    11.             spawnPos = hit.point;
    12.         }
    13.         Instantiate(prefabs[Random.Range(0, prefabs.Length-1)], spawnPoints[Random.Range(0, spawnPoints.Length-1)].position, transform.rotation);
    14.     }
    15. }
     
    arnesso likes this.
  42. arnesso

    arnesso

    Joined:
    Mar 3, 2015
    Posts:
    96
    Hi ,
    probably this will sound weird for first time, well, I am working on Sci-FI FPS game ,so I would ask about the flying enemy, as agent . how could I solve this with this asset. I think about flying, levitating droid , which behaves as "agents" ( not a fixed hegiht) Thank you :)
    Cheers !
     
    hopeful likes this.
  43. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    I don't think there really is any really significant changes. Just make the spinebonetorotate the gun or drone itself and make a custom animation controller with flying animations for your drone, and it should work just fine.
     
  44. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    Here is attempt tto make tank Agent:

    Any ideas about mechanized unit`s 3d software setup, TSAI tweaks would be most wellcomed.
    Thanks!
     
  45. sonnolo

    sonnolo

    Joined:
    Feb 22, 2015
    Posts:
    26
    No script for enemy drop item same old shooter ai?
     
  46. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Not in the default package, no. You can make one using the OnAIDeath() method, however. I sent you an example in response to the PM.
     
  47. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    squared55
    Have you tried to make agent other than humanoid?
    I`m getting error on tanks i`ve set up:
    Video is above.
    Any ideas?
     
  48. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Thanks for the video! I haven't actually tried to make a tank personally, so the amount of useful input I have will be pretty limited. I'm not entirely sure why the turret flipped upside down, but I think it's an issue with the maximum angles on the rotation script. Try cranking up the angles to 360, although you might want to limit the amount they can turn up or down. I would also make the tanks use the skirmish behaviour, so you don't get that head to head clashing.

    I also noticed you're getting warnings at the end, and the console spam will certainly kill performance. You should make a full TSAI animation controller for the tank, and just fill up every slot with an idle animation.

    In the meantime, I'll look into proper vehicles. Whether I'll focus on flying vehicles or tanks first, I'm not sure yet. I'm also not sure how long their development will take.
     
  49. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    There`s surely mistakes made on multiple levels) but at least that`s a start, pretty crippled one though.
     
  50. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    That helped with hash thing! I`ll tweak tanks in blender and reimport them.
    Cheers!