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

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
    Well, I'm going need more information about your particular set-up because attaching it to the main camera works perfectly fine for me. The controller's layermask should have no effect on what they can or can't hit- only what they will shoot at. You also need to apply a Health Script holder for the target script no matter what. Screenshots of all your inspectors at runtime would be ideal, as well as those of your bullets and controller.
     
    Last edited: Nov 15, 2015
  2. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Thanks.

    1) Doesnt sound so easy to me! I dont see any instructions on how to instance these from code, and I imagine copying the vals over every single object would be a nightmare. To be honest I cant think of many games that wont want to be able to turn on and off people. Every time you turn a corner people will want to trigger the creation of new enemies etc, so I think this should be made very simple.. in my opinion :) Just being able to turn them on from a script would be good (if there was an example) its a shame in unity you cant access gameobjects that were off when the game started, this would work great, well from my understanding anyway.

    2) actually no im only disabling the parent object that holds my AI agents, I noticed at run time it creates the ragdoll guys, and no I am *not* turning them off, I will try to do so, in my script also and let you know if it work. Edit: since ragdools arent created until run time this makes it even harder because im trying to use an adventure creator trigger to do this, but this stuff needs to be set up before run time, requiring custom scripting etc and a way to get the names etc. So I cant actually think of a way to do this.

    I`ll keep thinking.

    Edit: Unless I can make a prefab from my guys? then write some unity code to instantiate them ? Will try :)

    EDIT: Yes it works, super simple, you were right, I made a script that can receive messages from a trigger, added it to a gameobject and sent the message when I hit the trigger. The message simply instantiates a prefab, and it all works well, thanks!!

    GameObject thug1 = (GameObject) Instantiate(Resources.Load("RSL_ParagonStoneGuy1"));
     
    Last edited: Nov 16, 2015
    squared55 likes this.
  3. PicturesInDark

    PicturesInDark

    Joined:
    Jun 13, 2013
    Posts:
    89
    Solved! I have created an emptyobject below the camera. The camera in UFPS have a collider in default layer. I have removed default layer from bullet layers for bullets go trhough and I have removed default layer from paragon controller to agents see though.
    Thank you
     
    squared55 likes this.
  4. greatnate62

    greatnate62

    Joined:
    Feb 20, 2014
    Posts:
    2
    Hello. I would first like to say I am in love with this asset. I would like to know if it works with realistic fps prefab and how I could change things to get it done. I'm not a huge fan of ufps and would greatly like to use paragon with my current project. I'm hoping it's a few code changes as I'm an absolute beginner with coding. Many thanks and keep up the good work!
     
  5. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    It should be pretty easy. The only thing standing in your way will be the health/damage system, but if RFPS uses a Damage(float) method, it may require no changes at all. However, I can't say for sure as I don't own RFPS. :)
     
  6. greatnate62

    greatnate62

    Joined:
    Feb 20, 2014
    Posts:
    2
    Hello. thanks for the quick reply. From what i know about the old Shooter AI, the only difference was instead of "Damage(float)", RFPS uses "ApplyDamage(float)" for the health and damage system. i would assume all i would have to do is change that around but im not sure exactly what script its in or really how to do it. im not good at scripting at all and i wanted to ask you before fiddling around in the scripts
     
  7. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    I imagine that the easiest way would just be to do a Find/Replace for ApplyDamage/Damage
     
  8. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    258
    hello it's great to ufps ! but I can not seem to me to be integrated with unitz help me ?
     
  9. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Unfortunately, I can't give any exact advice as I don't own UnitZ and cant find any documentation. However, as long as it takes/sends a Damage(float) method, it should work- although I can't speak for any of the blocky pre-made models.
     
  10. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    258
    everything continues as usual I will kill AI players but AI players will not give me dmg
     
  11. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Well, again, I can't really give you any solid instructions but swapping out the agent's Paragon AI bullets for UnitZ bullets should work.
     
  12. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    69
    I'm loving this !
    I'm just having one massive issue: my team is working on an open world-ish game, and if I enable dynamic cover, the game freezes for maybe half a second, every 3-5 seconds or worse if I enable more agents, making it basically unplayable.
    Tweaking values around didn't yield any changes, other than disabling dynamic cover altogether, which I need.
    I noticed that if I delete some terrain tiles and rebake the nav mesh to make the game world 1/4 of the size, the problem goes away, so I suppose that's what's causing the issue. It's however obviously unpractical for us as the game world is going to be far bigger than it is right now.

    The full terrain I first tested it on was 4000x4000, with only one tile (which worked) it was 1000x1000.
     
  13. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    The performance of the dynamic cover is directly related to the number of vertices in your navmesh, so yes a smaller world will help. I'll look into adding a cheaper dynamic cover for the next version, but obviously manually placed cover will be the cheapest. I think that would be your best bet, no matter what.
     
  14. animatedtako

    animatedtako

    Joined:
    Jan 10, 2013
    Posts:
    7
    Hello. Love the asset so far!

    One weird behavior I'm getting though... once the AI characters die, their ragdolls leap into the air whenever the camera looks at them after they have been off screen for some time. They will behave correctly when they first die, but after I look away and look back it's as if they are instantiated in the air. Any idea how to fix this?

    Thanks.
     
  15. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    The animator component on the ragdoll has a setting labeled "Culling Mode". Change it to "Always Animate".
     
  16. animatedtako

    animatedtako

    Joined:
    Jan 10, 2013
    Posts:
    7
    That did it, thanks!
     
  17. Nizraan

    Nizraan

    Joined:
    Apr 1, 2014
    Posts:
    6
     
  18. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Heh, Eteeski's shooter tutorials are how I learned to use Unity. Anyways, it should work pretty easily. I imagine all you'll have to do is attach a target script to your main camera, and make your player's gun use Paragon AI bullet prefabs and the AI use Eteeski enemy bullet prefabs.
     
  19. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Only problem with this approach is that the game jerks when you instance more than say 3, so it actually may not be a viable solution ;-/

    EDIT: Ahh actually i traced the jerk to a bug in adventure creator where the actionlistmanager tries to reload some resources when I send the message to turn on the paragon guys, so was not actually related. All I had to do was turn off the debug feature in adventure creator which shows what actionlists are running and it is now smooth. I also loaded the paragon prefabs in awake, then instanced them and set active to false, and then made them active when I needed them, and this actually worked fine this time. Which means I think its all great :D
     
    Last edited: Nov 22, 2015
  20. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    What should rigidBodyToAddForceTo be on knock overable objects?
     
  21. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Uhh... the rigidbody that you want add force to? :)
     
  22. Morphius68

    Morphius68

    Joined:
    Apr 5, 2014
    Posts:
    20
    Just started playing with this today and so far, very impressed but I'm having mixed results trying to add my own character - particularly The MCS System by morph3d. Has anyone else got this to work successfully and if so, how?!?

    I'm following the instruction as per the docs supplied but my completed AI characters fall through the floor to their waist and do not animate - they do still track and shoot me though!!! Any ideas?
     
  23. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    Hi, all going fairly well. Some of my characters made from prefabs do not run, whilst some do? Any ideas?

    How can I make the patrol loop please?

    Does Paragon support UFPS respawner?

    Thanks
     
  24. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Double check to make sure that you correctly set up both the agent and the animation controller.

    It should automatically return to the first patrol node after reaching the last one by taking the shortest path.

    I don't know for sure, as I've never tried it.
     
    Last edited: Nov 23, 2015
  25. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Move up your agent's ragdoll in the editor relative to the parent gameObject (the one with all the Paragon AI scripts attached). Also, make sure that your animations are set to loop in the import settings.
     
    Last edited: Nov 23, 2015
  26. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I think I have a request. ;-)

    As far as I can tell, when an AI Agent is killed, it just sits there "forever". Am I correct?

    If so, then I think I want to have something added to the Health Script. A delay (in milliseconds) and a method for when the agent dies. So, in X amount of milliseconds the method is called, so we can do things like destroy the object after a certain amount of time, etc.

    Does that make sense? Maybe there is already something in place that I am not aware of.

    UPDATE:
    Just stumbled across OnAIDeath(). I guess I just attach a script with that method. I'll give that a try.

    UPDATE 2:
    Yep. That's it. Nevermind. ;-)
     
    Last edited: Nov 26, 2015
    hopeful likes this.
  27. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    Hi, I'm trying to spawn the AI Soldier Prefabs via Instantiate but it doesn't seem to work as expected. I see no character models after calling Instantiate. Is their a correct way to spawn on the fly? Thanks.
     
  28. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    247
    Strangely my issue is when I instantiate a prefab already active in the scene when I press play. If I deactivate the active object my instantiate call will work as expected, otherwise the character body will be way off point of origin when instantiated.
     
  29. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Hi,
    I'm creating a zombie agent but I have a little problem with the cover nodes (I suppose that the problem is caused by them). The behaviour of the zombie must be going towards to the player and he move like I want with the "Berseker" option enabled. I put the zombie in the scene in front of my UFPS Advanced Player so he walk easely in a straight line (if I put the zombie behind the corner he works like a normal agent).

    The PROBLEM is this:
    1)when the zombie walk forward, I can see in the Scene View of Unity some straight lines (green or red) from the zombie to the closest cover node;
    2)those lines appear and disappear in less than a second;
    3)when a green line appear the zombie literally slides towards the closest cover node creating a weird walking path (example: he walk forwards and he slides to his right, in less than a second without rotating);
    4)if the line is red the zombie, he stops for a moment and then start to walk again.

    What I already tried:
    1)Disabling the cover nodes;
    2)Re-creating the navmesh with baking;
    3)Changing the AI Type
    4)Changing all the numeric variable in the scripts attached to the agent.

    What I found is that he can't use the cover nodes using Tactical/Search like a normal agent.

    Final words:
    I have created the zombie like described in the guide, so he has a new model, a new animator controller, new animations, a target script onto the UFPS player so the zombie can recognize the enemy and so on.
     
  30. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    When the agent spawns, the ragdoll detaches from it's parent object. If it's not instantiated from a prefab- then you'll probably have to make sure that the ragdoll resets it's position relative to the gameObject with all the scripts attached.

    Although, spawning from a prefab should work perfectly fine.
     
    Last edited: Nov 27, 2015
  31. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Would you mind posting a video and/or screenshots? Although, I'm not sure what behaviour you want. Do you want the zombie to take cover or not?
     
  32. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Hi squared55,
    I DON'T want to use the cover system. The zombie must move towards the player.

    Now, when the green line appear the zombie slides:

    the zombie slides in the video here:
    LINK-->https://dl.dropboxusercontent.com/u/43591352/zombie slides.zip

    when the red line appear the zombie stops for a moment:

    the zombie stops in the video here:
    LINK-->https://dl.dropboxusercontent.com/u/43591352/zombie stops.zip

    if have problem to see the picture you can download them here:
    https://dl.dropboxusercontent.com/u/43591352/problem zombie.zip
     
  33. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Ah, I think I've got it- the zombies are trying to strafe-dodge. Make sure dodging is disabled in the base script and that it's set to Berserker.
     
    hopeful likes this.
  34. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Now it works! Thank you!
     
  35. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Hi,
    I have a problem with the melee damage and the UFPS bullets damage against the zombie.

    1)Melee Damage:
    I have created the agent controller using the additional animations during the controller creation and adding my "attack" animation to melee animation field.

    Now when the zombie touch me, the attack animation starts but my UFPS advanced player don't receive damage.

    I tried to increase the melee range but it doesn't work (of course the "can melee" option is active).

    In the controller the condition "Melee" is visible in the transition between my moving state and attack state.

    I have found no difference for melee attack between my zombie and the paragon agent.

    I know that I don't receive damage because I can see my life value of vp_FPPlayerDamageHandler in the console and because when I receive damage from a bullet the Hud became red.

    I already added the Ufps Advanced Player in the "Health Script Holder" in the zombie Target Script.

    PS: the Paragon AI is updated to the last version.

    How can I activate the damage from the melee animation to the advanced player?

    2)UFPS bullets damage against the zombie:
    I followed the guide and my ufps bullets can damage the Paragon agents (they die when I shoot them)

    But with my zombie the bullets don't work. When I shoot at him he literally rotate behind like he was hit by a block.

    I tried to increase the bullet damage and decrease the zombie health but it doesn't work either.

    What I missing?
     
    Last edited: Nov 29, 2015
  36. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I thought you guys might like a demo of how Paragon works in my game :)


    PS, youtube is still processing check back for better quality in 30 mins :))
     
    Last edited: Nov 29, 2015
    Paul-Swanson and squared55 like this.
  37. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    1: Make sure that your player's targetScript has it's HealthScriptHolder variable set to the gameObject that your player's health script is on.

    2: Double check to make sure you've properly set-up the ragdolls, colliders, and hitboxes.
     
  38. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    I didn't know that I had to create the ragdolls and using the hitbox script! :eek:

    By the way:

    1)my TargetScript on my UFPS Advanced Player is in the child called "FPS Camera" like you wrote in the guide; now the Health Script Holder has the "AdvancedPlayerPrefab" parent that has the VP_FP Player Damage Handler.

    I tried also to change the prefab in the Health Script Holder with the zombie prefab and it doesn't work

    Just for information, your paragon soldier can't kill me with a melee attack (and it's not a problem of increasing melee damage)

    2)after creating the ragdolls with the hitbox script (like in the paragon soldier), when I shoot to my zombie I have some null reference exceptions. (when I click on them in the console the zombie prefab in the hierarchy become yellow). Sometimes my zombie stops because of this null reference errors

    These 2 problems create 3 null reference exceptions like in the next image:


    Help me I beg you!
     
  39. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    1) I think you may have misunderstood me. The Player's HeathScriptHolder has to be the main UFPS object. Like this:



    2) There's probably some missing thing, but the Paragon AI creation wizard should automatically set this up for you. This only needs to be done for the zombie, not the player! I'd highly recommend following the manual from the beginning and remaking your zombie from scratch; it'll be easier than hunting down some obscure bug.
     
  40. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Hi squared55,
    I recreated from scratch tha zombie model and now the hitboxes works when I shoot to him. It was my fault because I didn't create the ragdoll first and then the paragon agent. I don't know why I literally miss that in the guide!
    Now when I shoot to the zombie he die like the soldier. FINALLY!
    Only a question is it possibile to check if the life of the zombie is zero so I can delete the model from the scene?

    Melee Damage:
    I did the same thing you showed me with the picture and now the paragon can kill me with the melee but ONLY if I set the "Melee Range" to 3 or above, I don't know why. (By the way I already did that before you showed me and it didn't worked)
    The problem is that the zombie can't deal melee damage to me.
    When he touch me the "attack" animation doesn't start (I set the melee condition in the transition); only if I manually activate the "Melee trigger" in the Parameters list in the Animator Controller he starts the attack animation, and even in that case he can't damage me.
    Why? If the zombie reach the "melee range" why the attack animation doesn't start and give me damage?
    (player health: 1 / Zombie melee damage: 100)
    With the paragon soldier all that works and with the zombie don't!

    EDIT: I checked the Target Script of the zombie and the Paragon wizard didn't setup correctly. I added the right numbers and now the zombie can damage me! FINALLY!

    QUESTION: the question remain; is it possibile to check if the life of the zombie is zero so I can delete the model from the scene?
     
    Last edited: Nov 30, 2015
    hopeful likes this.
  41. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Hooray! What values weren't changed correctly by the wizard?

    When the zombie dies, it calls OnAIDeath() on every script on the Zombie's base object. You can use that to trigger things when the agent dies. Look at the dismemberment script as a guide.
     
  42. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Hi squared55,
    I did the trick with the OnAIDeath() for deleting the model. Thank you for the tip!

    By the way to answer your question, when I created the paragon agent, the wizard asks me the Team ID of the agent and the Team ID of the enemy. I have set agent Team ID 2 and enemy ID 1, the same of the advanced player that I use.
    Using these variables the zombie didn't recognize me as an enemy.

    I changed them to 1,0,3 like the paragon soldier and it worked.

    QUESTION: sometimes when I move next to the zombie and immediately I change my rotation of 180°, the agent turns but the zombie model doesn't turn so in the end I can see the zombie move towards me but instead of facing me with his face I see his shoulder. It's like he walks backwards. I don't know if I was clear.

    I tried to change some settings in the Animation Speed script but the problem persist.

    How can I solve this?
     
  43. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Have you updated to the latest version of Paragon AI? If that doesn't solve the problem... Screenshot?
     
  44. reddo1987

    reddo1987

    Joined:
    Aug 1, 2014
    Posts:
    35
    Hi squared55,
    sorry for my delay, I've been very busy with my work.

    So, I had already updated the Paragon Shooter AI to the last version when I created the project but I re-imported again the update and now I can't see my zombie rotating in weird position. So the problem is SOLVED. I don't know why.

    Thank you for your support!

    Considering that my project is far from finish, we'll see again with future problems! ;)
     
    squared55 likes this.
  45. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    195
    Hello. This asset looks great.

    Has Anyone managed to make this work with Arons A* Pathfinding Project Pro? Is there any chance the developer will be adding A* integration?
     
  46. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Unfortunately, it won't work with A* out the box- there's a couple things that it relies on the navmesh for (namely determining if it's reached the end of a path). I'm thinking of shunting everything that directly interfaces with the agents into a separate class that you could inherit from, but that hasn't been implimented yet.
     
  47. canaljuegos32

    canaljuegos32

    Joined:
    Jun 29, 2015
    Posts:
    63
    This work with RFPS?.
     
    EvilGremlin likes this.
  48. animatedtako

    animatedtako

    Joined:
    Jan 10, 2013
    Posts:
    7
    Hello again,

    First off, I want to say that I've had a ton of fun implementing my own models and animation. I appreciate that you've kept the mecanim parameters to a minimum and it's been very easy for me to implement additional animation transitions, extra walk speeds and so on.

    For my game, there are three things I'm looking to do that I hope you can help point me in the right direction for.

    1) First, I notice that when using the tall cover nodes, the characters will sometimes oddly slide out to the line of sight transform, and then slide back. This seems to happen in a way that doesn't trigger any of the movement animation, so it looks a little odd. Do you have any tips for fixing this? Do I just need to be more implicit with my mecanim transitions?

    2) I'd like to limit the speed and distance of AI characters walking backwards while engaged in combat. Firstly I'd like to have them walk backwards at a slower speed than forwards or strafing. Secondly, I'd like for them to only walk backwards short distances. So, if the AI chooses to run for cover behind them past my stipulated limit, they would disengage, sprint to the location behind them, then turn and reacquire the target. What would be the best way to accomplish this without mucking up the system too much? Can this be handled entirely with a custom behavior? Thanks!

    3) Finally, I'd like to add some form of hit stun and associated animations when the AI characters are damaged. I've got my own animations and making the transitions is no problem in mecanim. I've looked at the health script and it looks easy enough to add a function in there to call up the animation right when the health is reduced. What I'm looking for is the best method to temporarily halt aiming and movement. Is there a master AI pause function, or would I need to stop and restart these individually? Thanks!
     
  49. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    Hi
    I'm interested in this great AI asset.
    But have a question.
    Are you going to compatible RFPS?
    I hope so next update there will be a RFPS compatible.
    This is really fantastic AI asset in the asset store.
     
  50. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Not out of the box currently, but with minor tweaks to the health/damage system it should work perfectly fine.