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: Unity Asset Store - The Best Assets for Game Making
ANDROID BUILD: Dropbox - File Deleted - Simplify your life
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.