Search Unity

Realistic FPS Prefab [RELEASED]

Discussion in 'Assets and Asset Store' started by Deleted User, Apr 5, 2013.

  1. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Just script compatibility with Unity 5.5.
     
  2. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @Locky I see the missing picture. Sry, I can't remember the required step described in the pic either. Maybe @llJIMBOBll still has his Picture somewhere to put it up again.

    @TonyLi WB! I now have my CharacterDamage.cs updated with the "OnDie" - Event. Thnx for pointing me there. This new Component seems especially useful for the Story Mode that I'll be working on next. Now I just need some Skill to make the most out of it! ;)
     
    Last edited: Jan 19, 2017
    Locky likes this.
  3. Mario167100

    Mario167100

    Joined:
    Jul 25, 2016
    Posts:
    49
    Hey, i've recently been thinking about modifying the scripts in the AI recently and i need some help.
    What i'm basically trying to do is get the enemy NPC (Or Ally NPC) to run away from the action when his health gets too low. Does anybody have any idea where i should start when rewriting the script(s)?
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    It's probably easiest to monitor the NPC's health by watching the CharacterDamage component. When health dips below a threshold, disable the AI component, and enable a new component that you'd have to write to make the NPC run away.

    Or use an AI replacement such as Behavior Designer or Tactical Shooter AI, both of which can integrate with RFPS.
     
  5. Utomnia

    Utomnia

    Joined:
    May 21, 2015
    Posts:
    2
    Excellent package. I've been trying to get it working with Unity 5.5 networking without much luck. Should I switch to the Bolt network system (another 80 Euros which isn't the end of the world in the grand scheme of things) or has anyone got this working with standard Unity networking? Sorry if already been answered but I'm sure I've read through most of the thread. Thanks in advance for any pointers.
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    I did a proof of concept integration of RFPS and Bolt, detailed in this post. But it's far from comprehensive and polished. If you're familiar with how Unity 5.5 networking (UNET) works, you might be just as well off sticking with UNET and using that post to help identify where in the RFPS scripts you need to make modifications. Then again, if you use Bolt and follow that post step by step, it should get you to a point where multiple players can run around and shoot at each other, but minus some glaring omissions such as authoritative servers and animating other players' bodies.
     
  7. Utomnia

    Utomnia

    Joined:
    May 21, 2015
    Posts:
    2
    Thanks for the reply. I guess I'm trying to work out whether to spend the 80 Euros and use your guide or spend the time with UNET. I don't have any experience with Bolt - anyone have any view on whether, in the long run, Bolt is better than UNET? Thanks again.
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Bolt and UNET are fairly equivalent feature-wise, but they have different designs. There's a moderate learning curve with either one. You'd have to pay for Bolt, but it would give you a head start on integrating with RFPS. If you go with UNET (for which you might have an easier time getting help here on the forums), you can still adapt the ideas and reference points in the RFPS scripts from my post. You just wouldn't have something that immediately works (such as it is) out of the box like with the Bolt integration. Maybe consider what other components you'll need, like a lobby/matchmaking piece for example, and figure out if Bolt or UNET has a plugin that you'd want to use for that.
     
  9. Mario167100

    Mario167100

    Joined:
    Jul 25, 2016
    Posts:
    49
    Thanks for the reply Tony! I have another question though. My game will have several buildings that lead to other scenes. How can my "FPS Main" keep it's inventory of weapons or health everytime it moves to another scene/level. I've heard that you can accomplish this using the "Dialogue system" by Pixel crushers, but that asset pack is $65 dollars and i don't have dollar to my name right now. So is there a free/cheap alternative to this method?
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    I'm working on one. I'll PM you later today.
     
    Shodan0101 likes this.
  11. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    Also ICECreatureControl which seems also a very good AI solution has a direct integration for RFPS since the last update. I want to use ICE for my game. I'm not sure how well the Dialog System will get together with ICE, but i guess its worth a try.
     
    Weblox likes this.
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    They get along just fine. You can read some tips on the Dialogue System's ICE Creature Control Support page.
     
    Hormic and Weblox like this.
  13. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Has anyone worked with Emerald AI ? They have a video showing it with RFPSP >here< . I really like the Predator System that it offers, especially when working with animals in nature environmemt and it seems to use more than one animation for its attacks, but I wonder how good it really is and if the integration is solid. Also if you can have it run along the default RFPSP AI or if you would need to change your AI on all Characters in your Project.

    I have bought Behavior Designer on Sale lately, but I am still hesitating to integrate it into my current Project, since as far I seen it will make me change all AI to Behavior Designer. Also for me it still seems a bit daunting in its complexity right now.

    @TonyLi Hi, I also would be highly interested. I hope not to exploit peoples kindness, but having a decent Save/load functionality would be so great! :)
     
    Last edited: Jan 23, 2017
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    You can mix and match -- some NPCs using RFPS's AI, others using Behavior Designer. It can be a bit daunting, but it's the most flexible since it can support anything that you can design in a behavior tree, not just shooter-specific AI. Emerald, ICE, and Tactical Shooter AI aren't as flexible, but they provide decent shooter behavior right out of the box.

    I PM'ed you.
     
    Weblox likes this.
  15. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    @TonyLi: So you would suggest Behavior Designer over ICE?
    I'm undecided cause i own both, but ICE seemed also very flexible and looked very promising.
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    This is just my opinion. Both are very good. It depends on what you need. If you just need AI that fits the roles provided by ICE, consider using ICE; it might be simpler to get going with relatively sophisticated AI. If you think you might need more flexibility or really smart combat AI, use Behavior Designer.
     
    Hormic likes this.
  17. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    Thank you very much, i need a very flexible AI, not just combat but when it comes to combat i also need a good AI for Flying enemies (which i have seen with ICE). And it should fit in as smoothly as possible with RFPS, Dialog System and other Assets like the Weather System and so on, here i think Behavior Designer is better integrated in Dialog System, and i also noticed that Behavior Designer and UFPS is from the same Developer now, so this is also an advantage to go with behavior Designer. So i will start with this one and see how it goes.
    Best thing would be to try out both,...
     
    Weblox likes this.
  18. Locky

    Locky

    Joined:
    May 14, 2015
    Posts:
    86
    Weblox, I have got RFPS and Emerald working together without much difficulty. There is some code that needs to be added/replaced, which Emerald details on their blog. The integration really is solid and I haven't run into any bugs or issues. It's really great being able to hunt animals in your game! I have ICE but haven't worked with it for a long time so I can't do an accurate/fair comparison. But briefly, Emerald is easier to learn and to set up, and ICE has more features. For example with Emerald you only have a single collider so you cannot have different damage when hitting different parts of the creature. I have not run Emerald along side RFPS' AI.
     
    Weblox likes this.
  19. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Thanx every buddy! ;) That is quite a lot of useful information!
    @TonyLi That sounds great. I really like the option to mix the AI. I have heard a lot about Behavior Designer being the most advanced AI around, but I have never been able to find any video footage of actual gameplay, especially with RFPSP. If I am not completely wrong Behavior Designer does come with a premade Behavior Tree that I can use with RFPSP, so I will not have start from scratch,am I right here?. I also got the most recent Integration files. So only to be really sure : after making the changes to the Code explained >here< I can still run RFPSP AI next to Behavior Designer AI in the same Scene? Thnx for double - clearing the same question. :) Also, should I get the additional expansion packs (Movement, Formation, Tactical) and will they work "out of the box" with RFPSP? ;)

    Then we only need Emerald AI to run along the two other AI solutions.
    @Locky That sounds great also. I really want to try Emerald on Wildlife for it's different Options such as herds and packs or predators and prey. It's good to have a stable integration ready. Being limited to only one collider is a bit odd since everyone still wants headshots, but maybe we will get that with a later update.

    @Hormic Right now my thought is to use Behavior Designers default Behavior Tree on Human enemies. For wildlife in Nature I still tend to tryout Emerald AI, and hence... at some Point I want them all o_O Hopefully I will not have to split-up my Project to get to try them both.

    Thanx every one for helping and keep up the good work
     
    Last edited: Jan 24, 2017
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    "Most advanced AI" is an arguable concept. There are many types of advanced AI architectures, each with their advantages and disadvantages. But in any case Behavior Designer is an excellent implementation of the very popular and powerful architecture called behavior trees.

    I haven't tested RFPSP AI and BD AI in the same scene, but I don't see any reason why they can't work side by side.

    You'll definitely want BD's Movement Pack. I don't know if you can still get a free copy with the purchase of Behavior Designer, but it's worth it either way. You might want to start with that to get things set up, and then incorporate Tactical and Formation later when you're ready to make your AI really smart.
     
    Hormic likes this.
  21. Shodan0101

    Shodan0101

    Joined:
    Mar 18, 2013
    Posts:
    141
    Hi Tony,

    I'm not sure if this has been asked... I haven't had the time to go through the threads. Is it possible to do Glory Kills / Mellee Kills like DOOM "2016" with Realistic FPS? Do you have such a feature planned or can I add mine to your current "player / animations"? Not sure how this will work. Thx so much for you time.

     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Hi @GMax - I'm not the developer of Realistic FPS Prefab; @Azuline-Studios is. I just work with RFPSP and occasionally answer questions if I can help. Hopefully Azuline can answer your question.
     
    Weblox and Shodan0101 like this.
  23. Shodan0101

    Shodan0101

    Joined:
    Mar 18, 2013
    Posts:
    141
    Aaah ok ;) I see, well you're dam good haha thx for helping us out! Are they still active on the forum? Hope they read my message ;/
     
    Weblox likes this.
  24. Shodan0101

    Shodan0101

    Joined:
    Mar 18, 2013
    Posts:
    141
    Tony, I have another question RFPS has feature where you can swim and go underwater "waterzone", will this work with another Asset on the store called Aquas Water "for example" Aqus also has its own underwater system. Attaching the WaterZone.cs to Aquas "system/prefab" will this work? Or will RFPS only work with its current WaterZone prefab and you cant add any "3rd party" water asset?
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Sorry, I don't know. Azuline is usually tucked away in their secret mad scientist lab working on the next version of RFPSP, but maybe they can pop in to answer you, unless someone else here knows the answer.
     
    chelnok, Weblox and Shodan0101 like this.
  26. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @GMax Actually, since update 1.23 RFPSP does support BASIC melee attacks with ranged weapons. You need your Weapon/Hands 3D Model to have a melee animation. If you wanted to use any combos they would need to be baked inside the animation I suppose. But to shoot your enemy until he gets weak enough and then finish him off with a melee attack should be "totally" possible, to a certain degree. However, to make something look as nice as in the video should be a LOT of work! ;) The AI would need to be highly expanded to support "got hit" Reactions. AI has just been discussed in this thread earlier. Also the game seems to be all build around achievement Systems such as glory kills and all sorts of special moves. You will not get any of this "out of the box" .

    @GMax Accompanied ! :)

    @TonyLi It would definitely be nice to hear from @Azuline-Studios . A roadmap would be great. Also feature requests, lol :)
     
    Last edited: Jan 25, 2017
    Shodan0101 likes this.
  27. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    does anybody know a inventory asset that works with RFPS? I only find UFPS compatible :-(
     
    Last edited: Jan 25, 2017
    Shodan0101 likes this.
  28. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    Shodan0101 likes this.
  29. Shodan0101

    Shodan0101

    Joined:
    Mar 18, 2013
    Posts:
    141
    Thx so much Weblox for your wisdom! I am definitely gona try and see if I can implement a system like this for my game. Do you have any knowledge on water features inside Realistic FPS can use something like Aquas "from my question earlier"?
     
    Weblox likes this.
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    There's also S-Inventory. If you have the Dialogue System, it includes S-Inventory + RFPSP integration. If you don't have the Dialogue System, feel free to at least download the S-Inventory Support package from the Dialogue System Extras and use what you can of it. It won't compile without the Dialogue System, but you can scavenge from useful code from it.
     
    pushingpandas and Shodan0101 like this.
  31. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @GMax No,I have not worked with Aquas before. I am just starting to learn Unity with RFPSP myself, but from looking at the "WaterZone" in the Demo Scene it has the "!WaterZoneTrigger" which seems to make your Player interact with it. The "Water4Simple" child object is the water Prefab. If Aquas has a similar approach with GameObjects and Prefabs ,which i do not know, then I suppose you can just swap out the water Prefab and adjust the collider settings on the "!WaterZoneTrigger". This way you would get the water visuals you want, but loose Aquas own underwater system. But again, this is just guesswork since I have tried none of it. :)
     
    Shodan0101 likes this.
  32. Shodan0101

    Shodan0101

    Joined:
    Mar 18, 2013
    Posts:
    141
    Hmmm was thinking the same thing with the prefabs and WaterZone trigger! Thx for trying to help out, you are a legend ;)
     
    Weblox likes this.
  33. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    @Azuline-Studios, I'm using RFPS 1.21. I've noticed that in 1.23 changelog there's this line.
    • Player capsule and rigidbody no longer get stuck against certain complex, concave mesh colliders.
    Does anyone know it was done? Cause I want to implement it in my current version.
     
  34. ApexofReality

    ApexofReality

    Joined:
    Feb 14, 2016
    Posts:
    102
    Can you use magicavoxel objects as enemies? If so how do you implement them?
     
  35. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    I am attempting to use the Monster 3 asset from the unity store with the RFPSP asset. I am entirely new to this and have never changed out characters before so this may be a very simple problem.

    I have followed RFPSP's instructions, which are:

    "Adding New NPCs
    The first step to adding a new NPC is dragging an existing NPC object from the project library
    from either Assets\RFPSP\NPCs\ZombieNPC for the zombie NPC or from Assets\
    RFPSP\NPCs\RobotNPC\ for the robot NPC. Then you can click on the RobotNPC or ZombieNPC
    object in the hierarchy view and select Break Prefab Instance from the GameObject menu so the
    original won’t accidentally be overwritten.

    Then you can expand the hierarchy of the duplicated NPC in the Hierarchy window and delete all
    of its child mesh rendering objects. After you’ve done this, you can locate the new NPC character
    mesh in the project library, and drag it over the duplicated root NPC object. The animation
    component of the duplicated NPC object can also be deactivated by checking the box in the
    upper left of its component window.

    Now we want the AI.cs component of the root/parent NPC object to use the animations of the
    child character mesh you just added to this object. To do this, expand the root NPC object’s
    hierarchy and drag the child mesh object over the Object With Anims field of the AI.cs
    component. New character models will need to have their character joints set up and each
    collider needs a LocationDamage.cs component. Unity’s ragdoll wizard is a good place to start.
    You’ll also want to make sure that the imported character mesh has these animations defined in
    the Animations section of the mesh’s Animation Import Settings: shoot, idle, walk, run (case
    sensitive). When you test the scene, your new NPC should animate correctly and chase after the
    player."

    I have imported the monster 3 asset and placed the creature1.fbx file containing mesh and animations into the zombie hierarchy. I cleared everything out of the original zombie folder except for the main zombie object which to my understanding contains the controls to everything. I then used the ragdoll wizard and connected the joints creating the ragdoll of the creature1. I then drag the creature1.fbx into the zombie npc object's AI script "Object with anims" slot.

    However, when I get to this point, everything stops working, when I hit play in test mode, the monster deforms and does not move at all. Honestly, like I said, I'm entirely new to this whole process and have found myself with a lack of a clear understanding on where to go next using RFPSP's system. I'm hoping someone with experience using the RFPSP asset could point me in the right direction.

    I have attached an image of everything I'm working with
     
  36. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    oz3_sccreen-shotd.png Strolscki I have used the mean troll prefab just fine in RSFP. I have this asset (monster 3) downloaded and will try and hook it up tomorrow. I have noticed that some bi-ped assets from the store have an odd vertex lock or something that does funny things in RSFP. so not sure if you are seeing this with the asset. remember not all assets int he store are "commercial grade" if you will and some devs don't really do a good job at cleaning up their assets. (I went through almost 25 of the store prefabs and only got about half of them to work) As I find out more , I'll keep ya posted.

    http://huesgfx.com/firedrake/wp-content/uploads/2016/12/oz3_sccreen-shotb.png
     
    Last edited: Jan 28, 2017
  37. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Question: I'm at the point of my VR game where I have the levels designed, the monsters in, the weapons updated (I'm using Melee weapons mostly) with RFPS and now I need to link them all together. Does anyone know of a good Save/load system?

    I'm leaning towards Tony Li's system, but am worried that for mobile VR, it might be a bit heavy. I don't really need diolug and the inventory system could be useful and don't really need quests, but do need to be able to load and unload and save player states between levels. Has anyone implemented such a system with RFPS yet? I see a bunch of unity tutorials on creating a a system, but I'm mostly a C# noob.... (hence going with Tony's system)
     
  38. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    I would appreciate that. I suppose I should do some practice with the standard unity model to learn the process as well so I can learn how to do this in general. Please keep me in the loop on your test
     
  39. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    So i would like to know if anyone has figured out the animate on trigger in the activate trigger script.
     
  40. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    @TonyLi & other Memmbers,
    How can i add Bullet time on a collider (triger) for few seconds, should i write a new script ? or there is a way to implant RFPS own bullet time.
     
    Last edited: Jan 30, 2017
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    What trigger script is this?

    It's best to use RFPS's bullet time. For example:

    BulletTimeTrigger.cs
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. public class BulletTimeTrigger : MonoBehaviour {
    4.  
    5.     public float sloMoTime = 0.9f;
    6.  
    7.     void OnTriggerEnter(Collider other) {
    8.         if (!other.CompareTag("Player")) return;
    9.         var fpsPlayer = FindObjectOfType<FPSPlayer>();
    10.         fpsPlayer.StartCoroutine(fpsPlayer.ActivateBulletTime(sloMoTime));
    11.     }
    12. }
     
    Weblox, Hormic and Shodan0101 like this.
  42. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    So I figured out I had two problems:

    A: I was turning my main npc into a ragdoll, thus I assume causing the deformities.
    B: I needed to change the character with the animations over to Legacy

    I fixed these two issues and now the monster will show an idle animation and move around and attack me. However, he only shows the idle animation no matter what, the other animations in the array on the inspector are not being used. I swapped out the main animation from idle to another one of the animations in the array and it did switch the animation to that, so I know that the animation component is what is working, I just can't figure out why it isn't pulling the other animations to walk, run, shoot and die.
     
  43. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    I figured it out. I kept placing the original animation object into the AI object in the inspector instead of leaving it blank to pull animations from my root NPC. When I removed it and left the AI object slot blank, everything worked flawlessly. Thanks for the help regardless.
     
  44. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    @TonyLi thanks for BulletTimeTrigger, works fine.


    i have a new Question, how to make a turret player controllable. how can i do it ? does any one had make this ?
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Way back, I posted an example turret script. I don't remember what version of RFPS it was for, or even what its features were. I haven't looked at it in over a year. Here's a link if you want to check it out:

    RFPS_DS_Turret_Concept.unitypackage

    You could probably use something more official like this Turret System on the Asset Store, but you'd have to disable the RFPS player when switching to the turret, and then re-enable the RFPS player when exiting the turret. If you're using the Dialogue System's RFPS integration, you can call FPSLuaBridge.OnConversationStart() to disable the player and FPSLuaBridge.OnConversationEnd() to re-enable the player. Also, you'll need to tie it into RFPS's damage system.
     
  46. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    I am stuck on version 1.22 and am trying to make the camera/player instantly move to another location/orientation so it is looking at a specific position/object. Is there a correct way to do this on 1.22?
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Didn't 1.22 have the MovePlayerAndCamera script?

    If that was introduced in 1.23, then in 1.22 you can manually set camera like this:
    Code (csharp):
    1. var smoothMouseLook = FindObjectOfType<SmoothMouseLook>();
    2. smoothMouseLook.rotationX = //your camera X rotation
    3. smoothMouseLook.rotationY = //your camera Y rotation
    and set the position like this:
    Code (csharp):
    1. var fpsPlayer = FindObjectOfType<FPSPlayer>();
    2. fpsPlayer.transform.position = //your player position
    3. fpsPlayer.transform.rotation = //your player rotation
     
  48. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    Thanks TonyLi, I'll check it out and yes the MovePlayerAndCamera script seems to be new in 1.23
     
  49. Sorrowthief

    Sorrowthief

    Joined:
    Dec 14, 2016
    Posts:
    48
    I was thinking of getting this as I just bought Ice Creature Control and saw that it intergrates into it. One question I didnt see covered. Does this project allow you to replace the FPS models with full characters and add custom animations? I want to be able to see my players feet and arms and plan to make my game multiplayer in the future so they would need my custom models?
     
  50. musolo

    musolo

    Joined:
    Sep 12, 2014
    Posts:
    238
    why default weapon scale is so huge?
    My custom weapon is offset far below the ground and flipped upside down when i press play.
    i imported makehuman rigged mesh into blender, deleted all bones exept for the arms as well as unwanted mkehuman mesh parts. Added a weapon , animated it and imported in unity. Origin of my rig was at 0.0.0 in blender and rig wasn`t mooved globally nor adjusted closer to origin in edit mode.
    How do i go about setting up my stuff?
    Anybody knows where good tutorials are?
    Author doesnt make modern talking tuts( Just single outdated deaf video. Few kids made crude deaf vids on youtube RFPSP youtube page is a joke.
    Can someone share if he had some issues like this?
    Thanks