Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Realistic FPS Prefab [RELEASED]

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

  1. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    i tihnk the way this was done is using box colliders, you may need to do this, when crouched disable box collider 1 (standing up) and enable collider2 (crouched size collider)
     
  2. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Hey Again!
    Just have a quick suggestion or if you guys are already working on it but animal A.I like deer, bears, birds, etc would be an awesome feature. Maybe adding it with a hunting aspect? :D
    Anyway I just thought that would be really cool!
     
  3. x_african_warrior_x

    x_african_warrior_x

    Joined:
    Jun 24, 2014
    Posts:
    80
    RealSoftGames likes this.
  4. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    im having some issues with the Zombie AI, how can i use my own zombies, also add small random walking feature and make the enemy deal damage to my player?
     
  5. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    does anyone know how to integrate with ngui? and/or energy toolkit? thanx
     
  6. Salazar-Aguilar

    Salazar-Aguilar

    Joined:
    Feb 10, 2014
    Posts:
    21
    I
    I think that the idea of RFPS prefab package is that you buy the tools to make that kind of game, the "aspect" of the kit is generic because is only like for showcase purposes, the theme ideas that you have are yours, and you have to make yourself your "hunting aspect" because Azuline Studios can't make a complete game for everyone. For the animal AI you can simply made 3d models of the animals with Idle animations, and place those models in your map, and for the bears you can use the zombie AI so when you walk close to the bears they start to chasse you and then hit you until you can scape. You only need the 3d bear model with idle, run and attack animations.
     
    TonyLi likes this.
  7. KingofMk98

    KingofMk98

    Joined:
    Oct 10, 2013
    Posts:
    63
    Yep, its called having basic scripting knowledge.
     
    Salazar-Aguilar likes this.
  8. radar089

    radar089

    Joined:
    Jan 2, 2014
    Posts:
    216
    hi i was wondering if anyone knew how to solve an issue im having. i have made a sledgehammer and it destroys walls.
    all of the walls are rigidbody and stacked to make bigger walls. so the walls all fall if you break one out form under. with some partical effects for smoke and loose brick chunks that are dropped from the walls. then these bricks and smoke are deleted with removebody script.

    the problem im having is if i jump onto a fallen wall i am frozen. i can look but not move...
    ill add a screenshot.
     

    Attached Files:

  9. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    453
    Hello,
    You just need to change the Layer for your wall, WorldCollision.
     
  10. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    i had this issue once with an asset i brought, couldnt move on large rocks or slipperly Mud slopes, i fixed it by changing the layer
     
  11. radar089

    radar089

    Joined:
    Jan 2, 2014
    Posts:
    216
    its always something right under your nose isnt it lol.... thanks guys
     
  12. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hello guy's !

    i have a problem with my new NPC :€

    I have imported my rigged model on unity :

    Rig is Legacy
    All animation are created :

    - idle = loop
    - run = loop
    - walk = loop
    - die = default
    - shoot = once

    Animation work's good with animation window.

    But in game animation don't play --'

    I have take the ZOMBIE NPC and i have replace the zombie model by my model, the animation of the animation component is animation of my new model.

    Screen :



    Any idea please ?

    Thanck you

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

    Problem is resovle :D

    I have paste all script on my model and all work's :)
     
    Last edited: Oct 19, 2014
  13. clawd31

    clawd31

    Joined:
    Aug 5, 2013
    Posts:
    26
    Hello, I have a problem with zombies and soldiers when they patrol, I have fps drops. On the profiler, the script 'MoveNext' (waypoints) take up 80 of my CPU! (see image) How can I fix this? I have about 18 zombies and 11 soldiers patrolling. When I disable scripts, I have 120FPS , otherwise I have 30-40 fps ... Help, please :)
     

    Attached Files:

    • FPS.jpg
      FPS.jpg
      File size:
      772.6 KB
      Views:
      867
    Last edited: Oct 19, 2014
  14. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    453
    How much Zombies and soldiers use AI ? , I ask you that, because I see 130Calls.
     
  15. clawd31

    clawd31

    Joined:
    Aug 5, 2013
    Posts:
    26
    18 Zombies and 11 soldiers
     
  16. neonille

    neonille

    Joined:
    Oct 4, 2013
    Posts:
    1
    When i add the player prefab to a new scene and then pick up the gun, the weapon bobing when i walk is ridiculous, it sways up and down like crazy .....why??

    Ohh and how can i change the distance from when i can pickup items?
     
    Last edited: Oct 24, 2014
  17. Deleted User

    Deleted User

    Guest

    Hey guys, sorry again for the delay in responses, been dealing with some IRL things. Work is still underway on the Realistic FPS Prefab with some nice features planned for future updates.

    Hi aquilinajake, an editable GUI will probably happen sometime next year, as we are working on some AI and gameplay related features first.


    The weapon raycast's origin is the position of the camera by default, this means that the projectile is always firing from the center of the camera, with some random accuracy calculations. This is a classic/traditional/quake/doom type way of handling weapon firing. If you want to change this, you can make some edits around line 1021 of WeaponBehavior.cs in the FireOneShot() function and change the origin of the weapon raycast to the muzzle position of the weapon. We may make these changes as well for a future version.


    Those NPC behaviors should be possible with the next update aquilinajake. As far as updating a current project where you have added new weapons, it shouldn't be a problem if you have duplicated the main player prefab and made your edits to the new object. When you import a new version, you will have the option to overwrite the default scripts and objects, which is recommended. This way, the scripts on your custom player prefab will be updated, but your changes/additions to weapon objects will be maintained. You still might need to check the structure of the new player prefab that was imported to see if there are any new objects or significant changes made that you would need to make to your custom player prefab to avoid any missed references in the scripts. As always, you can contact us if you run into any issues with this.


    A peaceful faction that runs when attacked and a friendly faction that turns hostile when repeatedly attacked are good ideas, stickleZ. We're working on implementing them for the next update.


    Hi llJIMBOBll, you might need to make some edits to either InputControl.cs or FPSRigidBodyWalker.cs to bypass player movement input when the inventory window is active. Please let us know if you need help making these edits.


    Thanks eridani, in the new update, the NPC AI is able to acquire new targets if the current target is out of range or is eliminated.

    Locational damage is not yet supported, but is something we have considered and would be fairly straightforward to implement. This would involve removing the current ragdoll instantiation method when the NPC dies, and animating the actual ragdoll model when the NPC is active (with character joints deactivated) and using the body part colliders for hit detection, which would be very accurate, but the colliders would need to be monitored, or communicate to the CharacterDamage.cs script when hit, instead of that script just using one large capsule collider for hit detection.

    The AI cannot use ladders yet, but we will always be looking for ways like this to make the AI smarter in future updates. Thanks for the feedback!


    Once the next AI update has been released, we plan on making a new tutorial video that covers the process of adding a new NPC and the new AI features, radar089. Thanks for your patience.


    Currently the new NPC objects are instantiated in one place in the wave manager script, but we are definitely looking into implementing object pooling for NPCs, weapon shells, and when implemented, weapon projectiles. Thanks for your feedback eridani.


    Do you see the actual impact on the object at long range, but nothing else happens (like a barrel exploding), or is it just difficult to hit an object at long range, aquilinajake? If the issue is related to not being able to hit objects at long range, you could try reducing the recoil and inaccuracy vars in the WeaponBehavior.cs script component. We will also check to see if there is anything else that might be limiting the maximum range in the scripts. Hope that helps.


    Thanks Saturn Ent, you might want to try deactivating the WorldRecenter.cs component of the FPS Player object if it is causing alignment issues and you have set the static objects to layer 10, the World Collision layer, and they are becoming misaligned. The WorldRecenter.cs script moves all scene objects to the origin to minimize floating point precision loss, which can cause object jittering at distances further from the scene origin. Hope that helps.


    By default, pressing the jump key while crouched causes the player to get up from crouching, but it should be possible to change this behavior in FPSRigidBodyWalker.cs. We'll have a look at making this customizable, eridani.


    Great work, x_african_warrior_x! Grenades & weapon projectiles are one of the first features we will be working on after the next update.


    Hi clawd31, in the situation you described with the performance issue using a larger number of patrolling NPCS, could you also share the number of waypoints that the NPCs are set to patrol? If there are a large number of waypoints, this might be causing the issue because each waypoint has its own script. This is not optimal with a large number of waypoints and NPCs and we haven't really done much testing with this kind of scene setup. We will definitely be looking into optimizing the AI patrolling behavior for the next update. Thanks for bringing this to our attention.


    It sounds like there might be a configuration issue with the player bobbing amounts, neonille. Are there any errors or warnings displayed in the console? In the IronSights.cs script component of the FPS Player object in the inspector, is the Walk Horizontal Bob Amount set to 0.11 and the Walk Vertical Bob Amount set to 0.075 (the default settings)? If so, you might want to try re-downloading the package from the asset store and/or creating a new, empty project and importing the Realistic FPS Prefab to see if the package was being imported correctly.

    You can change the item pickup distance by changing the "2.1f + FPSWalkerComponent.playerHeightMod" amount around line 511 in the item pickup raycast check in FPSPlayer.cs. This will be made to a customizable value from the inspector in the next version as well. Hope that helps.
     
    x_african_warrior_x likes this.
  18. x_african_warrior_x

    x_african_warrior_x

    Joined:
    Jun 24, 2014
    Posts:
    80
    Thanx, that means a lot. i have just updated the game and im having problems uncrouching under obvious places. for example in the weplayer demo, when capturing the petrol station, if you crouch at the center of the petrol station. you cannot uncrouch until you move a considerable distance into the road(terrain). Other that that, i envy how you manage to name and comment so well in your code.
     
  19. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    thank you very much for all the replies.
     
  20. clawd31

    clawd31

    Joined:
    Aug 5, 2013
    Posts:
    26
    Hello, I have 25 waypoints on my scene (see pictures). Thanks :)
     

    Attached Files:

  21. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    Hi,
    I've got a gameobject that I want to recognise that it was hit by the rays casted from RPFS gun, and then have the ability just to add in my own custom function of what I want to happen when it get's hit.

    Would also be interesting if information about the gun/type distance was available too.
     
  22. x_african_warrior_x

    x_african_warrior_x

    Joined:
    Jun 24, 2014
    Posts:
    80
    you can edit weaponbehavior.cs
    edit this method void HitObject ( RaycastHit hit, Vector3 direction ) on line 1023
     
  23. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Can we expect a feature where ALL the A.I NPC's attack each other, Like have the soldier NPC shoot at the zombies or robots! Thought that would be a cool idea :D
     
  24. thenamesace

    thenamesace

    Joined:
    Jan 25, 2014
    Posts:
    157
    Anyone point me in the right direction to get head-shots working?
     
    RealSoftGames likes this.
  25. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Azuline work on this with the faction system ;)
     
  26. Infiniteno

    Infiniteno

    Joined:
    May 11, 2014
    Posts:
    11
    You're going to need seperate hit boxes for both the body and the head. Then you just need to write a function that checks which hit box was shot in whichever script handles bullet logic/player health. I've only worked with UFPS so unfortunately I cannot give you any snippets of code that will help.
     
  27. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    Hello again @Azuline Studios ! i have a question about a glitch!
    in 1.22b demo scene i see enemy can walk trough fences! The question is : its fixed ? ._.
    Thanks
     
  28. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hey all !!!

    I have a big news about animation !

    So i know somebody are a probleme with animation because :

    RFPS don't take animation controller, only single anim.

    So i have find this : LINK

    This tool convert the animation selected for the model selected :D

    And i can confirm, that work's !!!! :D

    You don't need animation controller now !
     
    thenamesace likes this.
  29. yummybrainz

    yummybrainz

    Joined:
    Jan 14, 2014
    Posts:
    69
    Has anyone had any luck integrating Realistic FPS with EasyTouch for mobile? I'm having some difficulties assigning the joysticks to the input. I was previously using ControlFreaks which worked ok but does not support NGUI, which I need for this game.

    It looks like you can adjust what is controlling the input through the InputControls.cs file. I just need to know which of these I have to disable to have EasyTouch joysticks give the X and Y axis.

    It also appears that clicking anywhere on the mobile screen fires and looks in that direction. So I will need to figure out a way to disable that on mobile.

    Sneak peak of what I am working on. Think Night Of the Living Dead :)

    Cheers!
     
    Defcon44 likes this.
  30. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Hey does anyone know the release date for the next update on this asset! Or a close release date?
     
  31. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Sorry i can't help you :(

    But you'r game a re really good !
    Very good work's !

    Are you a release date ?
     
  32. clawd31

    clawd31

    Joined:
    Aug 5, 2013
    Posts:
    26
    Please, can someone help me? My game is unplayable :/ only 10-30fps on a gtx titan... (AI Patrol)
     
  33. yummybrainz

    yummybrainz

    Joined:
    Jan 14, 2014
    Posts:
    69
    Thanks! Hopefully within the next couple of weeks I will release an early alpha ;)

    I would like to get some feedback before I add too much more to it. So this will be a one level map with a store to purchase those weapons from zombie kills. I also have some additional melee weapons to add, just in case the zeds get in the house :D
     
    Defcon44 likes this.
  34. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    Planning optimization for 2011 line Smartphones ? (512MB ram)
     
  35. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    453
    I used RFPS for my Game Virus Infection 2 and that works fine on 512Mo devices, you must replace Unity Terrain by T4M, and reduce soldier's polygon.
     
  36. yummybrainz

    yummybrainz

    Joined:
    Jan 14, 2014
    Posts:
    69
    I typically do not focus on the older devices since most people have newer ones than my own. With the release of iPhone 6 and many new androids there isnt really a need to downgrade the game for a small minority.
     
  37. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Does anyone have stats of the type of phone hardware currently in use "in the wild" ? It would be nice to have hard statistics such as "in October 2014, only 15% of game players were using phones made in 2011 and earlier." It would make me feel better to see exactly how many people I may be losing, or catering to. Thanks anyone
     
  38. Infiniteno

    Infiniteno

    Joined:
    May 11, 2014
    Posts:
    11
    You should go buy the best phone you can find without a contract for around $100 and build so that your game will work on it. - Imo
     
  39. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Thanks Infiniteno. I already do that sometimes actually (I have old phones on hand just to test on). I guess I'm saying it would be nice to see exactly what percentage of people I am catering to by using certain phones as baselines, and whether or not it's worth that percentage. Or to forget the $100 phone people and make a better looking game. The tradeoff factor I guess.
     
    RealSoftGames likes this.
  40. Infiniteno

    Infiniteno

    Joined:
    May 11, 2014
    Posts:
    11
    Yes its always a trade off on anything but a console situation. Id target the larger audience because games like CS are far less impressive visually and still OWN the gaming market by KEEPING people playing.
     
  41. yummybrainz

    yummybrainz

    Joined:
    Jan 14, 2014
    Posts:
    69
    For Azuline,

    Essentially what I need to figure out is how to block the touch events thinking its a mouse click on mobile. It appears that in InputControls there is a place where I need to override the mouse position and press if on mobile.

    Cheers!
     
  42. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Hey Azuline Studios!
    For this asset in future updates can we expect multiplayer support with photon or multionline? Because right now trying to setup this asset with multiplayer is not going so well! And if multiplayer implementation is a planned feature when can we expect to see it added? That's all i want to know
    Anyway, Thank you for the great asset! You guys are the best FPS asset on the asset store at the moment!

    Thanks again!
     
  43. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    i dont think it would be that hard to implement Bolt with RFPS, i havent done so yet but was one of my plans to do so, maybe stick with the more secure Multiplayer platforms, Multionline doesn't offer any protection as the player is the host. making it extremely easy to hack your game. i was originally going to use multiOnline, then found all these flaws.
     
    Last edited: Nov 14, 2014
    RealAspireGames likes this.
  44. KarloE

    KarloE

    Joined:
    Aug 26, 2013
    Posts:
    175
    Hey guys,

    so I have a problem. Once I change the terrain layer, my player just falls through the terrain. Even if I set the clip mask on FPSRigidBodyWalker to Terrain layer (which is a layer that contains my terrain), it still falls through it.

    How to fix that? It is crucial for my project for terrain to be in a non-default layer.

    Hre is my layer collision matrix: http://prntscr.com/56em1e

    Thanks a lot.
     
  45. clawd31

    clawd31

    Joined:
    Aug 5, 2013
    Posts:
    26
    I still have not find a way to solve my problem: /
     
  46. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    1: Your Mesh objects are well optimized ?
    2: Many running animations can do this problem. (%90)
    3: Put some fog, reduce line of sight and reduce objects.
     
  47. clawd31

    clawd31

    Joined:
    Aug 5, 2013
    Posts:
    26
    The fps are low because of the AI Patrol and waypoints but I don't know how can I optimize it :/
     
  48. Infiniteno

    Infiniteno

    Joined:
    May 11, 2014
    Posts:
    11
    Have you built it? Or are you testing in the editor? Also are you using the in editor FPS counter? I highly doubt the AI patrol script is actually your problem when my GTX 760 screams out a ton of fps on the demo. An alternative would be to either test the build on another pc or replace your ai solution all together if youre sure thats the problem. As Takahama said, running lots of legacy animations will wreck your fps so I suggest you try some of the dynamic OC solutions around the asset store.
     
  49. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    May I ask how you made the NPC's attack each other in RPFS? Thank you
     
  50. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hey all !

    Anybody can be tell me how i can " move " the HUD ?

    Because i can't do it, that don't work with me :s

    And, any one can be tell me how i can add a FPS GUI ?

    Thanck's