Search Unity

UFPS : Ultimate FPS [ RELEASED ]

Discussion in 'Assets and Asset Store' started by VisionPunk, Mar 9, 2012.

Thread Status:
Not open for further replies.
  1. azeitler

    azeitler

    Joined:
    May 14, 2008
    Posts:
    161
    I tried opening the TestLevel and the SimpleScene as well as dropping the FPSPlayer in an empty level with only one cube as a ground floor. Same results. Running Unity Pro 3.5.3 on Mac OS 10.7.
     
    Last edited: Jul 17, 2012
  2. rumburak

    rumburak

    Joined:
    Oct 4, 2010
    Posts:
    2
    Hi, I'm a bit confused by the code of these scripts. It seems to me that the motor acceleration is just some random value that has nothing to do with real life physics. Is that right? I would like to move, let's say 1.5 metres per second (1 unit = 1 meter). How can I do this within these scripts?

    Secondary question, what are the following constants?
    Code (csharp):
    1. m_Delta = Time.deltaTime * 60f;
    What is 60.0f?
    Code (csharp):
    1. this.MotorAcceleration * 0.1f
    0.1f?

    Could you please enlighten me a bit? ;)

    Thanks
     
  3. Wrekk

    Wrekk

    Joined:
    Jul 16, 2012
    Posts:
    51
    I want to highlight an object when it is mouse overed, and I know it is using Screen.lockCursor. But when I tried without the FPS Camera attached, it worked without the object flickering.
    I change the material of the object.
    I use Windows 7 Ultimate, and yes, I use Unity Pro.

    Thanks for helping me out with this. :)

    EDIT:
    By the way, when I change something in the inspector (anything in the FPSCamera, FPSWeapon, FPSShooter and FPSController) it changes back when I hit play, and it stays this way even after I stop it.
     
    Last edited: Jul 17, 2012
  4. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hey, Warpzone. Yeah you're right - the previous code would check if the shooter was null, but a null weapon would still crash it. Sorted now!
    How's your game coming along BTW? I'm curious :)

    Thanks

    /Cal
     
  5. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hmm,
    I have gotten reports that the asset doesn't work well with Unity Pro and Image Effects, and I'm working on a fix for the next update.

    But your error still seems strange. I think I need to reproduce it to understand what it's about. Would you mind exporting a simple scene such as the one with the cube that you described, with the faulty FPSPlayer and send it to me?
     
    Last edited: Sep 7, 2012
  6. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hello rumburak. It has absolutely nothing to do with real life physics, that's exactly right. It's just designed for allowing great versatility in terms of acceleration and friction combos (see the manual on page 14 for more info on the controller parameters).

    The player prefab uses a regular Unity CharacterController, so you can get its speed by checking the controller's velocity.magnitude, and then tweak the acceleration and damping until you get the max speed and friction "feel" you're after. You can do everything from super fast and slidy Doom guy physics to controlled human locomotion for military simulation.

    "60.0f" is explained in the comment at line 73 of vp_FPSController (if not, you may be using a very old version of the code base and may want to update). "0.1f" is an adjustment to get the acceleration variable within a more workable editor range. Nothing to worry about.
     
    Last edited: Jul 17, 2012
  7. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Ok, as you may have read above there is an issue with Ultimate FPS Camera and image effects in Unity Pro. I'm hoping to have a fix out for this in a matter of days.

    Yeah, this is not a bug, just a confusing design, which will also be fixed soon. Check out this post for an explanation.

    No problem, you gave me your hard earned money and I want the asset to work for you! :)
     
    Last edited: Jul 17, 2012
  8. Wrekk

    Wrekk

    Joined:
    Jul 16, 2012
    Posts:
    51
    It works now! I just downloaded the FPSPlayer2 prefab, and now it highlights perfectly! :D
     
  9. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Sweet :)
     
  10. ImogenPoot

    ImogenPoot

    Joined:
    Jul 2, 2012
    Posts:
    214
    Nice work! This will spare me a lot of work for my game :). Also the Dinosaur camera looks intriguing since I was thinking about including them...
     
  11. azeitler

    azeitler

    Joined:
    May 14, 2008
    Posts:
    161
    I emailed you a bunch of stuff to help you get to the bottom of the issue.
    It's definitely not image effects, I only have your assets in an otherwise empty project.
     
  12. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    @azeitler: Great. I'll look into this.

    To everyone: I currently have very sporadic and poor Internet access on my workstation. Support turnaround times may be a little longer than usual until I get my new hardware. Thanks for your patience.

    /Cal
     
  13. MrBananaDragon

    MrBananaDragon

    Joined:
    Jul 22, 2012
    Posts:
    16
    Hello, I got your assets and they work very well (obviously), and I've been working on a simple reload function. It works somewhat like this:

    I have four variables;

    public int currentAmmo --- This is the current amount of ammunition loaded in the gun.

    public int maxAmmo --- The max amount of ammunition that can be loaded into the gun.

    public int currentExtraAmmo --- The current amount of ammunition NOT loaded into the gun.

    public int maxExtraAmmo --- The max amount of extra ammo.

    Then in the update function, I have 8 simple lines of code that make sure that the current amount of ammo doesn't exceed the maximum, and makes sure that it never goes under zero, stuff like that.

    I then have an if statement that says if a reload input is received, and the currentAmmo is less than the maxAmmo, and your extraAmmo is bigger than zero, than call a Reload function.

    In said function I have a variable I called toBeReloaded, which figures out how much ammo needs to be loaded into the gun, then subtracts that from your extra ammo, and sets your current ammo to the max. If your extra ammo is less than what needs to be loaded, then I just add what there is to your current ammo, and set your extra to zero.

    So that's how it works, I'm not sure if you are already working on an ammo system, if not feel free to use mine. If you don't, I won't be offended. Anyways, the only problem I'm having is that I have to set the variables in the code itself, because they will not appear in the inspector, which is obviously a problem, seeing that I have multiple weapons. If you could help, that would be just awesome.

    /MrBananaDragon
     
  14. Eqric

    Eqric

    Joined:
    Jun 29, 2012
    Posts:
    51
    You have to add the variables to the "editor" file, for example vp_FPSShooterEditor and add:

    m_Component.currentAmmo = EditorGUILayout.IntField("current Ammo", m_Component.currentAmmo);
     
    Last edited: Jul 22, 2012
  15. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    @MrBananaDragon: Thanks for sharing your design. You're right, I have already implemented ammo functionality on the shooter and it works similar to what you describe. Eqric is right about making the variables showing up in the inpsector. All the 'FPS' classes use custom inspectors (present in the 'Editor' folder) and their code can be easily modified to display any new variables you add.
     
  16. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711


    Hi all, here's a progress report on Ultimate FPS Camera v1.3:

    In short, all the new features are done and I'm now in the bugfix phase.

    Features
    • New, "game-ready" FPS player class designed as a starting point for a game or game prototype (replacing "SimpleScript")
    • New advanced state system to blend between multiple presets in a controlled manner (reducing the need for scripting in many cases)
    • New damage handler script to inflict damage on gameobjects and make them respawn with a delay
    • Explosion class with area damage, a shockwave affecting camera shakes + player velocity along with example particle effects
    • Ammo / reload implementation on the shooter
    • A new set of standard presets for the pistol, revolver and machinegun with crouch, run and reload presets
    • Smooth weapon switching code integrated into the camera system
    • Improved crouching logic, shrinking the character controller to allow for climbing through small spaces
    • Presets can now be loaded into memory so you don't have to load them from the resources folder all the time (loading from resources as a methodology is being phased out in favor of loading from text assets, which is better practice)
    • Parameters to limit springs and bob so they don't freak out under extreme velocities
    • Feature to save 'tweaks only' to presets, greatly simplifying the process of creating additive presets
    • Many (if not most) 'private' methods made 'protected' to allow for extending the system without altering the core classes
    • A bunch of new sounds and particle effects
    • Demo walkthrough level enhanced with some of the new features
    • 'SimpleScene' visually improved

    Some of the bugfixes done so far
    • The new preset state system implementation is designed to be more forgiving to beginners (e.g. not resetting component changes upon play)
    • Weapon sounds no longer cut off when switching weapons after just firing a shot
    • Fix to allow for not using decals (i.e. on mobile)
    • Jump force range increased in the controller editor

    Left to do
    • Delve into image effects issues on unity pro
    • Fix a number of minor bugs
    • Update all the documentation
    • Build process
    • Submit to Asset Store

    Even though there's clearly a few more days left on this, as you can see the bulk of the work is done :)

    Cheers

    /Cal
     
    Last edited: Jul 22, 2012
  17. MrBananaDragon

    MrBananaDragon

    Joined:
    Jul 22, 2012
    Posts:
    16
    Thanks a bunch, this was driving me crazy!
     
  18. cssm

    cssm

    Joined:
    Jul 3, 2012
    Posts:
    4
    Hi VisionPunk, your product is great, but i have a problem. 4 (!!!) weeks ago smerf1 described the same problem. Is where a quick fix to it?
    Have a basic scene with a cube as a floor. Drag into it a FPSprefab and ALL seems to work beautifully. OKEY! After that i save the scene, save project, reload scene (or open some another one and open it back again, does'nt matter) and i see three (one per weapon) red errors! WHY?
    Error is:
    NullReferenceException: Object reference not set to an instance of an object
    vp_FPSShooter.Awake () (at Assets/UltimateFPSCamera/vp_FPSShooter.cs
    at line:
    m_MuzzleFlash = (GameObject)Object.Instantiate(MuzzleFlashPrefab,m_Camera.transform.position,m_Camera.transform.rotation);
    OKEY! Lets see in inspector under weapon FPSShooter section: muzzleflash is correctly set up and everything seems like default. Im so so sooooo confused about this.
     
  19. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    I could be an issue with a custom editor that is creating objects that are not preserved when moving between scenes in the editor.
     
  20. cssm

    cssm

    Joined:
    Jul 3, 2012
    Posts:
    4
    Do not sure what the custom editor is, but the problem is still here..
     
  21. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi cssm,

    I'll try to get to the bottom of this for you! It's great that you provided the error output, however the line number of the crash is missing. If you could additionally provide the exact line of the crash(es) it will help me to find the problem faster.

    BTW, I'm not sure you are experiencing the exact same issue as smerf1 (he didn't get any red errors).

    /Cal
     
  22. kevdotbadger

    kevdotbadger

    Joined:
    Sep 13, 2011
    Posts:
    82
    Looks like the error i was having a few months ago. Some objects not instantiating before they are called, marking them as null.
     
  23. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    @kev: Yeah, that's right! I completely forgot. Thanks man!

    @cssm... have you upgraded to version 1.21 yet? If not. Go to the Asset Store, upgrade and try again.
    I addressed an issue exactly like yours in that release. The release notes can be found here:
    http://www.visionpunk.com/products/ufpsc/ReleaseNotes1.21.pdf

    /Cal
     
    Last edited: Jul 24, 2012
  24. cssm

    cssm

    Joined:
    Jul 3, 2012
    Posts:
    4
    VisionPunk thanks!
     
  25. seppukustl

    seppukustl

    Joined:
    Jul 23, 2012
    Posts:
    7
    So for some reason upon zooming (or at least clicking the mouse 2 button my model spins and ends up at a 90 degree angle? o_O I have no idea how to fix this, i've tried everything /:

    other than that amazing product. :)
     
  26. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi, seppukustl. Ok, a few questions:

    • What scene are you working in; DemoLevel, SimpleScene or a scene of your own?
    • Are you using the FPSPlayer prefab?
    • Are you using the latest version of Ultimate FPS Camera (v1.21) ?
     
  27. seppukustl

    seppukustl

    Joined:
    Jul 23, 2012
    Posts:
    7
    Thanks for the quick reply!! True customer service right there :)

    And to answer your questions:

    I'm working in my own scene, just a simple floor and cube for tweaking the parameters.

    Yes I am using the FPSPlayer prefab with simple script at the moment to get used to everything, is that where I went wrong for importing my own models?

    And yep just bought it yesterday :) (unless an update has come out since that I am not aware of)

    I can send some screen shots if that will help? just a simple before and after zoom screenshot.
     
  28. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    No, that shouldn't be a problem. It sounds like you've done it right.

    Actually, the easiest way for me to solve it would probably be if you package this simple project and send it to me with your custom model in the prefab.
     
    Last edited: Sep 7, 2012
  29. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    Hello!

    Thank you for your great product.
    There's a couple of things I need to implement in order to migrate from my old self-made fps system.

    Could you give me some feedback on best ways to add them to UltimateFPSCamera?

    The things are:
    1. crawl state and sprint state.
    2. camera recoil (player shoots a bullet and camera rotates vertically and horizontally) with a limit for vertical rotation
    3. removing "idle" hand shaking (as in mafia boss) when player aims

    how should I approach doing that?

    thanks,
    Slav
     
    Last edited: Jul 26, 2012
  30. seppukustl

    seppukustl

    Joined:
    Jul 23, 2012
    Posts:
    7
    Alright I'll do that :) Thanks!
     
  31. jeffadkins51

    jeffadkins51

    Joined:
    Jul 17, 2012
    Posts:
    1
    Hey if you could drop the price down to like $20 as a discount / promotional offer, I'd buy it for sure! Just a few bucks short ;L Looks good though!
    And does it come ready to play basically with a scene setup and all that good stuff ?
    Get back to me as soon as possible, thanks!
     
  32. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hello the_gnoblin. Let's see.. The way to do this currently is to tweak the crawl and sprint states in the inspector at runtime and save controller and camera presets to disk. There is already a crouch preset in the demo, so you would just need to create a sprint state by modifying the speed of a controller preset and maybe tweak a nice camera preset for it too. Your player script can then load these onto the components when the user presses a button. The manual describes this in detail on pages 13 and 41. Note that for some camera settings to take effect after loading a preset, you must call "RefreshSettings" on the camera. I'm currently working tirelessly on an update with vastly improved support for player states (see THIS post, and THIS).

    It is currently only possible to rotate the camera around the z vector (the x and y vectors are bound to the mouselook). This can be done with the camera AddRollForce method. You can also add positional force to the camera using it's AddForce method. Though you could also manipulate the x and y rotation by altering the m_Pitch and m_Yaw members of the camera, as done in the UpdateShakes method. That said, someone requested an additional camera spring for the camera a while back (for allowing things like looking over one's shoulder) and I think this is a good idea for some future update.

    This is very easy. Just zero the camera ShakeSpeed in the preset that gets loaded when you aim.

    Good Luck!

    /Cal
     
  33. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi jeff, The asset will likely be part of a "Hot Deals" sale at some point (it's on the waiting list). Though I have no idea when this might happen, probably not in the immediate future. Yeah everything you see in the trailer and the demo webplayer is included. All the scripts, effects and many neat coding tricks ;)
     
  34. Quickfingers

    Quickfingers

    Joined:
    Aug 29, 2009
    Posts:
    268
    Hey visionpunk, recently bought your asset and am trying it out with some a custom weapon model.

    Is there anyway to have a different or additional offset for when it is zoomed in compared to when its zoomed out?

    I ask because when I set the offset correctly to line up the sights when zoomed in, I don't like the position of it once its zoomed out again.

    Many thanks. It seems like a great asset so far!
     
  35. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi Quickfingers,
    Sure! Just check the player script (SimpleScript.cs if using the FPSPlayer prefab), for the "Zoom" preset text file that gets loaded when you zoom in versus out. The preset should contain the respective weapon position.

    BTW, I checked out your game "Surrender" on Kongregate. Quite awesome :)
     
    Last edited: Jul 31, 2012
  36. Xander-Davis

    Xander-Davis

    Joined:
    Apr 23, 2011
    Posts:
    433
    This looks awesome-- first time seeing it. Buying it now... ! :p
     
  37. smerf123

    smerf123

    Joined:
    Aug 26, 2011
    Posts:
    102
    I'm having some problems setting it up with my own 3D arms. I had done everything in the guide perectly, but for some reason when I hit play in unity, my arms are mile's off from the screen. Does my pivot point for the arms need to be set in a certain place in 3Dmax? I have my pivot point centered on my arms.
     
  38. Quickfingers

    Quickfingers

    Joined:
    Aug 29, 2009
    Posts:
    268
    thanks mate I actually did check that and saw how you'd done it, nice, and easy! Thankyou :)

    I think I may have found a bug though. Setting timescale to 0 (for pausing a game for example) then back to 1 will spam this error to the console :

    transform.rotation assign attempt for 'FPSPlayer' is not valid. Input rotation is { NaN, NaN, NaN, NaN }.
    UnityEngine.Transform:set_rotation(Quaternion)
    vp_FPSCamera:LateUpdate() (at Assets/UltimateFPSCamera/vp_FPSCamera.cs:220)

    Thanks for playing surrender! That was my first, I've done many more, Maybe you should check out Europa Concept http://www.quickfingers.net/portfolio/europa-concept/ :)
    My dodgy fps head bobbing in that game was the reason I purchased your asset!
     
  39. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    There is an offset in the vp_FPSWeapon script that you can change to move them into position.
     
  40. smerf123

    smerf123

    Joined:
    Aug 26, 2011
    Posts:
    102
    I've tried this. But when I move any of the offsets, it moves it in diagonals. Making it quite impossible for me o line up with the camera.
     
  41. Unicron

    Unicron

    Joined:
    Sep 28, 2011
    Posts:
    191
    I'm working on a small personal project but I'm an artist (using playmaker as well) and would like to know if this was pretty straight forward and someone with very little programming experience would be able to get this up and running fairly easy.
     
  42. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Smerf, feel free to make a unitypackage with a simple scene where this problem exists and email it to me. Maybe I can help.

    Cheers

    /Cal
     
    Last edited: Sep 7, 2012
  43. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi Unicron, the asset has been designed to be very easy to use and modify, and it has a very detailed 50 page manual explaining all concepts and functions. There is also a FPS player prefab that you should be able to just drag and drop into any scene to be up and running instantly. Obviously, it depends on how much you want to customize it, but I don't think you'll have any problem just getting started.
     
  44. Quickfingers

    Quickfingers

    Joined:
    Aug 29, 2009
    Posts:
    268
    hey mate, have you had a chance to check out that bug I mentioned in my last post?
    It happens just on the default test scene. If you set the timescale in project settings - time to 0, then back to 1 the script errors and stops responding to input.
     
  45. WillOfTom

    WillOfTom

    Joined:
    Aug 6, 2012
    Posts:
    9
    Hey there, I bought this last night and have so far found it really easy to get into. Great work.

    I just have one question; Is it possible at the moment to add and remove weapons from the player's weapon list once the game's started, say for example picking up a weapon found in the environment and dropping one from the list to pick up the new one. I don't mean the actual act of triggering a pickup and dropping a weapon, but the management of the weapon list to allow for that.

    Thanks!
     
  46. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi,
    I have taken a look at this and yeah it's a bug. Several parts of the system seem to be sensitive to manipulating Time.timeScale. I have a fix for the crash itself but unfortunately when the game is unpaused mouselook is lost. I have no idea why and I have a strong feeling it will take some time to come up with a solid fix, so this bugfix won't make the next update. I'll look deeper into it when I have time. Email me if you want the partial fix in the meantime.
     
    Last edited: Sep 7, 2012
  47. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi AimlessTom,

    The weapon list is intended to contain all the weapons the player will ever be able to carry, and the game code should allow or prevent the player from activating them depending on the inventory state. Inventory code is usually quite different between games, so that's why the implementation is kept basic, allowing every gameplay coder to handle this in the way they see fit. However, in the next verion of Ultimate FPS Camera I have fleshed out this just a little bit so there is atleast placeholder support for allowing or disallowing the call to switch to a particular weapon. I still leave the "real" inventory code to the developer though.

    Hope this answers your question.
     
  48. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I had the same problem but when I set time scale to be .000001 it had no problems.
     
  49. skorpah

    skorpah

    Joined:
    Aug 5, 2012
    Posts:
    3
    i just bought this awsome system.
    and i love it,
    i messed around with it and i got it all to work,

    but. since i dont know anything about programming, im using playmaker.
    and i cant figure out a way to apply dmg to objects in a simple say. anyone can help me out ?
    i tried to add a collision detection to the machinegunbullet prefab. but it didnt react to that. so im kind of lost :p
     
  50. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    @drew: thanks for the tip!
     
Thread Status:
Not open for further replies.
unityunity