Search Unity

Tactical Shooter AI - Asset Store Pack

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

  1. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Heheh fair enough, is it on the list though, hopefully near the top ;)
     
  2. Fraust

    Fraust

    Joined:
    Jul 2, 2012
    Posts:
    16
    In response to the AI not going to idle... check BaseScript.cs line 380. It comments out the engaging=false;

    My AI seemed to work better if I uncommented that line. Is that a bug or intentionally commented out?
     
  3. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Hi guys, sorry to keep coming back... but I placed sounds in the "Damaged Audio" but I dont hear anything... has anyone else experienced any problems??

    UPDATE: Upon reviewing how I have my enemy health setup... (which is currently .1 so they die with one bullet - the don't emit the sound (cuz they dead!)) I was wondering is there a way to do a "death sound" or is that on the to-do list as well?
     

    Attached Files:

    Last edited: Dec 22, 2015
  4. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    So I finally have some time on my hands. I'll be whipping together a quick update with a bunch of minor fixes/improvements... yes, clamping the firing ranges will be included.
     
    hopeful and RangePlusOne like this.
  5. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Hey that's good to hear, and thanks! Really looking forward to that update!

    I've recently picked up Core GameKit and I've been having this problem...I've setup my AI that works when spawned, but the animation of the torso is off! Any suggestions? The weird thing is the default NPCs work totally fine.. when it spawns it has this error. I've contact the devs of the Core GameKit and they said there's nothing going on their end... any suggestions or tips where to start looking??


    This is the warning that appears.
    "Animator has not been initialized.
    UnityEngine.Animator:SetBool(Int32, Boolean)
    ParagonAI.AnimationScript:SetEngaging() (at Assets/Paragon Shooter AI/Paragon AI/Csharp/AI Behaviour Scripts/AnimationScript.cs:363)
    ParagonAI.BaseScript:StartEngage() (at Assets/Paragon Shooter AI/Paragon AI/Csharp/AI Behaviour Scripts/BaseScript.cs:361)
    ParagonAI.TargetScript:NoticeATarget(Target) (at Assets/Paragon Shooter AI/Paragon AI/Csharp/AI Behaviour Scripts/TargetScript.cs:239)
    ParagonAI.TargetScript:CheckForLOSAwareness(Boolean) (at Assets/Paragon Shooter AI/Paragon AI/Csharp/AI Behaviour Scripts/TargetScript.cs:437)
    ParagonAI.TargetScript:UpdateEnemyAndAllyLists(Target[], Target[]) (at Assets/Paragon Shooter AI/Paragon AI/Csharp/AI Behaviour Scripts/TargetScript.cs:209)
    ParagonAI.ControllerScript:UpdateAllEnemiesEnemyLists() (at Assets/Paragon Shooter AI/Paragon AI/Csharp/AI Behaviour Scripts/ControllerScript.cs:52)
    ParagonAI.ControllerScript:RemoveTargetFromTargetList(Int32) (at Assets/Paragon Shooter AI/Paragon AI/Csharp/AI Behaviour Scripts/ControllerScript.cs:79)
    ParagonAI.TargetScript:RemoveThisTargetFromPLay() (at Assets/Paragon Shooter AI/Paragon AI/Csharp/AI Behaviour Scripts/TargetScript.cs:157)
    ParagonAI.TargetScript:OnDestroy() (at Assets/Paragon Shooter AI/Paragon AI/Csharp/AI Behaviour Scripts/TargetScript.cs:151)"

    Any help would be really appreciated!
     
  6. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    You have a problem with the animator. Start by re-making your animation controllers.
     
  7. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Okay, now I don't mean to be a pain, but I haven't modified any animator controllers at all... could you point me in the right direction on where to start?
     
  8. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Page 3/4/5 of the manual. :)
     
  9. Taorcb

    Taorcb

    Joined:
    Mar 15, 2015
    Posts:
    39
    I realize I'm a bit late, but the ai script sends out an OnAIDeath() callback (technically it's a sendMessage, but it works the same way). I may have misspelled the function name, so you'll have to go find it. It's in the AIBase script. You could use that to play a sound, something like this:

    Code (CSharp):
    1. public AudioClip deathSound;       //Assign in inspector
    2. public AudioSource audioSource; //Get this somehow
    3.  
    4. void OnAIDeath()
    5. {
    6. audioSource.PlayOneShot(deathSound);
    7. //Other death logic here. I use it for primary targets (end level or skip to cutscene when they die) a lot, and to send messages to other AIs so they talk ("Man Down," etc).
    8. }
    9.  
     
    squared55 likes this.
  10. Ilithios

    Ilithios

    Joined:
    Mar 30, 2015
    Posts:
    4
    Hello. Just picked up Paragon AI today. Looks good as far as I can tell, but have a serious problem. Whenever an AI character sees the player, the frame rate drops way way low. So at first, the player is out of view of any AI characters. he can walk around and do stuff, the AI guys walk around aimlessly as they should... frame rate is fine. but as soon as the player walks out the door so the AI guys can see him, the frame rate drops to unplayably low. Forget frames per second, I'm talkin' 1 frame every 2 or 3 seconds. Any idea what's going on here?

    Edit for extra info: I am using it with UFPS, the AI bad guys are just the prefabs included, I haven't made my own yet. Haven't changed anything in the AI character prefabs except to some of them wander, but the same thing happens on search.

    Another edit for more info: This does not happen when the enemies are set to berserker. It also doesn't happen when Dynamic cover is unclicked.

    and here are some errors that keep popping up in the console over and over:
    Invalid AABB result

    Invalid AABB a

    Expanding invalid MinMaxAABB

    Invalid AABB aabb
    UnityEditor.DockArea:OnGUI()

    IsFinite(outDistanceForSort)
    UnityEditor.DockArea:OnGUI()

    IsFinite(outDistanceAlongView)
    UnityEditor.DockArea:OnGUI()
     
    Last edited: Jan 3, 2016
    knickerbocker likes this.
  11. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    does it work with RFPS?

    and can i change agent textures to make a new enemy or i should make a rogdoll and do all the thing due to have new soldier?

    In UFPS demo the agents hust attack and they dont use cover!

    sorry for my english
     
  12. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    It doe
    It does not support RFPS out of the box, but the only thing stopping you should be the damage methods.

    Yes, you can change the agent textures or use your own custom models.

    In the UFPS demo, the only agent that won't take cover is the one with the green shotgun. However, sometimes you can get into a position where there is littlr cover for the agents to take while still being able to fire back. Also note that they will not take cover when they aren't aware of your position. I'd recommend trying the demo again!
     
  13. Gojira96

    Gojira96

    Joined:
    Jun 18, 2015
    Posts:
    32
    Hello,

    I am using a Slow Motion script that changes time scale to 0.2.
    Everything in the game slows down,even audio,except A.I.s "Bullet sound".
    I cant figure out how to change its pitch when time is slowed down.
     
  14. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    For Dmage in RFPS I shuold do like what you said to do in old Shooter AI? changing some codes and ... ! yes?
    Code (CSharp):
    1. (hit.transform.sendmessage....("Damage",(float)damage);  )
     
  15. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    You'll just want to decrease the pitch on the gun's audio source with whatever code is used to slow time down. Asign the audio source to a variable and then just lower the pitch.

    If you want code, lemme know and I'll see what I can do when I get back to my computer.
     
  16. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Something like that, yes. If it worked with Shooter AI, then I am 99% certain it'll work with Paragon AI.
     
  17. Mike1968

    Mike1968

    Joined:
    Aug 31, 2015
    Posts:
    6
    Hello,
    I use UFPS and Paragon Shooter AI.

    In my scene there are some doors and UFPS can open them by key "F". The doors are not statics. Static doors can not be open. So an agent of Paragon Shooter AI does not "see" the doors. For him, there are no doors. The agent can see through the door, it passes easily through the doors and shooting through the doors. The doors are closed.

    Please recommend me something.
     
    Last edited: Jan 6, 2016
  18. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    The easiest way would probably be to just put a navmesh obstical component on the door. Make sure it is set to carve the mesh.
     
  19. Mike1968

    Mike1968

    Joined:
    Aug 31, 2015
    Posts:
    6
    Thank you for your advice, squared55. Now the agent can not go through the closed door. But the agent still sees and can shoot through the closed door.
     
  20. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Either put the door on the same physics layer as the rest of the level or adjust the Paragon AI Controller and Bullet layermasks so that they include the layer that the door is on.
     
    Last edited: Jan 7, 2016
  21. Mike1968

    Mike1968

    Joined:
    Aug 31, 2015
    Posts:
    6
    In a script named "vp_MovingPlatform" in method "Start" I found a string:

    gameObject.layer = vp_Layer.MovingPlatform;

    This string overrides the layer of the door from "Default" to "MovingPlatform"

    So, I added my agent controller the layer "MovingPlatform" and then agent plays correctly! )))

    Thank you very much, squared55 !
     
    Last edited: Jan 8, 2016
  22. Eknoes

    Eknoes

    Joined:
    Sep 15, 2015
    Posts:
    56
    The demo scenes work fine in the editor, but when i build the game for example for Windows i get many exceptions.

    Here the first two exceptions from output_log.txt

     
  23. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Add the tag "AI Controller" in the editor, and see if that fixes it.
     
  24. Eknoes

    Eknoes

    Joined:
    Sep 15, 2015
    Posts:
    56
    The tag already exists in the editor. I created a new project and just imported Paragon Shooter AI
     
  25. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Alright, I'll look further into the issue- Unity's also giving me problems with building for Windows. In the meantime, can you tell me what version of Unity you are using?
     
  26. Eknoes

    Eknoes

    Joined:
    Sep 15, 2015
    Posts:
    56
    I'm using Unity 5.3.1p2
     
  27. knickerbocker

    knickerbocker

    Joined:
    May 8, 2014
    Posts:
    29

    Having the exact same problem. Same few messages keep popping up on console.
     
  28. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Alright. Unity 5.3.1 works fine for me, save for the debug log getting spammed with errors thanks to a glitch with the particle systems. Patch 1 fixed that issue, and works for as well. I'll get back to you on patch 2. Did you install both patches?

    Install patch 1 for Unity 5.3.1.
     
    Last edited: Jan 11, 2016
    knickerbocker likes this.
  29. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    I somehow managed to miss this. Sorry! Install patch 1 for 5.3.1, and the problem should be solved.
     
    knickerbocker likes this.
  30. knickerbocker

    knickerbocker

    Joined:
    May 8, 2014
    Posts:
    29
    Which patch? I'm already on the latest version: 1.01

    im such a noob i realised you meant patch 1 for unity. thanks!!
     
    Last edited: Jan 11, 2016
    squared55 likes this.
  31. knickerbocker

    knickerbocker

    Joined:
    May 8, 2014
    Posts:
    29
    Another Q:

    How do i stop the AI from shooting at my player, once my player is dead?

    I've tried the following but can't seem to stop them from constantly attacking my player, unless i remove the target script, which does not seem like a good way to conduct death/respawn.

    EDIT Figured it out after adding a new function below removeTargetFromPlay in TargetScript.cs:
    Code (CSharp):
    1. //Call this from player class to remove my dead player
    2. public void RemoveThisTargetFromPLay()
    3.         {
    4.             if (ParagonAI.ControllerScript.currentController != null && isPlaying)
    5.                 ParagonAI.ControllerScript.currentController.RemoveTargetFromTargetList(myUniqueID);
    6.         }
    7.  
    8. //Added this function in Target.CS so Player can once again be detected
    9.      public void AddThisTargetBackIntoPlay()
    10.         {
    11.             if (ParagonAI.ControllerScript.currentController != null && isPlaying)
    12.                 ParagonAI.ControllerScript.currentController.AddTarget(myTeamID, targetObjectTransform, this);
    13.         }
    I am also trying to enable this for UNET online play, do you have any recommendations on where i should start in terms of preparing the AI player, so their actions/movements can be synchronised for all players to see.

    I understand you use NavMeshAgent so i was going to synchronise the velocity and animator values, but for the weapon actions / other decisions i'm not so sure.
     
    Last edited: Jan 11, 2016
    squared55 likes this.
  32. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Glad to hear that you solved your first problem.

    Unfortunately, I don't even know where to start when it comes to multiplayer. I've only ever made a very limited implementation. Sorry.

    If I had to guess though, I'd say you probably only need to synchronize the current animation state, position, and current target. The rest could probably be done by each individual computer if you network instantiated the bullets. Of course, take this with a mountain of salt.
     
  33. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    when I use Paragon aI - the First Person Controller in standard asset is not working! the fps is not moving and only the mouse look works!
    And same problem with RFPS!
     
  34. RoyalAllen

    RoyalAllen

    Joined:
    Oct 17, 2012
    Posts:
    205
    @rbm123 Hey sometimes when you import assets it will change Unity 's game settings like input for axis and button . Or commonly conflicts with other assets.
     
  35. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    The problem is with the animations, they don't retarget very well, another asset (RAIN AI - Squad Commander) includes them (Soldier) and they fixed them, I have had to use them instead on my other characters, even then they have to have Animated Physics set on Animation Controller or the Bullet Spawn transform direction will flicker around and bullets go everywhere.
     
  36. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    So what should I do?
     
  37. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Alternatively, making all your rigidbodies kinematic should do the trick.
     
  38. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Copy the input and layer settings file from a project that works.
     
  39. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Hey Squared55 is there a way for the AI to not follow the player? I think I read this question/answer before (it was currently unavailable I think?) Anyways, just curious if there's a solution or temporary work around because once the AI finds me, they are merciless and just hunt me down and waste me. I was hoping for more of an AI that's based on LOS and sound. Any suggestions or idea when this will be implemented?
     
  40. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    There's a setting in the TargetScript that lets you decrease the radius in which they'll follow you; I forget what it's called and Unity is down for Paragon AI at the moment, as I'm trying to upgrade my game to Unity 5 (long story) so I can't check.

    Basically, the enemies will lose track of you when you move far enough away from the last position that they saw you. The idea is that they'll remember where you are when you duck behind cover, but run to the other side of the map and they'll forget.

    I can give more info once I've got the current version of Unity back up on my computer.
     
    RangePlusOne likes this.
  41. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    thanks for your support!
    is there video tutorials for this package?
    i add team 1 and team 2 agents and do everything is required but they don't attack each other or even my man fps character !
    I think this is so low level question !
    sorry for my english!
     
  42. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    I'm not the dev, but do you run the default scenes? Which version of Unity do you have?
     
  43. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Hmmmm upon further investigation, I can't seem to break the enemies ability to hunt me down once they've spotted me. I've tried tweaking all the TargetScript settings on the enemy prefab... in the image I uploaded I am trying to make them lose me almost instantly for testing purposes. I'm curios if the enemy sees me through the wall but doesn't shoot because of layer issues? No idea... but any help would be supremely appreciated!
     

    Attached Files:

  44. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Probably an issue with the Controller layermask, yes.
     
  45. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Do the demo scenes work?
     
  46. Mike1968

    Mike1968

    Joined:
    Aug 31, 2015
    Posts:
    6
    I can't integrate UFPS grenade with the agents. I set GrenadeScript to the Granate puckup (UFPS pickup), set layer mask, but the grenade has no effect for the agents. No method called from GrenadeScript except OnCollisionEnter.
     
  47. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    After trial and error, I think I've found the problem? When enemy loses line of sight, nothing changes, and the enemy keeps chasing me regardless? Tried to modify but no concrete solution was found.
    Line 370 to 376 in TargetScript.cs
    //If all of the above fails, pick a random target- even if it's one we haven't seen
    if (currentEnemyTarget == null && enemyTargets.Length > 0)
    {
    lastKnownTargetPositions.Add(enemyTargets[Random.Range(0, enemyTargets.Length - 1)].transform.position);
    //currentEnemyTarget = enemyTargets[Random.Range(0, enemyTargets.Length - 1)];
    }
     
  48. googlebac

    googlebac

    Joined:
    Feb 1, 2015
    Posts:
    56
    When I enter play mode, Target script is unticked, this is not the case in the sample maps. still having issues where the ai doesn't engage in any behaviours and just stands there. characters do react to being shot but nothing else.
    Such a weird bug. navmesh is a terrain object.
     
  49. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    The Paragon AI grenade script is not meant to be used by players. Have you modified your UFPS explosions as outlined in the UFPS integration section of the manual?
     
  50. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Have you added a Paragon AI Controller script to an empty gameObject in the scene?