How to create your own games

Modding games
It's important to have a set idea of what you want your game to be

The creation of a game presents a plethora of challenges.

Which engine should you use? Who should you collaborate with? What's the backstory going to be, and how are you going to present it?

Which colour scheme are you going to use? Have you got enough coffee to get you through all those long nights of coding and designing?

It's an overwhelming amount of intricate detail. Get something ever so slightly wrong and people will tell you. The internet will let you know.

But good game design comes down to one simple thing: an idea. A single sentence. A physicist triggers an alien invasion. A gun is created that allows instantaneous travel between two places. A young man who can control time must rescue a princess.

Everything can be expanded from this point onwards, but it's important to always come back to that original point.

The technique's not unique to games – the best novels, films, music and art start out as a simple, broad stroke that's layered and built upon until you've got a finished product. This way, those crucial themes are never lost and the narrative never strays from its original path.

Not everyone wants to construct a complete game, though. The modding community is still huge, still adding new content to games and correcting the mistakes original developers made.

Like so many creative industries now, it's become full of eager fans who are willing to work for free to have that chance at making it to the top, the chance of becoming the next Ken Levine or Gabe Newell.

The best thing about current games – and it's never been better – is that you probably already have the tools to make an entire game from scratch.

Valve's Source SDK is a great place to start, but on top of that you've got the Unreal Development Kit, Skyrim's Creation Kit, Unity and Game Maker.

Our aim here isn't to show you the finer points of coding your first triple-A title, it's merely to show you the tools available for game construction.

We've used Valve's Source SDK to present an overview of what's needed to create a game, as well as detailing other engines and game creation programs.

"Level design should be part of a story"

There are, essentially, two ways for budding game designers to get started in the field of game design.

Modding is a tried and tested route, and a handful of big-budget titles and large studios began their illustrious lives as humble-but-brilliant add-ons developed by a handful of people.

Indie gaming is the plucky youngster of game design, and stand-out games like Braid and Minecraft are often developed by one-man coding powerhouses.

Modding – an abbreviation of modifying – involves taking an existing game and altering its content. Just about everything in a game can be changed, from the look and dress of the characters to the colour of the sky, the design of the world, and the sounds and music.

You can also alter and create scripted events, artificial intelligence routines and ways for the player character to interact with the world.

Modding has come on leaps and bounds since the days of altering WAD files with the Doom Editing Utility.

Releasing mod tools is a win-win for publishers – not only do mods often correct or add content that should have been in the game in the first place (see STALKER Complete), but they can also be used by publishers to see what people want from games; what the trends are gaining traction.

A sudden rush of sci-fimods for, say, Skyrim, could push Bethesda into making another Fallout sequel.

Modding 2

Modder's toolbox

Where do you get the tools to start modding? You've probably already got them.

Open up Steam, click on 'Library', then 'All Games' and select 'Tools'. Among the multitude of dedicated servers you'll see authoring tools and software development kits (SDKs) for all the games you own.

There's little difference between the content of the two, apart from the fact that authoring tools are specifically set up for one game and its intricacies. For example, Portal's tool includes the ability to render those ubiquitous wormholes, which is pretty crucial to the game.

SDKs also include all the information you'll need to get started. You'll find a test level for you to play around with – and probably completely screw up.

There are models and objects to interact with. Some include documentation, but you'll find a mass of tutorials and walkthroughs on modding sites like www.modwiki.net, http://developer.valvesoftware.com and www.moddb.com.

It's worth noting that you need to have the game you want to mod installed on your PC. The SDK will give you access to literally every single little bit of the game, from the colour of characters' pupils to entire swathes of land – but it needs to have something to work with in the first place.

Remember, too, that games use different engines – Half-Life 2, Left 4 Dead and Portal use Valve's bespoke Source engine, whereas The Elder Scrolls IV: Oblivion, and Fallout 3 and New Vegas use the Gamebryo engine.

Before you even start getting to grips with modding, it's a good idea to just, y'know, play some games. Try to look at them as analytically as possible, try and work out what looks right for the setting and what feels forced and unnatural.

There are also games that can teach you a little about the basics of game design through playing them. Minecraft lets you create worlds using building blocks, which has parallels with level designers blocking out levels with Lego.

Garry's Mod serves as a great introduction to facial animations, models and physics, and lets you see how characters and objects interact – often hilariously.

Levelling up

Any game, at its most basic, consists of a level. This is the desolate landscape on which all the other elements sit – a blank canvas that's inhabited by your characters.

The undulations of a landscape or the sharp angles of an abandoned high-rise give visual cues as to the kind of environment we're inhabiting.

Smart level design – like that of BioShock – uses the environment to tell a story. Remove the characters and objects from Rapture and you'll still have a pretty good idea as to what's happened there.

Of course, a level doesn't have to be set underwater, but it should try to tell part of a bigger story.

While level editing is a complicated blend of art, maths and psychology, it's also a great way to introduce the basics of game design.

The majority of elements in a game are made up of triangles wrapped around a wireframe mesh, and this angular approach is why you'll never come across a perfectly round pipe or barrel in a game.

The environment of the game is created this way, too, and even the most awe-inspiring vistas of Skyrim are fundamentally made up of millions of tiny interconnected triangles.

The best way to take those first tender steps into level design isn't through an SDK, though. It's through one of the most powerful and easy-to-use 3D programs in recent years – Google's SketchUp.

SketchUp has been used to create everything from models of real-life locales in Google Maps to photo-real models of aeroplanes.

Although at heart, SketchUp wasn't really built with level editing in mind, its interface is very similar to that used in level-editing software, and its intuitive nature makes it the ideal starting point for any kind of 3D modelling.

SketchUp packs a couple of other advantages, too. Valve's Hammer editor now includes the ability to import models from SketchUp, so you can create detailed and interesting models that would be nigh-on impossible in Hammer and import them.

SketchUp architecture

Fairly complex architecture can be imported to Source games via SketchUp

You'll find a plug-in for SketchUp in the Source SDK folder once installed.

SketchUp is also handy for sketching out levels and seeing how they'll look and play. Its renderer is far faster than that of a game, so you won't have to wait around for your levels to compile before you can see what they'll look like.

Valve's Hammer level editor is the natural step up from SketchUp. It's been around in various guises since 1996, when it was known as WorldCraft, and its fundamental interface and operation haven't changed a great deal since it was released alongside the original Half-Life back in 1998.

It's compatible with the majority of Valve's recent releases, from 2004's Half-Life 2 to last year's Portal 2.

While it can look overwhelming to start with, working through a few tutorials can help you pick up the basics fairly quickly.

The key to Hammer's world-forging is the use of brushes. These are the basic blocks that are used to create the solid, static elements of levels – the floor, the walls, the sky and the water.

Hammer uses a technique known as binary space partitioning (BSP) to render levels, which takes into account each and every angle from which the gamespace can be viewed.

All levels created with Hammer must be contained in a completely watertight space, because any light leaking out confuses the hell out of the compiler.

A level simply compiled of brushes would look incredibly dull and lifeless, so to liven things up, textures are applied. These are two-dimensional image files that wrap around the 3D objects to make them look more real.

Upping the resolutions of these images using graphics editing programs is a modding art in itself – this is how high-resolution texture packs are created.

Hammer also allows you to control the lighting – be it the midday sun or a full moon – and adjusts shadows and highlights accordingly.