Bare with me guys this is a long one. I have an idea that i want to explore and possibly expand upon in regards to making a tutorial. I can not program past the utterly basic level. I have no prior experience so do not have pre-used methods from experience in other programs to create the effect i am looking for.
I have seen the same threads over and over in regards to "where do i get started" and the answers are the same; the very helpful newbie tutorials that run through most of the basic concepts. These are very good and definitely the place to start (i did) but where to go from there. The answer (at least to me) is not as simple as "just make something and pick up on any mistakes you make along the way". I just cant start a project. I have no middle ground that can take me from pong to a simple fps (or any other game but ill get to that later).
Every tutorial i have come across with interesting start to finish concepts has been incomplete. The most complete fps tutorial i came across ended way before even enemy ai was introduced. Things like pathfinding and positioning. These may seem like simple concepts to you but i cant work it out on my own.
This particular problem stems with people not finishing a tutorial before it gets interesting. They can not be blamed for this as its ten times more than what i have ever contributed to the forum and i thank them for doing it but it doesn't help folk like me. We need that extra push. I cant put a gun to someones head to make them finish a tutorial nor can i ask someone to write one for me, no one owes me that, or anyone that for that matter.
If there were a different approach to writing a tutorial though things might be different.
What if a tutorial was written by someone following a set of guidelines regarding questions they wanted to know. Questions they had to ask. And asking each one of those questions one by one on the forums, slowly building a profile of a game (in this case an fps but if successful, different game models such as RTS). This way the burden is not on one person to answer every question, to finish the tutorial from start to finish. The whole community could chip in, in the same manner as they would just on a general topic. Different ideas could be discussed, we would pick a method, use it in our game and move on to the next segment.
Below is the proposed material to be asked.
FPS Structure.
1) A world to move in.
Setting up the very basics.
a) Simple terrain.
First we set up the screen and create a small textured random terrain.
b) A way to move.
Simple unrestricted camera movement to move round that terrain.
2) A more complex world.
Expanding the world (level) to include larger terrain. A building on that terrain that can be entered (so outside and inside can be covered). More complex camera movements that restrict the player so they can move realistically within the confines of the world (level).
a) Larger terrain.
Now a terrain that is more deliberate and not random, something structured such as mountains surrounding a fairly flat terrain that will have the building eventually in the middle. The mountains will eventually serve as a blocker for the player to not be able to move outside this world. Make more than two textures purely in DBpro (so it can be run without external media) to add a decent level of depth to the level.
b) Skybox.
How to make a simple sky box (moving clouds and general atmosphere is not covered here). In this we will not use a texture but do everything we can in DBpro direct so the code can still be run without extra media.
c) Make a simple building.
A simple one room building with an entrance for the player to go inside.
d) Lighting the world (and the building).
A few different ways to light the world and the inside of the building for effect.
e) Giving “gravity” to the player.
Now the player will not be able to free fly round the terrain using the camera controls. He will be “grounded” to a spot roughly 6 feet above the terrain he is standing on. Jumping and sprinting to be added later.
f) Adding collision
Collision to the walls in the building so they can only enter through the gap.
3) Adding some essentials
This focuses on three main aspects of an fps, being able to shoot, something to shoot at and pickups.
a) Adding a gun
Make a simple looking gun (once again in DBpro to avoid media issues)
Positioning it correctly in the players view and making it shoot. Basically a simple ballistic weapon.
b) Adding an enemy.
Just a simple sphere and box effort drawn using DB’s object command. As of yet will not move nor animate but will take a certain amount of hits before disappearing. This will require an aiming system for the players gun, working out what constitutes as a hit or a miss.
c) Enemy Collision
Make sure you cant pass through any enemies you add.
d) Adding an ammo box into the world that the player can top up depleting ammo.
Make a simple coloured box with the word ‘Ammo’ on it. Teach the user to place it anywhere they desire in the map. Add an ammo counter that depletes as they fire and replenishes a certain number when they collect the box. Which subsequently disappears. Just moving over the box is enough here. Different ways to collect and pickup things such as having to be in the vicinity and pressing ‘e’ and it adding it to inventory then, or having a physical bend down and pick it up animation can be discussed in another tutorial (possibly the RPG tutorial).
4) Moving through the world.
Now we will add more to the player character allowing him to jump, sprint, run up stairs and interact with items like doors and lifts to create a more fun environment.
a) Make a more suitable building.
Either make additions to or build a new building model for the level. This building will include a second floor accessible via a set of stairs on one side and a hole in the floor on the other which we will make a lift go through. A third floor that goes up from the second via a ramp. Make the level so you can see a fair bit of the ground floor from the top level because when we add jump we want to be able to jump off the top floor to the bottom. The building must also have a room (on any floor, preferably the ground floor and use your first building so they are attached) that you will have to access via a door. A slight bonus here would be to include a simple button on the wall right where the lift will be (not far away from it as you will need to be standing on the lift when you press it). Once added to the level light it appropriately using methods in section 2d.
b) Build a lift.
Create a platform that will be the basis of the lift, build one using a simple box command in DB. Place this at the ground floor in the appropriate place (right below the pre made hole for the lift). Collision will be needed here as soon we will add a way to make it move.
c) Add a jump feature to the player when they press space.
Give the player a simple jump. A more complex feeling jump can be discussed later where the player has more of a sense of gravity and fluid feeling with a more gradual fall from the top of their jump. For now just do a simple up and down.
d) Stairs
Make sure the player can run up and down the stairs realistically and jump from the top floor to the bottom.
e) Push the button.
Make the platform move up and down with a simple push of the button built into the wall. Also allow the button to call the lift if it is not on the floor you are on.
f) Sprinting
Pressing the shift key while moving will temporarily make the character move quicker. Add a simple indicator to the amount of “stamina” the player has and once drained stops the character sprinting until it begins to climb again. Anything under 10% and the character cant sprint again immediately. Anything over and he can.
g) Doors
Now we have two places where doors are needed and we will build two different types of doors. The two places are from the outside terrain to the big second building we built. And the special other room made out of the first building we built that goes from the new building. One door will be a swing open style like a standard door, the other will be a sliding into the wall style. Other fancy methods may be discussed here such as double sliding. Doors sliding from different angles and animations on doors to give them an “unlocking then sliding open from all directions” look and feel to them.
One will have to be interacted with (press e to open when close enough) the other will be triggered by the player moving close to them.
5) A better player.
Some extra additions to make the character feel better to control plus some usual fps extras.
a) Damage
Add a damage meter to the player as pretty soon he will be taking damage from enemies, falls and other things. When damage is at 0% or nothing the player disappears and respawns wherever he was at the beginning.
b) Jumping.
Now we need to advance jumping to make it not only smoother and more fluid like but also propel the character forward based on his forward momentum to sprinting into a jump will go further. The character begins to fall faster (up to a point) the longer he falls. The character takes damage upon landing from a higher fall, the higher the harder the damage.
c) Head bob.
Adding a very slight wobble and movement to the player and his weapon. This changes slightly when running up stairs. With a bit of a crash when the player lands after a big fall.
d) Weapons
Now its time for a new weapon that does something different from the original. Using the ammo box pickup method in section 3d place a new gun model into the world that when picked up adds it to a players “inventory”. For this we need to create a simple inventory to keep track of what and how much ammo the player has for what gun they have. Pressing 1 and 2 selects between the weapon and also scrolling with the mouse wheel. Selection and swapping should be fast but also smooth. Place a different type of ammo box down for this weapon (either use a completely different model or just the same ammo model but a different colour).
This new weapon does a lot more damage. Indicate this by damaging the enemy we placed back in 3b a reasonable amount more than the first weapon. We will work on a different effect for the ballistics or what this weapon shoots later on.
e) Crouch
A simple ctrl for crouch which will be used to duck enemy fire and hide behind objects later on but can also be used to get around the level if you create small openings or ducts.
6.1) Enemies & AI
Every single tutorial I have ever seen and come across has either failed here or not got that far, usually leaving it as an intended but not finished piece. This is not acceptable as the finished product is not a game unless this section is finished. People normally struggle to move on because of this. Hopefully this section will be finished enough to allow people to create a full game.
This will incorporate a new type of enemy with different stats. Movement to both the enemies. A simple AI state and Pathfinding. The enemies can now damage the player and a score is logged for kills.
a) Replace original enemy sphere with an actual model. We will build something direct in DBpro again so although it wont look pretty it will be functional and medialess. Preferably add a gun to the model. Animating this model will either come later or be covered by a different part of this tutorial. For now its just important that they move correctly and turn to face the player and/or direction they are shooting when the player is spotted.
b) Add a new enemy
We need a second type of enemy model also imported into the game and using UDT’s give them different damage and health stats and place a few of each of them around the level, inside and out. If you can make two different enemies with different stats and place them at different points throughout the level you have created then you can make a thousand.
c) Enemy movement.
Now we make each enemy walk along a simple set path at different speeds depending on which enemy they are, just make one enemy faster than the other.
d) Make them shoot back.
Now when the player is within a certain range the enemy will fire upon you.
Again make each of the two enemies have a different fire rate, range and damage that is done to the player. We will concern ourselves with accuracy and a chance they will miss you later on.
e) End of level
When all enemies are dead you complete the level. Either cut to a congrats screen or make something like floating text with a fade out etc. Discuss different ways of ending a level.
6.2) More advanced AI.
When running the game now you should be able to manoeuvre around the level going in and out of buildings, using lifts, stairs and doors, jump, sprint and shoot your way around the whole level you have built. Inside and outside. You can now build a level any way you want it from indoors only to outdoors only or a mix and light it any way you wish. Add multiple ways to get around the level. Add as many enemies as you like and as many different types. They will move and shoot you if you get close and you can also engage them with as many different weapon types as you like while collecting ammo for those weapons. You will rack up a score and when all enemies are gone the level is complete. This however is the simple stuff. The enemies are not that much fun to engage and while it is a game (all it needs is a menu and a way to start a new level), it needs more complex AI to make it truly fun. This is what 6.2 is about. Although only 4 sections the middle two b and c are very complicated and not simple efforts yet will make the difference between a fun playable game and one that isn’t.
a) Dressing the room.
Here we will simply add a few crates, tables and general boxes around the level that will eventually be used as cover and obstacles for the player and AI to overcome. For now just place them in and add appropriate collision.
b) Complex movement.
Enemies now have to move about depending on where they are placed and not just back and forth. Having set patrol points that can include 3, 4 or 5 (or more) waypoints. While it might look the same they will be more aware of what’s around them. Such as trying not to fall of the edge of platforms etc. When shot at or in the vicinity of the player (as if they have seen him or heard him) they simply travel towards him while firing but making sure to avoid objects in the middle of the floor, walls and places they can fall.
c) States
So far the AI simply move around the room when they cant see you and travel towards you when they can. While an improvement on what we had this is still not all that much fun. Now we want them to have different states from finding cover to breaking cover to charge you to going back to finding cover if they are taking a beating. We could also make one of the enemies a bit more scared than the other and will have a 20% chance they will attempt to flee if they are losing health at a certain fast rate, finding cover further away and coming back only when there health starts to increase a little (which will happen over time). They must move accordingly to either take cover if they feel the need or are smart enough, to getting in range if they need to and trying to stay out of your range if there gun is better. Another nice touch would be if they start to run out of ammo and an ammo crate is not too far they may weigh up the situation and decide whether to make a run for it.
d) Accuracy
Not much fun if they hit you every time. Make hitting you a little harder the further they are away and/or gun dependant accuracy also. Let the game recognise when you are half behind something like cover, if you are stood (instead of crouching and fully behind) next to a box which is half your height so the enemy would see your top half but not bottom half let it affect accuracy slightly for them. Make this include accuracy of weapons for the player too.
6.3 Complex AI
This is where the complex fun stuff really starts to make a game. Better enemy AI would be AI that actually works together. Choosing states based on other factors that include what is happening to their friends.
a) Cover me
Here the enemy will cover another enemy unit while one is reloading.
b) Pincer movement
If two or more enemy are within the vicinity of each other they will try to flank you to stop you supressing them with fire in just one position.
c) Scatter
Build a new type of pickup, dropped from one in five enemies. The grenade. When selected it throws the sphere a certain distance based on how long the mouse is held down (to a point though, not infinite). After a 3 second delay after it is released by the player whether it has landed or not it goes off (we will have to make a simple effect to show this). More than 50% of the time we want our enemies to be aware of this and attempt to flee it but not all in the same direction. Instead we want them to scatter then when they stop return to their normal state of looking for cover of just laying down fire upon the player.
7) Sound
So far all we have is great but lacking atmosphere because most games just don’t work well at all without sound, especially an fps. In this section we will add it all but you will of course need sounds from somewhere in the first place.
a) Footsteps
Try several different sounds to represent different floor types and speed of players moving, don’t forget to include something different for running up stairs.
Also the AI footsteps (even though at this point they wont be animated, animation and things like crouching are added under the polishing section).
b) Weapons
A nice click or sound for changing weapon and of course one for firing and one for empty. This goes for AI also (although they currently do not run out of ammo at this stage you could make it so they do and compete with the player for pickups by adding ‘need ammo’ to one of their states and instead of running to the nearest cover they run to nearest pickup).
c) Pickups
When picking up a new weapon or ammo.
d) Damage
Player and AI damage.
e) Death
Player and AI death.
f) Doors and lifts
The lift in particular can be made from four sounds, the button click, the start, the middle and the end (which is usually the reverse of the start). The reason for this is if you make one sound the lift speed will have to match up with that no matter for how long it is running for. If you determine what stage the lift is in (just started to moving to stopping) the middle bit can be a hum for as long as it needs be. If you make a level with a huge lift you can use the same principle if you make different buttons for different floors and go from floor 4 to 12 (8 floors) or 1 to 6 (5 floors) or 11-12 (just 1 floor). It wont matter.
g) Jumping sound
Maybe a grunt as they lift off and a landing sound. Again this needs to be two sounds with possibly a ‘gliding’ sound in between as each jump may be a different duration.
8 Polishing.
Here is where we add a title screen and menu (easy enough but still needed and some people wont be able to make a decent menu so this is a good place to start), animation to our enemies to make them look better. A new level to skip to (if you can make two levels you can make a thousand). Better projectile graphic effects for different weapon types and things like recoil affecting accuracy. Adding better graphics and textures and detailing objects and parts of the level is not for here as it is a graphics issue and not a programming one, if you haven’t got assets or skills then the game will still look poor but feel fun and great with the extra polish.
a) Saving and loading.
Experiment with two different ways of doing this. A ‘save anytime’ by pressing either a hotkey or escape into a menu and saving from there or loading from a save point. And secondly a ‘save on checkpoint only’ option which limits players freedom to save but is a common method and can be used in conjunction with the other option to stop players abusing a ‘save right before the boss fight’. Also include a number of limited save slots so you can only save 5 times before having to re-write over another save (this can easily be 100 or 1000 if you don’t want your game to be so limited). After this you will be able to save and load however you want.
b) Title.
Add a title and menu that allows you to select sound effect levels and music volume when added. Difficulty options (which can be done just by giving the player less health, a few more enemies per level and make them higher health). Loading from a save point.
c) Events.
Not many fps games would be complete without a boss fight. Here we will lock that second smaller room that we built at first then added onto the second main building. This is only going to open once a condition has been met – Every enemy in and around the building defeated. Once this occurs that door opens and a third model (preferably a huge one) is used for a boss and has considerably more health and fights with not one but two different weapons (two new ones or a combination of the ones we have already used).
d) Animation.
All models now need animating appropriately, crouch for crouching, and running or walking for moving around.
e) Different weapon ballistic effects.
Make at least another weapon if not already done so. This will preferably be a rocket launcher. The other two were simple rifles. Now we want to add a burst fire effect to one gun. A laser effect to the other and a large slow heavy hitting projectile with an explosion to the other.
f) Fire and smoke.
How to make a decent enough smoke and fire effect. A persistent fire such as one you would find on a torch in a cave to provide light and temporary fire such as just after an explosion from a rocket. We could apply this to the grenade we made earlier to create a better blast effect.
g) Ragdolls
This part will touch on replacing the death animation to a ragdoll state so enemies can fall off ledges once shot and tumble to their deaths or alternatively the user can add a “kick” to shove enemies to their death. Ragdoll physics while not essential to a game add a whole other dimension to one and this is a nice place to learn and incorporate it.
h) Destruction
Destructive environments are complex but very satisfying and can add a lot of depth to a game. Here we will learn how to add bullet holes, scorch marks on walls. Also breakable windows. Alter the building model we originally created and add a few holes that we will make windows from. Using this principle you should be able to apply that to bits of wood or other breakable surfaces.
i) Blood and guts
How to show damage on enemies and throw the odd blood splatter up a wall or on the floor. If possible and not too complicated it would be nice to add a growing pool of blood from a dead enemy here.
j) Enemy Damage Bar
Some people wont like it so it doesn’t have to be included but a way to show a health bar (either all the time or just when taking hits) over the enemies head as they move around.
k) Minimap
Again not an essential part of an FPS and something that can easily be left out but not many games don’t have some sort of way of displaying your immediate surroundings. We will explore a few different ways to create a minimap for your player from a simple snapshot of the above surroundings to a radar type minimap.
l) Pause
Adding a pause function which can be part of the game in either of two ways. A user defined pause (such as pressing the ‘p’ for pause key) or a game defined pause such as pausing upon a menu opening, or like a container that you happen to be looting.
With everything above in place you have more than enough tools and methods to create a full standalone FPS and because most of the methods use a “make at least 2 of something” theory you can expand anything you can make two of to dozens more from enemies to weapons and levels. From this you could create a decent blast em up FPS or make the levels more ‘linear’ and create a storyline for your game. If the above is complete and understood to a point there is almost nothing your simple FPS will lack.
While the above will not help you to make the next Crysis game (no matter how good you are at graphics) you should be able to make something fun and your own unique game.
Now you start off with say the first few questions in one topic but some may require just their own topic as they would be a difficult and complex question to answer. I would love feedback before attempting this. If i have missed anything out also please let me know.