Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Realistic FPS Prefab [RELEASED]

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

  1. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,863
    I seem to recall having a similar issue some time ago. Now do not quote me on this because I'm not entirely sure, but I seem to remember this being an issue with on-the-fly decompression of decently sized audio files. Had to do with the setting for the audio clip itself I do believe. I know this might not be terribly helpful.
     
    TonyLi likes this.
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    Save System for Realistic FPS Prefab

    Version 1.1.5 of the Save System for RFPSP is now available on the Asset Store.
     
    OZAV likes this.
  3. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    161
    You Might Be right I will be Checking on that , But the Fire Sound Clip It self Is Just 50Kb so maybe something else is getting in the way , ill post if I find any solution
     
    JamesArndt likes this.
  4. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    254
    wait...., what sorcery is this? A new update? i was just getting ready to rig up the save system in my current game(I use it in a very unorthodox way I think) What magics have gone into this "performance updates'? Any super cool new features?


    Way cool!
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    Hi @jons190 - No new RFPSP-specific features. It adds support for asynchronous saves (a requirement for some console platforms), a MultiActiveSaver component that can save the active/inactive states of multiple GameObjects, some minor optimizations of the way save data are accessed, stuff like that.
     
  6. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hello all,

    I have a problem that I cant find or currently think of a solution for that would be easy to solve?

    Triggers! I have a lot of them in my game. Hundreds or more like thousands. They are evrywhere and vary in sizes and proximity to each in places being almost touching esch other.

    This applies to "All Triggers" e.g. RFPS Move Triggers and alike and Unity default or other Asset Triggers.

    In my game the Player weapon is a Sword. Enemies "Attack" the Player or perhaps other Enemies and some have Swords and some Enemies such as Amimals Bite or strike the Player by some other means as tends to happen in Games.

    That is they Attack and if they do so whilst in close proxity to or within a Triggers Bounding box area (colider) then any Hit Effects, Sounds and so on, attached to the AI Attack (weapon, punch, bite) "Play and Display" when the Triggers Collider receives a Hit. e.g, Hit sparks and so on are generated Yes?

    This seems to be a Global issue as it applies to All Triggers

    Clearly having Sparks, Wood Chips or similar flying around or hits sounds and so on playing every time the Player or AI Enemy strikes/hits a Trigger is just riduiculous and something I have just recently discovered.

    I have looked around the Internet for an (solution) and tried some scripting myself as yet to no avail in fixing the issue. Not sure if its a Unity things or RFPS specific but it seems that its Unity related to me?

    Anyone know of a fix for this please as its killing my game :)

    Any help would be very much appreciated.

    I will keeping looking here for a fix but could be at it forever :)

    Thank you kindly.

    Regards to all.

    Peter
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    Hi Peter - It's probably RFPSP-specific. Try changing the layers and/or tags on the triggers. Try one trigger, find a tag and/or layer that fixes the issue and also doesn't break its own functionality. Once you've confirmed that works, change the other triggers to that tag and/or layer.
     
  8. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hi Tony,

    Thanks for that. Yes I will play around with tags and Triggers then. Sounnds like a plan :)

    I have a little experience too with creating Tag related scripts I use e.g. Activating Triggers by Tag and so on and have found a script at Unity which may help I will try editing to suit. I am not good at scripting but play about with them blindly and see if I can get something t work :)

    Thanks again

    Peter
     
  9. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hi TonyLi,

    I seem to have fixed that now...........

    Heres what i did so that others may try the same if the need to......

    In RFPSP I used an empty Layer (30) and gave it a name of Trigger Hit. Then I also created a new Tag named TriggerHit (no space).

    Inside my game level I applied to a Triger and Move Trigger the New Layer "Tigger Hit" to test this out and that works and no hit is recorded by the Triggers when a NPC characters (hopefully) including Player strikes a Trigger with a weapon :)

    This I did manually and I do not believe that the New Tag TriggerHit is required also for this to work but its available if need be............

    Note :

    1. Now this seems to work fine for what one might describe as "Standard Unity and RFPS Triggers".

    Though this works fine and solves the issue this requires individual Trigger (manual) intervention Yes.

    I have thousands of Ttriggers in my project and many more to add I am sure and dot particularly want to go find them all and update them manuallly and ideally wanted a "Global" solution. This can be done easily by updating any "default Trigger prefabs you have by adding the new Layer manually to the default trigger prefabs, but I have many where i have Broken or Unpacked the original trigger prefabs in my game and renamed them to my own keeping original intact......

    Thus my solution was to add the new Layer to any Trigger Scripts used by the game thus one does not then need to add the new Layer manually to any existing or new Trigger added. Problem easily solved "Globally".

    However I have some Triggers (using Scripts that I have edited/created from default ones) that I have additionally set up to activate using "Activation by Tag" so that say only the Player or other specifed character will activate these.

    They work fine in doing that job by placing them on the new Trigger Hit layer but that does not seem to work in this case unless one does it manually and then it does.

    I will have to look for a reason for that and try and get a global solution.

    Tip : I have to check these again in game as Unity sometimes (often) get tired in a session of many hours working with it and things go haywire until one reboots the system and Unity updates eveything.....

    For example a few days ago I lost all my Waypoint Paths and Triggers where they were nowhere to be seen Visually so bear in mind users that Unity can go astray in this way quite often with me and one can be fooled into thinking a level is broken when its not and spending wasted hours looking for a reason when there is no issue so it can be fixed. Many othe things like AI NPC behaviors can go haywire too.

    So if you get these kind of issues try shuttingdown unity and the systen and rebooting it :)
    Depending upon your system Unity can struggle with memory and performance issues when anything can start go wrong! Windows Updates can also affect in such ways similarly while wating to be installed by rebooting.

    I can be working for 15 hours a day or in one session with highly complex levels and others may not be in that situation and Unity (and I get tired) :)

    In case others want to do what I have done heres the simple code that i added to my Trigger Scripts....

    CODE : Goes near top of script - Add the line : gameObject.layer = 30; as shown below

    public Mode action = Mode.Activate; // The action to accomplish
    public Object target; // The game object to affect. If none, the trigger work on this game object
    public GameObject source;
    public int triggerCount = 1;
    public bool repeatTrigger = false;

    //public float range = 5f;
    private void DoActivateTrigger()

    {
    gameObject.layer = 30; //add this
    triggerCount--;

    if (triggerCount == 0 || repeatTrigger)
    {

    --------------------------------------------------------------


    Thanks again TonyLi for helping me here.

    My game would be much less than it is without your help. If it get finished then you get first place credit :)

    I will never finish my game most likely as I am getting on and looks like years yet to go but I am trying to get at least a demo or video out of the Level "The Great Battle" to the public this year and I would credit you there.

    Back to work I have to record new sounds for all NPC's in the level Oh and create lots of NPC Ragdolls (pain in the but) and much more:)

    Regards

    Peter
     
  10. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hello Again,

    I have another question?

    NPC Sounds............

    What on earth are the Joke and Taunt sound parameters supposed to do? Nothing about that in the manual and the tool tips on the NPC character settings are as clear as mud.............

    Any idea how they are supposed to work and when? I have never been able to get those to play so what exactly is supposed to trigger them? Are these supposed to work for All NPC's whether enemies or friends? Joke and Taunt sounds I guess could be relative to both groups? Perhaps I could change some perameters to force them into action and get some to play at random intervals or at all? Not that I would want too many playing continuously but occasional Joke or Taunt sounds would be good :)

    All other sounds .e.g. "Walk, Alert, Attack, Pain, Death and so on" play of course just fine.

    I must be a bit slow here or are missing something! Not played about with the settings much for these before.

    Any pointers to wake up my thought process would be appreciated.

    Kindest regards

    Peter
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    The joke sound plays if you activate a companion NPC more than 33 times (the AI component's Joke Activate value).

    The taunt sound plays if an aggressive NPC starts hunting the player.
     
  12. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hi TonyLi

    Thanks for again kindly for that.

    Peter
     
  13. SashaNyashaa

    SashaNyashaa

    Joined:
    Jul 31, 2015
    Posts:
    3
    Hello Everyone!

    Sorry for the errors, I use Google translate.

    I have a problem. I'm making a retro shooter with this asset. And I increase my walking speed, disable sprinting.

    In General, I do not understand how to speed up the sound of walking. I change the walking speed itself, but the sound is played at the same speed. I'm a bad programmer and I couldn't find this parameter in the script. Please help me find it, it is very important to me!
     
  14. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hi Sasha,

    As far as I am aware, I do not think you can change the speed of a Sound in RFPSP itself.

    I guess you would have to edit the sound sped in an audio editor such as Audacity which you should be a ble to get from the internet for Free.

    Or find a walking sound that was originally recorded at a faster speed.

    I dont think Unity itself can change the speed either, but perhaps there may be an asset at the Asset store that may help?

    Regards

    Peter
     
  15. SashaNyashaa

    SashaNyashaa

    Joined:
    Jul 31, 2015
    Posts:
    3
    Hi Peter!

    The fact is that while running, the sound of footsteps is played more often. I was more likely referring to the frequency of playback steps.
    For example: We are walking at a normal pace and we have 2 steps per second. We are running and we have 4 steps per second.

    I need to have 4 steps per second during a normal step.

    Sasha
     
  16. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hi Sasha,

    Yes Timing of Footstep sounds is difficult to affect I agree. Not sure if any of the settings for walk/walk animation speed and so on would help much. The only way as I suggested I would know to be sure is to take a walk sound and edit in an audio software so that it plays 4 steps in one second or whatever you need but that would be affected by the characters settings for the aforementioned walk speed and other things in game :)
     
  17. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hi everyone,

    Anyone else come across this issue and have a solution..............

    A short while ago I discovered that the RFPSP player crouch no longer works correctly..........

    The player can crouch but then can no longer get back to a standing position when the ctrl key is pressed a second time? :) so I have to exit game! or turn off crouching..........

    I thought that perhaps Unity or an added asset/script might have changed my Player input settings but I cant see anything changed there.........

    Then today I noticed that my Player "Prone" key behaves in the same manner? if I go prone I cant get up again :)....

    Seems like a Unity thing to me but I may be completely wrong there.

    Very frustrating as I have no real idea where the issue might lie and where to look for a solution except "Everywhere" :)

    EDIT UPDATE

    OK I fixed this. Was something I had done and nothing to do with Unity or RFPSP so no worries.....

    Back on track now to get a demo level done as soon as I an able :)


    Thanks for any help.

    Regards to all

    Peter
     
    Last edited: Jun 29, 2020
  18. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    53
    @TonyLi Hey I just wanted to ask something about the saver. So I have Sections of the map that I turn on and off with triggers and I have a Active Savers on the object that holds them. So the first time I save It'll save the sections in their last state they were in (on or off) but the second time that im in a different section besides the beginning when I load I fall through the world.
     
  19. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    53
    @TonyLi Never mind it might have been because I had the savers set to restore on start.
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    @TheChairMaster64 - Also make sure the Active Saver components are not on the inactive GameObjects themselves if the GameObjects start inactive in the scene (i.e., you deactivated them at design time).
     
  21. canaljuegos32

    canaljuegos32

    Joined:
    Jun 29, 2015
    Posts:
    56
    Any working inventory for Realistic fps prefab? Tried all old files i have, the invpro integration JIMBO did, it dosent work and with s-inventory + dialogue system i get namespace S_Inventory errors. I would pay for a working one with rfps 1.45 and latest unity 2017
     
  22. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    53
    @TonyLi Sooooo new problem... Some reason the fps saver doesnt seem to be saving inventory across scenes.
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    I just opened a project with RFPSP, Dialogue System, and S-Inventory. There are no namespace issues, and it plays fine. S-Inventory is in the namespace S_Inventory, and the Dialogue System is in the namespace PixelCrushers.DialogueSystem. If the namespace errors are with your own code, I recommend putting your code in its own namespace.

    Do the demo scenes work correctly?

    Is the FPS Saver's Save Across Scene Changes checkbox ticked? And do the FPS Saver components use the same Key in all scenes?

    Are you changing scenes using a Scene Portal, SaveSystemMethods.LoadScene, SaveSystem.LoadScene(), or Dialogue System LoadLevel() sequencer command?

    Are there any errors or warnings when changing scenes?
     
  24. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,012
    You can message me if you need help with S-inventory and RFPS. I have Tony's integration working nicely.
     
    TonyLi likes this.
  25. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    53
    @TonyLi It works in my other projects. The other save options work just fine. The only thing i can think that may effect it is probably because I havent added "RFPS_1_2" is the settings but when I do that i get:


    Assets/Pixel Crushers/Save System for RFPSP/Scripts/FPSPlayerSaver.cs(266,50): error CS1061: Type `FPSPlayer' does not contain a definition for `thirstGuiObjInstance' and no extension method `thirstGuiObjInstance' of type `FPSPlayer' could be found (are you missing a using directive or an assembly reference?)

    Everything else works fine besides the portal. It takes me but doesn't save inventory. I do have save across scenes checked. Honestly its not to big of a deal ill probably just give the player some ammo since its the last area.
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    Is the FPS Saver's Key the same in the previous scene and the new scene?

    What version of RFPSP are you using?
     
  27. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hi Everyone,

    I have opened a new thread in the Unity Forums for my Game project Legends and Heros made with RFPS and Unity V 2020+ which has a playable Two Level Game Demo if anyone would like to play it and have a bit of fun :)

    Just so you know the Game contains violence and blood.

    Thanks to everyone here who has helped me make this possible.

    Legends and Heros 2020-07-28 18-21-33-851.jpg

    The WIP Forum thread is here :

    https://forum.unity.com/threads/legends-and-heros-working-title-action-adventure.942876/

    Hope you are all well and busy.

    I have just ported my other Shooter project to Unity 2020 so will have a look again at that and maybe another Game Demo will follow for that later.

    Regards to all.

    Peter
     
    TonyLi likes this.
  28. leandrovtd

    leandrovtd

    Joined:
    Mar 8, 2017
    Posts:
    12
    Hey guys,

    Someone using RFPSP in Unity version 2019.4? Is it running smoothly?
     
    SickaGamer likes this.
  29. vertexx

    vertexx

    Joined:
    Mar 18, 2014
    Posts:
    95
    Violence AND blood !! Sounds super cool to me.
    Great work,Petercoleman. good posts too and remarkable feedback from the Dev !!
     
  30. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Hi vertexx,

    Ay - this part of the game is all about battling so a lot of blood when in the thick of it :) Much of the game though is more serene and peaceful :)

    Legends and Heros 2020-07-30 13-19-05-057.jpg
    In the thick of it

    KingsRealm.jpg
    Tranquill

    Regards

    Peter
     
    Bioman75 likes this.
  31. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    53
    @TonyLi Im using rfps 1.43. And my game is no longer able to save at all. When I do it sends me back where the level started.
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    Can you roll back your changes in version control to the point where everything was working? Alternatively, compare your setup to the included demo scenes.
     
    OZAV likes this.
  33. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    53
    Sadly I didnt think about version control and do not have a previous version. But I went into a different scene that has a different fps controller and tested if it could load a checkpoint in the scene it currently was in and it could. The problem is either within the first scene itself or the fps controller in the first scene which is odd.
     
  34. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    53
    So I went into the first scene and it doesn't seem like the save system is spawning into the map on start like it should. It still spawns in other scenes though.
     

    Attached Files:

  35. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    53
    @TonyLi Okay so a certain object had a save component on it that stopped the editor making a save system itself so I got rid of that. Now it does spawn in but im unable to search for it in the hierarchy but if I go into the the hierarchy and go to the dont destroy on load it appears. In the other scene I can just search for it. It still isnt saving after all of this. I may have to use the character in the other scene but I feel like theres something small im missing
     
  36. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    53
    @TonyLi Im so dumbbbbb... Im sorry lol I turned off the Player Character Model in the Fps Controllers drop down menu because I wanted to have no way of entering 3rd person. But i forgot I could just disable the input for that :eek:

    Thanks for trying to help me though it means a lot! I cant believe it was something so small.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    I'm glad you found the issue. That's the important thing! :)
     
  38. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    JamesArndt, OZAV and C_Occlusion like this.
  39. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    223
    Heres another. A video from the Game Demo : Legends and Heros - Haydins Field

    Demo Video Link :


    Have fun

    Peter
     
    OZAV, C_Occlusion and TonyLi like this.
  40. canaljuegos32

    canaljuegos32

    Joined:
    Jun 29, 2015
    Posts:
    56
    Its posible to use the bullet prefabs from tactical shooter AI in the RFPS player weapons? So each weapon have a different tracer and effect for magic or sci fi weapons. Or a way each player weapon spawns a particle as a bullet?
     
  41. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    198

    Tracers are editable in the RFPS scripts, you can use bullet tracer effects from TSAI, but we for our vote here would not recommend using the TSAI bullets themselves completely for RFPS player weapons, only if they are fired by TSAI soldiers - at the player :).
     
    Last edited: Sep 13, 2020
  42. nextage575

    nextage575

    Joined:
    Nov 4, 2019
    Posts:
    18
    Hello everyone, i need a lil help, i have assigned faction Num =1 to my campanion, but NPC 2 is not shooting towards my companion, how to fix it?
     
  43. leandrovtd

    leandrovtd

    Joined:
    Mar 8, 2017
    Posts:
    12
    Hi guys,

    Could anyone tell me how to change the rotation of the FPS Player by code?

    I can change the position of the Player, but the rotation does not work:

    Code (CSharp):
    1. FPSPlayerComponent.transform.position = playerPosition[positionIndex].transform.position;
    2. FPSPlayerComponent.transform.rotation  = Quaternion.Euler(playerPosition[positionIndex].transform.rotation.x, playerPosition[positionIndex].transform.rotation.y, playerPosition[positionIndex].transform.rotation.z);
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    @leandrovtd - Use the MovePlayerAndCamera component. It lets you tell RFPSP to release control of rotation so you can change it. It has several utility methods. Examine the comments in the script.
     
    leandrovtd likes this.
  45. leandrovtd

    leandrovtd

    Joined:
    Mar 8, 2017
    Posts:
    12
    That was exactly what I needed. Thank you so much!
     
    TonyLi likes this.
  46. amansweb

    amansweb

    Joined:
    Dec 20, 2017
    Posts:
    6
    Yes
     
    leandrovtd likes this.
  47. amansweb

    amansweb

    Joined:
    Dec 20, 2017
    Posts:
    6
    Has anyone tried building an open world/ hub world type game with quests? Tips greatly appreciated .
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,825
    I've worked with various Dialogue System users who have used the Dialogue System with RFPSP for open world games since it does conversations and quests. For the most part, I believe they used the Dialogue System's ScenePortal component to change between scenes (for simplicity) instead of streaming pieces of the world in and out. But you could always use something like SECTR Stream to stream the world, too.
     
  49. leandrovtd

    leandrovtd

    Joined:
    Mar 8, 2017
    Posts:
    12
    Thanks for reply! :):):)
     
  50. bluesixteen

    bluesixteen

    Joined:
    Nov 17, 2016
    Posts:
    23
    Hey guys, I've added a couple weapons but there's a huge problem. When I enter to the play mode, the arm/gun position appears correctly at start. However, after some time, the arm/gun position slowly goes down / left / right for a reason I couldn't understand. Any idea why?


     
unityunity