Search Unity

Shooting range - my attempt at exhilarating and immersive first person gunplay

Discussion in 'Works In Progress - Archive' started by TwiiK, Aug 26, 2012.

  1. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Been a while since I posted something that wasn't in the support forum. :)

    Currently I'm working on a first person shooter with no multiplayer, no story, no plot, no enemies, no gimmicks, just shooting, a lot of shooting, and I want to try and do it as good as I possibly can, at least on par with what the AAA games deliver, most which doesn't deliver much in this department at all, but the current benchmark is Battlefield 3.

    Because I've cut everything that's in a normal game I have quite a few advantages over other games when it comes to creating the best possible shooting action. I can put all my resources into higher detail models, more detailed effects, more complex animations and interactions.


    http://twiik.net/content/shooting-range

    Known issues:
    • Tracers get stuck in mid air after passing through walls
    • Tracers look huge and absolutely ugly up close
    • Bullet penetration is unpredictable and there are no decals for exit holes
    • When zoomed in casings eject too close to the camera
    • Leg animation is jerky
    • Footsteps and leg animation isn't properly synced
    • You can run when zoomed in
    • The tonemapping makes everything overbright when you enter the house
    • Weapon and arms clip through the player and geometry
    • Bullet casings can't pass through windows

    Current todo list:
    • Fix known issues
    • Add weapon animations
    • Add additional leg animations
    • Make it possible to crouch
    • Complete my modifications for Dom Clubb's AK47
    • Look at the current version of Ultimate FPS camera and see if there's anything there I want
    • Create new sound effects
    • Make a much more detailed muzzle flash effect
    • Tweak the bullet impact effect and create at least a couple of variants of it
    • Classify the current impact effect as concrete/stone and add additional ones for wood, metal, dirt and possibly water
    • Work on the decals or find and integrate a decal solution that already handles curved surfaces etc.
    • Complete a few of my old, unfinished weapon models and bring those in

    Choosing unordered lists for these was intentional as I'm far too unstructured to actually know what I'm working on in advance. :)

    Currently I'm working on a reload animation. This will be my first ever animation and it's no wonder there are so many bad animations in the world, the tools are horrible, at least the ones in 3ds Max.

    Special thanks to VisionPunk for the excellent Ultimate FPS Camera which allows for dynamic, interactive weapon and camera movement, Dom Clubb for his excellent AK47 model with included source files (which I love you for) and of course Unity for their Bootcamp assets including the soldier character which I mutilated. :p
     
  2. Swearsoft

    Swearsoft

    Joined:
    Mar 19, 2009
    Posts:
    1,632
  3. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Excited to try this out, but it doesn't seem to be working properly for me. The weapon does not align correctly or move at all, although I am still able to move and shoot (My best guess is that it's happening in the initialization of the FPS Camera where it creates a new object to parent your model to).
     

    Attached Files:

  4. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    It says in the corner that you're using Unity 4 beta. I'm running 3.5. No idea how it would run in 4 beta, sorry. Apparently it doesn't work. :p

    How do you get that console if I may ask? :p

    @koyima, obviously my insight into the animation tools of 3ds max are limited as I've just started, but take this for instance. In my reload animation I add a secondary magazine which the character will grab and use to push out the old magazine with. I move the hand down, and position the magazine in the hand. Now I want to link the magazine to the hand, but when it it is inserted into the rifle I want to unlink it so I can move the hand freely again. This should be trivial, right? If so why do I have to fiddle with constraints in the motion tab (which as far as I'm concerned is the least intuitive interface I've ever seen) just to do something as simple as this?

    And a lot of what I did when rigging my arms I had to do in that sidebar. That sidebar which is only about 200 pixels wide and can't even be resized. Important features and tools just seem to be tucked away in the most hidden places of the interface. Perhaps it was just poor phrasing, the tools are fine, but the interface is always in the way.

    PS: That channel looks interesting to say the least, thanks. :)
     
    Last edited: Aug 26, 2012
  5. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Couldn't play properly due to webplayer problems on my MBP. Could you upload a standalone that I can try?
     
  6. Swearsoft

    Swearsoft

    Joined:
    Mar 19, 2009
    Posts:
    1,632
    For animation in max you would use a Link Constraint to do this, which is very simple, you just tell it what frame you want it to link to the hand and when to not be linked - it's in the animation menu and if you do a search you find the solution easily.

    No in games this won't work, but there are a few ways you can deal with it:
    - have two clips and turn on/off rendering.
    - have one clip which as it is popped out goes out of view and meets the hand reaching down for "another" clip.
    - code 2 clip to be added/removed as children to the hand.



    The sidebar can be dragged out. Also you should know that people that know the program (any program) tend to want all the space for the viewport and all wasted space is considered a loss to the viewport. Big buttons, large gaps etc are for kid's programs. Plus after a while it's so automatic that changing it (especially to consume more space) becomes impossible (there is backlash when Facebook does changes, now consider that you have 300.000 people (legit licenses) that use the program for a living and have paid 3.5K for it). Basically you aren't familiar with the interface. What would you suggest that they have a giant non-windows standard size spinner so you can change the value of the bone's influence Please go ahead and make a mokup of the interface. The whole Autodesk idea is to use windows standard controls, so that the interface is familiar.

    What does this have to do with you you might say. Well it has everything to do with you if you think the controls/fonts are small you can change them (Windows 7: right click on Desktop -> Personalize -> Display -? Change to 125%), if you think those controls are small it is obvious that all your windows apps feel the same, right? Or is it just max?

    I have been using it for over 10 years. Every time I got a new monitor I was glad that the Control Panel was even smaller.
     
  7. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Uploaded a new version where I fixed the tracer problems by making bullets penetrate 100% for the time being. :p Will be changed to work properly later.

    Also added the soldier's run animations and tweaked the walking animations a bit. Will have to do quite a lot of work there to make it look properly, if it can even be done with the Bootcamp soldier. His running animation isn't all that suited for first person. :) If it doesn't work out will look into creating my own character.

    @Sevenbits, I'll look into adding a standalone tomorrow.
     
  8. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    Looking really good so far. I think the running animations on the arms could def use some improvement though. :)
     
  9. voidwave

    voidwave

    Joined:
    Jul 16, 2012
    Posts:
    6
    really nice work man, keep it up
     
  10. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Do you plan to use the Decal System? I have seen that you are already using the terrain and building from the demo scene :) .
     
  11. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    @Dantus, nice catch. :) I downloaded it and tried the example scene, but it seems a bit too complex for my needs. I like to start small and work my way up so I understand what code is in my project. It looks like a powerful system, one that I may return too, but not at the moment.

    The scene is nice though, thanks for that. Saved me the time of stripping the bootcamp project myself. :)

    I did notice this when testing the example scene though:

    Not sure if it's still an issue in newer releases, but the decals seem to be projected from the camera without taking into account the normals of the surface they hit so they stretch out almost infinitely if projected at a shallow enough angle.

    @brilliantgames, yeah there still isn't any animations on the hands or weapon. It's only the motion from the FPS Camera which could probably be tweaked to look fairly good, but I haven't done that. :)

    Currently trying to create some decent muzzle flashes as well as well as work some more on the legs.
     
  12. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    That issue is part of every decal solution I know of. But for some cases like yours (the one in the picture) it would absolutely make sense to use the surface normal, which would only be a small modification in the bullet example script. Don't hesitate to ask questions if you decide to use the Decal System :) .
     
  13. blacknirvana

    blacknirvana

    Joined:
    Aug 16, 2012
    Posts:
    60
    I'm sorry but without any of these elements I really don't seem the point in your game, why would I play it?

    There need to be something, a points system, easter eggs, challenges...
     
  14. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    For the same reason you go to the shooting range in real life obviously...

    Also, whether or not anyone plays this doesn't matter at all to me. :p I just want to make it so I want to play it.
     
  15. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Added a menu to the game:

    http://twiik.net/content/shooting-range

    I know that's this is a pretty boring update so I decided to give away the menu:
    https://dl.dropbox.com/u/766368/MENU.unitypackage

    Those with a keen eye will notice that this is the menu from the Bootcamp demo, except that this one is rewritten from the ground up to actually properly utilize the GUI system. The Bootcamp menu was hard coded to look and function exactly like it did while this one should be fairly easy to change. Nearly everything is set through the gui skin so it should be trivial to change textures, paddings, sizes and margins to change the look of the menu. Well, with the current GUI system it's not exactly trivial, but it's possible. :)

    Use the menu for whatever you want, commercial or non-commercial, and modify it however you like, but remember that the art assets and sound files come from the Bootcamp demo. Not sure what the license is like on those.

    I made it to see what the possibilities for ingame options were in Unity. There are some essential settings that aren't accessible through scripting, the biggest omission being the input manager, but for the most part what you expect is in there. The package should be plug play as I have tested it in some of my projects and it worked fine. Just drag the prefab into the scene and it should work. But nonetheless it is intended to be extended and modified through scripting. There is quite a bit of code in there for enabling/disabling image effects, but it's commented out because it always generated errors when I tested in projects without image effects.

    Also added an fps counter and have started modifying the muzzle flash. The current one is a big improvement, but it still has a long way to go. :)
     
    Last edited: Sep 1, 2012
  16. Ben-Massey

    Ben-Massey

    Joined:
    Jun 13, 2011
    Posts:
    581
    Interesting 'demo' I dont see why on earth it exceeds 30mb though, maybe work on your optimisation, most of my games that are near completion don't even reach that.
     
  17. chrisall76

    chrisall76

    Joined:
    May 19, 2012
    Posts:
    667
    Yea I agree, a pretty big file size for not a big scene, may want to optimize some meshes and use bump maps.
     
  18. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Not sure what kind of games you're comparing me to or why you would think it's the meshes making up the file size. I reckon the textures on the arms and the gun are 50-60% of the file size. One 2k texture is 5,3mb and there's a few on there.

    If download time or bandwidth becomes a problem I'll see about limiting the texture size, until then it's not a problem for me.
     
  19. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    They are all freely reuseable.

    So, is this menu a re-write of the Bootcamp one, or does it utilize code from Bootcamp?
     
  20. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    It doesn't require anything from the Bootcamp project to run if that's what you're asking. Everything is in the package.

    If you're asking whether or not everything is made from scratch then I would say that most of it is while taking inspiration from the way it was done in the Bootcamp demo. :) The original code was very inflexible in that almost all the positions, paddings and margins were set in the code. The helper methods for drawing the sliders and toggles are probably what I've changed the least, because those were pretty clever.

    Just noticed that the overall graphics quality level is saved between plays even though I don't do anything in the code to make that happen. That's odd. :)
     
  21. chrisall76

    chrisall76

    Joined:
    May 19, 2012
    Posts:
    667
    Well for the aim down sighting, was that lined up/animated in 3DS or done in Unity? Need to work on my sights.
     
  22. AlcatrazAlex

    AlcatrazAlex

    Joined:
    Aug 6, 2012
    Posts:
    83
    How you make sun effects on camera? can you share this?
     
  23. uweenukr

    uweenukr

    Joined:
    Jan 17, 2011
    Posts:
    54
    The field of view adjustment seems to mess the view of the game up. The arms stick out to the shoulder and a clip is hanging mid air.
     
  24. Majestic24

    Majestic24

    Joined:
    Jul 15, 2012
    Posts:
    109
    I like the GUI

    I like the sounds and recoil of the gun


    Gameplay and controls are smooth

    So far so good
     
  25. 2darray

    2darray

    Joined:
    Jun 6, 2012
    Posts:
    18
    Love those world-space shell casings!

    Do you think you can render the arms/gun in a different camera so it won't clip through the scenery when you're right in front of something?
     
  26. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    My scripting fellow says the js is stricter in version 4 (at least the beta) compared to previous versions.
    I've had a number things (scripts) that needed fixing for them to work without errors in beta 4.
     
  27. AlcatrazAlex

    AlcatrazAlex

    Joined:
    Aug 6, 2012
    Posts:
    83
    How to make this light effect? by lens flare? somebody have this ?
     
  28. TehWut

    TehWut

    Joined:
    Jun 18, 2011
    Posts:
    1,577
    looks great and controls like butter. Nice work!
     
  29. trwilson3

    trwilson3

    Joined:
    Jan 25, 2017
    Posts:
    2
    I have tried to acess some of the links and they are all broken. Are there any current ways to see this Shooting Range?

    Respecfully

    Ted
     
  30. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    No, sadly. But I'm actually working on another project where I plan to incorporate what I started on here. But I have no ETA when that will be playable. It won't be for a long time I think. I don't remember how comprehensive this project was as I don't have this version around anymore, but I don't think there was much here.

    Can I ask how you came across this thread? Did you just find it on the forums or did you find it through Google or some other means? I'm not a fan of dead links to my website, especially when they're links I've created myself so I'll try to clean this up and it would be nice to know if there are other links as well. :)
     
  31. trwilson3

    trwilson3

    Joined:
    Jan 25, 2017
    Posts:
    2
    This was all through extensive search on Google, as there is nothing out there otherwise on NON VR Unity Shooting Ranges.