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

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,657
    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.
  2. danteswap

    danteswap

    Joined:
    Oct 27, 2013
    Posts:
    164
    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.
  3. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    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!
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,657
    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.
     
  5. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,657
    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.
     
  7. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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
     
  8. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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
     
  9. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,657
    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.
     
  11. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    Hi TonyLi

    Thanks for again kindly for that.

    Peter
     
  12. SashaNyashaa

    SashaNyashaa

    Joined:
    Jul 31, 2015
    Posts:
    6
    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!
     
  13. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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
     
  14. SashaNyashaa

    SashaNyashaa

    Joined:
    Jul 31, 2015
    Posts:
    6
    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
     
  15. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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 :)
     
  16. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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
  17. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    @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.
     
  18. TheChairMaster64

    TheChairMaster64

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

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,657
    @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).
     
  20. canaljuegos32

    canaljuegos32

    Joined:
    Jun 29, 2015
    Posts:
    63
    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
     
  21. TheChairMaster64

    TheChairMaster64

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

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,657
    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?
     
  23. SickaGamer

    SickaGamer

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

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    @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.
     
  25. TonyLi

    TonyLi

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

    What version of RFPSP are you using?
     
  26. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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.
  27. leandrovtd

    leandrovtd

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

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

    vertexx

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

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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.
  30. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    @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.
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,657
    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.
  32. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    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.
     
  33. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    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:

  34. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    @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
     
  35. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    @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.
     
  36. TonyLi

    TonyLi

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

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    JamesArndt, OZAV and C_Occlusion like this.
  38. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    467
    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.
  39. canaljuegos32

    canaljuegos32

    Joined:
    Jun 29, 2015
    Posts:
    63
    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?
     
  40. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    297

    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
  41. nextage575

    nextage575

    Joined:
    Nov 4, 2019
    Posts:
    20
    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?
     
  42. leandrovtd

    leandrovtd

    Joined:
    Mar 8, 2017
    Posts:
    28
    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);
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,657
    @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.
  44. leandrovtd

    leandrovtd

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

    amansweb

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

    amansweb

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

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,657
    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.
     
  48. leandrovtd

    leandrovtd

    Joined:
    Mar 8, 2017
    Posts:
    28
    Thanks for reply! :):):)
     
  49. bluesixteen

    bluesixteen

    Joined:
    Nov 17, 2016
    Posts:
    28
    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?


     
  50. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    I don't see an integration package for S-inventory in version 2.2.11 of the Dialogue System. I wanted to use the S-Inventory/RFPS solution for my inventory problems. Is there an updated integration for S-inventory?