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. Dismiss Notice

[DEPRECATED] Mobile FPS Template

Discussion in 'Assets and Asset Store' started by Chris-Paul, May 2, 2016.

  1. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Hi, I would like to present a project I'm working on, in which I'm trying to put together a well-designed FPS template, focused on mobile devices. It serves as a solid learning resource, that helps you develop an optimized, good-looking, and interesting game.
    So this asset is the opposite of other existing ones, like UFPS and RFPS, it focuses on being clean and easy to understand, allowing the user to easily build on top of it, combine it with other packages, or simply be used as a learning tool.

    ASSET STORE LINK: https://www.assetstore.unity3d.com/en/#!/content/62753
    ANDROID BUILD: https://www.dropbox.com/s/4120193cywokr0c/MobileFPSTemplate.apk?dl=0

    Without further talk, here are the current features:

    Code:
    -Has tooltips for every property in the inspector, so you can just hover over and better understand what it does.
    -Almost all methods have a tooltip when hovering over their name.
    -Scripts were made as modular as possible, to allow reusing, expanding and minimize appearance of bugs.
    -Good naming, each method performs just one task, etc.
    -Almost fully Object-Oriented, built with OOP practices.
    -Has no custom inspectors (Some assets tie their regular code with the custom editors, and lose flexibility).
    -Fully-commented and explained.

    An example of a script inspector that handles footsteps:


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

    Character Movement:
    -Uses the builtin CharacterController.
    -Can control forward, back, sideways speed, along with acceleration and deceleration.
    -Sprint and stamina.
    -Crouching.
    -Jumping.
    -Control gravity, max fall speed and air control.
    -Can push rigidbodies, like crates and barrels.

    The movement script:


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

    Input and mobile controls:
    -Toggable mobile controls.
    -Toggable standalone controls.
    -Just enable and disable the corresponding script, and you can control the character with either Keyboard and mouse or Touch and UI buttons.



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

    HUD:
    -Add and select weapons through the Weapon Wheel, inspired by FarCry4 and GTA5.
    -Has Pain HUD, triggered by fall damage or other kinds of damage.
    -Screen fades in and out when spawning and respawning.
    -Health indicator.
    -Dynamic crosshair, each weapon can have it's own crosshair size.


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

    Weapons and Items:
    -Has 4 types of weapons implemented so far: Knife, Handgun, Rifle, Shotgun.
    -Can reload guns.
    -Has weapon and ammo pickups.
    -Guns have shells, bullet tracers, muzzle flashes, etc.
    -Customize every weapon in the inspector.
    -Medkit pickup example.
    -Camera anims when attacking/shooting.
    -Define your own hit impact particles, decals and sounds.


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

    Damage system:
    -You can make an object damageable very easy.
    -Fall damage.
    -Explosion damage.
    -Can die.

    Fall Damage:


    Dying:


    Barrel exploding, after shooting it multiple times:

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

    Spawn system:
    -Has a customizable Spawn Manager used for spawning monsters.
    -Multiple methods of spawning (random, closest point, etc).
    -Player is respawned when dies (with a specified method).
    --------------------------------------------------------------------------------------------------------------------------------------

    Event system:
    -Has a PlayerEvents script that broadcasts events among all the player scripts (death, respawn, weapon changing, etc).
    -Connecting your script to the event system is made as simple as possible.
    -Helps the code to be modular and not have dependencies.
    -The same system used for AI mobs.

    PlayerEvents script, that handles all the above:


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

    Mobs:
    -Has a spider and zombie example, uses Mecanim for animations, and the builtin navigation system for movement.
    -Their design is based on FSM (Finite state machines), so it's easy to add new states.
    -Example of how to layer the states (for example the chase state should override patrolling).
    -They have the idle, patrol, chase, attack and dead states implemented.
    -Spider spits some green substance (ranged attack).
    -Zombie attacks with the hands(close attack).
    -They can take waypoints, to patrol.


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

    Honorable mentions:
    -Footsteps system.
    -Loot crates(you can choose what will be the loot, the script will drop a random object).
    -Has a message system, used for displaying messages when taking an item, dying and so on.
    -Explosive barrels.
    -Spring door, opens when you walk into it.
    -A low-poly environment(can be used for prototyping).
    -A few dynamic objects, like computers, tables, and chairs.
    -Weapons, animations and sounds, as well intended for prototyping,

    Loot crate inspector:



    Displayed messages: (They can be stacked, the newest message goes on top and pushes the list down, they fade and go away after a specified time)



    Phyisics door(being opened by a bullet):



    Some included assets, made in Blender, Gimp and Audacity(Excuse them, they are programmer art, intended for prototyping):


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

    NOTES:
    ----------2nd of May 2016----------
    -Until Unity 5.4 goes out of beta, I recommend using Unity 5.3 with this asset, as at this date, it is known some Android devices crash when running Unity apps.
    -Asset is almost done, I hope that on 8 - 10 May I will be able to have it online.

    I hope it might interest somebody, I have plans on expanding it a lot more, based on my plans, and/or feedback, if there is any, this is the list for the next versions:

    -Directional damage HUD.
    -Blowing zombie(similar to left 4 dead).
    -Minimap.
    -Rocket launcher.
    -Grenade.
    -Sniper.
    -Aiming.
    -Climbing ladders.
    -Vaulting.
    -Multiplayer.

    Thanks, Chris.
     
    Last edited: May 20, 2016
  2. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    OMG please release!!!! I would buy instant
     
  3. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    Can you please add Desktop controls too? I dont want mobile
     
  4. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    There are integrated Desktop and mobile controls, you just enable and disable the one you want or don't want :D
     
    pushingpandas likes this.
  5. Maxxamillion

    Maxxamillion

    Joined:
    Apr 20, 2014
    Posts:
    22
    Looks very interesting. I would by it if the price is reasonable.
     
  6. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    I'm thinking that 15 - 20 $ would be a good price range.
     
    pushingpandas and Maxxamillion like this.
  7. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    do you need beta tester? I can test Windows 8, 10, OSX :D
     
  8. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Thanks a lot, but I already have a few people testing it :D I'll try to finish it faster so you can play with it though :)
     
    pushingpandas likes this.
  9. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    855
    I like it. It looks interesting so far.

    It might be a challenge for you since it would probably require support of bluetooth controllers but I'd love to see the option of supporting Google Cardboard.
     
  10. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    I will put it on my todo list for this asset, I'll take a look after I'm done with the first version.
    Great idea, thanks.
     
  11. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    Looks cool. I'm subscribing.
     
  12. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    855
    I plan on picking this up when it's available...
     
  13. Gunhi

    Gunhi

    Joined:
    Apr 18, 2012
    Posts:
    300
    Looks promised. What do you mean by "Multiplayer"? Do you use UNET, PHOTON or something?
    Subscribed!
     
  14. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Great!
     
  15. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Cool! I'm doing my best to polish it right now, it will be available around 8th May.
     
  16. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Multiplayer is a feature I would love to implement, I will use UNET, I think a COOP survival mode would be the best for the people who want to learn multiplayer in Unity.
    However, as you've seen at the end of the post, is on my todo list for the next versions, so if people will like the asset, I will definitely include it.
     
  17. robert301990

    robert301990

    Joined:
    Jul 1, 2014
    Posts:
    30
    Looks good, but I would love the multiplayer version of it. When do you think that you will release the v2 ?
     
  18. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    855
    Is this close to being released?

    Edited to Add: Never mind! Looks like it's available now.
     
    Last edited: May 18, 2016
  19. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    Can you make a demo video? The screenshots are very dark
     
  20. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    258
    Add Aiming Guns!! and Crafting systém,Building systém Very Very NICE!!!
     
  21. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    855
    I tried the demo on my phone and it works quite well. I always have troubles controlling FPS's on phones or tablets (but that's just a general issue I have.) Your demo runs quite nice, though.
     
  22. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Jumpsound please.
     
  23. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    258
    it's a template or just to learn ? men of horn do the project which will be commercial ?
     
  24. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    Its awesome! But - how do I change weapons? In standalone settings ?!? Which key???

    Great first version
     
  25. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    Can you please add a way to disable mouse cursor on standalone desktop mode?
    And a hit indicator when receiving damage. The HP does down but there is no visible effect on screen
     
  26. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Hmm...at high damage (> 15), the blood screen will appear, but I will add the directional damage UI in v1.1, it will be like in Far Cry 3+, or Counter-Strike.

    In standalone, you need to click the weapon icon as well, I will add a feature for standalone, like pressing the TAB key or something.

    The mouse cursor can be disabled in the script "LookAround", which is attached to the player.
     
    pushingpandas likes this.
  27. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Actually is both, you can learn from it, or use it in your games.
     
  28. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Find the object called "FootstepsPlayer", which has a script attached with the same name, you can specify a jump sound there.
     
    pushingpandas likes this.
  29. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    I will add them in the future versions, but I will appreciate if you can give me some references(games), so I know what to aim for.
     
  30. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    I hope to release the multiplayer version in 1.1 or 1.2
     
  31. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    Thank you! Yes, TAB would be awesome
     
  32. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    Can you add a melee? If gun is empty to hit enemy with gun or something like that?
     
  33. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    different zombie types like L4D with the exploding zombies, the slime shooting zombie (like your spider) would be awesome.
     
  34. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    There is a knife in the template, maybe a sword/axe/wooden bat would work too
     
    pushingpandas likes this.
  35. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    yes but I mean add a melee animation / function to the pistol / gun aswell
     
  36. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Good idea, is on my todo list :)
     
    pushingpandas likes this.
  37. Mustra

    Mustra

    Joined:
    Oct 26, 2015
    Posts:
    3
    Hi, I see this is very recent, I would liek to ask, dispite price, why should I buy this one vs ufps + mobile addon? So far I see this one is updated sooner, but on my Sony Xperia I cant get out of the inventory menu for some reason.
     
  38. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Hi, this system focuses on mobile, UFPS is heavier, so it's more difficult to modify and learn it, this is more optimized as well.
    And despite the price,I'm going to release more and more things, like stated in my post, which UFPS doesn't have them.
     
    Last edited: May 23, 2016
    Mustra likes this.
  39. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    258
    standalone control inventory button??
     
  40. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    UFPS isnt that good. Its a horror to maintain and modify
     
    Mustra likes this.
  41. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Hi Johny, I will include the option to specify a button in version 2.0.
     
  42. Mustra

    Mustra

    Joined:
    Oct 26, 2015
    Posts:
    3
    Ok, I see this script is usefull for being lightweight, but it has many bugs, it doesnt work that well on my Xperia M4, the comands arent responsive lerp/ease out, is it possible not to? Plus I had some bug I could close the inventory.
     
  43. Mustra

    Mustra

    Joined:
    Oct 26, 2015
    Posts:
    3
    Can I have two joysticks one with regular straffing awsd and another to look around? Could you also include a function to reset camera to center?
     
  44. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Yes, I'm working right now on fixing the bugs and improving the system.
     
  45. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Yes, I will include it in v2.
     
  46. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Do you have other bugs to report? feature requests? Let me know how can I improve it for the next version.
    And what do you mean it doesn't work well? the performance is low?
     
  47. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,418
    Exploding zombies!!!!! Please add!
     
  48. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Great review! Thanks. All the things you said I had in mind for the next versions.
    I will update it in 1 week or two, hopefully with the tutorials and better documentation.
     
  49. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    That's because you have no waypoints setup.
    You need to create empty transforms in areas that you want your monsters to patrol (They need to have the "Waypoint" tag).
    You're also gonna get this error when the waypoints are very far away from a specific enemy.
     
    Last edited: Jun 4, 2016
  50. Chris-Paul

    Chris-Paul

    Joined:
    Mar 5, 2015
    Posts:
    48
    Glad it worked.