Feature

So... You Want to Make Video Games? Part 4: Build

You've planned your game, now make it

So... You Want to Make Video Games? Part 4: Build

Game designer Nick Pendriis has been working with us here at Pocket Gamer to bring his ebook, So... You Want to Make Video Games?, to the web. He's already talked about refining your concept, taking it into the design stage, and planning its development.

So now we're ready to begin building it. In this chapter, Pendriis takes a look at the build phase of game design, which can be a minefield for anyone who's not properly prepared.

Check out the earlier sections if you haven't already, and the list below shows you what's left to come in our exclusive serialisatoni of So... You Want to Make Video Games?:

  1. CONCEPT: Find a strong idea.
  2. DESIGN: Make test versions and create a blueprint.
  3. PLAN: Organise the project carefully.
  4. BUILD: Create the computer code.
  5. ASSETS: Create visuals, audio and words.
  6. TEST. FIX & PUBLISH: Look for problems, resolve them, release the game to the public.
  7. PROMOTE and SUPPORT: Announce the game and respond to feedback.

Here's Nick Pendriis to introduce us to phase four.


Now we have everything planned out, we can tackle the actual program code. There’s no real way around this. Making games involves programming but it really doesn’t have to be difficult! And why not get coding? It can be a lot of fun!

A computer is a powerful machine that will obey your commands!

What will you make it do?


Click here to view the list »
  • 1 Do I have to program?

    That’s like a swimmer asking “Do I really have to get wet?”

    In actual fact, there are various game editors and game creation kits available and they let you build games without programming a single line of code. Of course, there are limitations about what you can do, unless you start learning to program. If you’re serious about making games, you need to try your hand at programming at least once.

    However, there’s no harm in starting out with game creation tools like those below.

    "Learn how to code. Learn as much as you can about coding - there are always deeper levels of understanding. After that, focus on mastering design, for that is all that matters."

    - John Romero, creator of Doom and Wolfenstein franchises.

    Many people think they can avoid programming their game by getting someone else to do it. This is much harder than you think. Why would anyone want to do the work for you? Programmers aren’t just waiting around for designers to have ideas. They learned to program for a reason and those skills are a valuable commodity.

    Even if you do have a coder on your team, you owe it to yourself and your team members to have some experience of programming.

    If you want to make a game, you need to make a game. For that, you have to get your hands dirty with some simple code. Then, even if you aren’t the best programmer, you’ll understand every aspect of making games.

    “Do, or do not. There is no try.”
    - Yoda, Jedi master.

    No matter which area of game development you go into, making your own games makes you a better game maker.

    OK. How?

    To develop games, for any device, some form of PC is required. It is technically possible to make games without a computer (using tablet and smartphone apps) but so far, no professional developer has managed without a PC.

    Despite recent (and shameless) marketing claims that “the PC era is over”, this is far from true. The supposed computer replacements (i.e. tablets, smartphones, etc.) are all designed and manufactured using… computers. They plug into… computers. They are actually tiny, personal… computers. Or PCs.

    The truth is, the PC era just got much more diverse and therefore more interesting. Let’s embrace the evolution of the PC into all kinds of imaginative new devices. What kind of games will they play in the future?

    Anyway, you’ll need a computer.


  • 2 Operating systems

    Computer hardware comes in various forms but primarily there are desktop and laptop PCs. However, the hardware doesn’t do very much on its own. In order to be useful, a modern computer needs to run an operating system. This is the software that creates desktops, runs apps and provides general control over the machine.

    Usually each computer comes with an operating system pre-installed, although these can be changed quite easily. Choosing an operating system (or “OS”) is the first technical decision and realistically, you have three main options today.

    Apple Mac OS

    Adapted by Apple from the older language UNIX, to power their own brand of PC hardware. For decades, Macs represented approximately 10% of personal computers but recently they have become more popular, largely thanks to the success of iOS devices (which run a variant of Mac OS).

    Typically Macs were seen as tools for creative like designers, musicians, writers and artists but Macs are highly capable machines for any aspect of computing.

    Linux

    Also adapted from UNIX and available in a mind-blowing number of varieties, Linux is all about freedom. Nobody owns it. Or more accurately, everybody owns it.

    What Linux lacks in big-money apps, like Photoshop or Maya, it makes up for with excellent security and adaptability. Linux runs the majority of the world’s web servers and is at the heart of every Android device. The easiest variety of Linux to begin with is Ubuntu.

    “Oh Ubuntu, you are my favourite Linux-based operating system!”

    – Sheldon Cooper Ph.D., theoretical physicist.

    Linux can be installed on all kinds of devices. It’s fairly straightforward to replace Windows or Mac OS with Linux. I have the latest Ubuntu running on both former-Mac and former-Windows hardware.

    Disney, DreamWorks and Pixar all use Linux to create the graphics in their movies. Its use in mainstream game development is, sadly, minimal but that can certainly change.

    This article explains about Linux in Hollywood.

    Microsoft Windows

    Built on text-based DOS (Disk Operating System), Windows runs on the majority of desktop and laptop computers. The brand is so strong that for a large number of people, “PC” actually means “Windows”. The popularity of Windows has given it the widest range of professional tools, many of which are industry standard. It is the most commonly used OS in game development.

    For example, a developer that registers with Sony to be a PlayStation developer, will get a development kit, which is essentially a heavily customized PlayStation and a Windows-based PC. There isn’t a Mac or Linux version of the kit. The Xbox and Wii dev kits are the same.

    Horses for courses

    Which of the operating systems you choose is down to personal and practical factors, including the hardware you are developing the game for.

    If you want to make games for the big consoles, learn to use Windows and program in C.

    Expect this to change over the next two decades.

    Making a game for PlayStation and making a game for Android are very different tasks. While the overall process is the same, the technical details vary greatly. For your first game, use the computer and software that you have access to. Learn the basics and then get ambitious.

    So, to make a game we need a way of giving instructions to the computer. This requires a language.


  • 3 Languages

    Deep down, computers only understand two things:

    “0 = off” and “1 = on”.

    That’s it. They “think” and communicate in a language of pure zeroes and ones called “binary”.

    We could use binary for programming computers but it would take forever – and mistakes would be easy to make but really hard to find. Imagine a hundred or more pages of zeroes and ones. How would you find a typing error?

    1000001010001111010101010101101101111111011000101

    1011011011010101101101010101111011110000010010000

    0101010001001000011001010100011011110110111011011011

    0111110110111011010110111010101010101011010101101010

    1010101010101010101000011001100110101100110101010101

    010101010101011011111110111110101010000000110110101

    100101010010101101010101010110110110110001011011011

    01101010110110101010111101100000100100000101010101

    Exactly. So binary isn’t really practical for programming. What other options have we got? Well thankfully, over the decades, programmers have used binary to create more advanced, readable languages. Then they used those languages to make more languages. And so on.

    Now, just like humans, computers speak many different languages but fundamentally there are only two types of computer language, “low-level” and “high-level”. They both have advantages and disadvantages.

    Low-level Language –
    fast but difficult to read.

    Low-level languages are easy for computers to understand and they run really quickly. They are not so easy for humans to understand though.

    High-level Language –
    slow but easy to read.

    High-level languages, on the other hand, are much easier for humans to understand but they run more slowly, because the computer has to spend time translating them.

    So when it comes to choosing a language, how can you tell which one is right? Again, it all depends on a number of factors.

    • Are you planning to be a games programmer?
    • Do you already know a computer language?
    • Do you want something simple or advanced?
    • Which languages are available for your system?
    • Does the target platform require a specific language?

  • 4 The most popular language options

    Below are a few of the many languages available. Although there are other excellent languages, such as Fortran, Logo and Pascal, they don’t play a common role in game development.

    Assembly Language

    Often referred to as “machine code”, this is a low-level language that gives direct access to specific computer hardware. Really specific. The advantage is raw speed, especially on hardware with limited resources. In the early days of computers, games used assembly to squeeze as much juice out of the processor as possible.

    Unfortunately, assembly doesn’t translate well to other hardware and it isn’t very readable. Translating machine code between different types of computer is tough work because it requires human translation. That’s why “porting” games between systems has always been time-consuming and expensive. Thankfully today, most game makers never need to see this deeply into the machine. High-level languages are more common.

    BASIC (Beginner’s All-purpose Symbolic Instruction Code)

    Designed to be simple, BASIC is easy to pick up and many of the instructions are similar to English words. If you are not very technical, this high-level language may be the best choice. As the name suggests, it’s a great starter language and you can make some pretty impressive games in BASIC. The language itself has more advanced forms, including Microsoft’s hugely popular Visual Basic.

    C

    C is actually a family of languages including C# and C++. For a career-programmer, fluency in these languages is your best chance of work. Although classed as a high-level language, C lets programmers get deep into the machine, in ways that BASIC or JavaScript simply can’t. It is also very portable, translating well to different computer hardware. If you are serious about programming you need to master C.

    HTML (Hyper Text Mark-up Language)

    The language that displays all of the web’s pages is constantly getting more powerful and more flexible. Now HTML can even power apps. There is lots of potential for making innovative games with HTML, especially when combined with JavaScript.

    Java

    Not to be confused with its descendent JavaScript, Java is an extremely portable high-level language, which means it can run on a large variety of hardware. Java was the main platform for feature phones (mobile phones before they got smart), although speed wasn’t its strongest feature. Now it is used by the Android development software and you’ll find Java powering all kinds of devices, including Blu-Ray players, TVs and set-top boxes.

    JavaScript

    This language is most commonly found in web pages, adding complex functions or generating special effects. Unity3D allows you to use this same language to build highly advanced games. If you already know some JavaScript, it’s an easy route into making games. Adobe Flash (see “Engines and Middleware” section later) uses a dialect of JavaScript called ActionScript.

    LUA

    A high-level language with a clean, simple structure. Although LUA is rarely used for developing actual games, it is often used in the scripting of levels and missions.

    Python

    Python is a high-level language, which some have described as “pseudo code” because of its readability. The Linux community speak very highly of Python and there are plenty of guides to help beginners, many of which are game oriented.


  • 5 Environment

    The word “environment” comes up a lot in game development and it’s used in several ways, so it’s worth taking a moment to look at this.

    Computer instructions are typed into development software, often called an “environment”. The term applies just as commonly to an in-game setting, or game world. The player controls a character, exploring a virtual environment.

    It can also refer to any other virtual space (Photoshop is an environment, so is Maya) or even the real desk you’re sitting at while you use the computer. That’s also your environment. It could get confusing.

    Whichever way you use the word, make sure you work in a happy, comfortable, organised environment. It’s important to be healthy and keep a good posture while you’re slaving at the screen for hours.

    Of course, “environment” can also refer to the planet we live on and making the best use of natural resources. Bonus points will be awarded if your studio is “green” or has a low-carbon approach to business. If your conscience isn’t enough to make that happen, there are often tax breaks for doing this.

    While we’re on the subject of healthy environments…

    Desktop Feng Shui

    Or “Zen and the art of environment maintenance.”

    An efficient workflow and organised tools make life easy. They are also the marks of a professional. A chef insists on sharp knives. A mechanic keeps tools and parts organised. An artist cleans brushes, or they become unusable. A surgeon must have completely sterile equipment or people will die. A guitarist waxes and tunes constantly to keep the right sound. Every profession shares the basic requirement to keep workspaces tidy and tools constantly mission-ready.

    “A place for everything and everything in its place.”

    - 17th century proverb.

    Game development is exactly the same. A cluttered or sluggish computer and half-functioning apps are not suitable tools. Taking care of them is extremely important – and this includes general housekeeping, like filing, sorting and emptying the trash. Backing up regularly is also part of it and even making sure batteries are charged. It’s all essential work.

    Although this sounds fairly dull, try to think of your computer as a finely tuned and powerful calculating instrument – because that’s exactly what it is. The more you look after it, the better it performs. You will also understand it at a much deeper level.


  • 6 Engines and middleware

    Now that we’ve chosen a language, we can use it to create the game engine. Like jets, spaceships, bikes and cars, the engine is the core program code that powers a game, handling all of the computer processes in the game system. Large game companies often write their own engines and refine them over years, using them in several games.

    Of course, when you are starting out in game development, it isn’t always practical to write your own game engine. It requires a lot of incredibly skilled work. Thankfully, there are plenty of ready-made engines available, also commonly known as “middleware”. As the name suggests, middleware acts as a go-between, giving the programmer lots of tools for communicating with the computer straight out of the box.

    Let me give you an example. A chef doesn’t want the hassle of growing vegetables, forging steel into utensils and killing the animals he spent years raising. He wants tools, ingredients and a familiar workspace, so he can just get on with cooking. Likewise, a programmer doesn’t want to start from scratch, writing every tiny little function from the ground up. Middleware is like a well-equipped kitchen for programmers. So let’s take a look at some of the code kitchens on offer.

    Android SDK (Language: Java)

    Available for Linux, Mac and Windows, the Android SDK (software development kit) is used for developing Android applications.

    App Game Kit (Language: BASIC or C)

    The App Game Kit, or AGK, is a convenient, easy way of creating apps for Android and iOS. They also run on a Windows PC. The free trial gives you access to most of the functions – enough to make and play your games - but you’ll need the full version to publish your apps to the stores.

    Dark Basic (Language: BASIC)

    Dark Basic has been around for a while now but still provides an easy system for making PC games. It’s great for learning or creating prototypes quickly.

    Flash (Language: ActionScript)

    Flash is still used on many websites, although it is cumbersome and gradually being replaced with lighter HTML 5 code. Adobe have retired the Android and Linux versions of Flash and its future remains uncertain. It is, however, one good way of making games and there are still vast audiences for them. Ferry Halsim’s beautifully crafted games demonstrate Flash well.
    http://www.orisinal.com

    Unity3D (Language: C or JavaScript)

    Unity3D is a popular cross-platform game engine that lets you develop games for a number of different systems, from Android and iPhone, through Windows and Linux, to Xbox and PlayStation. Unity is free for students and indie developers. The “pro” version contains more advanced features but costs.

    Unreal Engine (Language: C)

    This is the daddy. Initially created by Epic games for their own products, the Unreal Engine is now powering a lot of professional games from iPhone to Xbox and the license fee is serious. However, there is also a free version, the Unreal Development Kit.

    Take a look at Injustice: Gods Among Us to see the Unreal Engine in action.


  • 7 Additional middleware

    In addition to the main engine, other middleware can be plugged in to add new capabilities to the game. Many applications can combine to form really powerful suites of tools.

    HAVOK, physics engine

    Physics engines create real-world effects, like gravity and inertia, in virtual space. They use advanced mathematics to generate lifelike movement in 3D objects. Havok is one of the best known in games.

    SPEEDTREE, foliage generator

    SpeedTree does exactly what it says on the packaging. It populates game worlds with believable model trees. There’s a strong chance that you’ve already seen them and didn’t even notice, as SpeedTree is also being used in Hollywood movies like Iron Man 3, Star Trek: Into Darkness and Disney’s Maleficent.

    NAVIGATION, AI middleware

    Many game characters actually think for themselves, which is creepy but very clever. Whether choosing actions, picking a path through the environment, tracking movement, listening for player footsteps or even driving cars and flying ships, they think about lots of things. This, in game terms, is artificial intelligence and it’s complex to program, so middleware is a blessing. It’s also much more common than you might expect.

    This particular artificial intelligence middleware, Navigation, was formerly known as Kynapse. Now Autodesk have rebranded and upgraded it to fit more comfortably under their Gameware umbrella.

    Their software is used in games from Far Cry 4, Halo Wars, Street Fighter and Sims 4 to Batman: Arkham City, BioShock Infinite, Gears of War 3, Sonic the Hedgehog and Moshi Monsters: Moshling Rescue. Gameware powers the brains of gaming’s top characters.

    Now we have a computer running an operating system. We’ve packed it full of development software and we’re ready to sit down and start programming the actual game. So let’s get cooking.


  • 8 Process

    This is where the design document and flow charts come into their own. They provide a pattern to follow when creating the game’s code. Generally, the code will be in blocks that mimic the logical steps laid out in the flow charts.

    To make things complicated, a program is created from a collection of computer processes. Don’t confuse these software processes with the overall game development process!

    It’s good practice to keep areas of program code separate, so they don’t fight and get tangled up. There are three main groups for all code:

    • Input.
    • Processing.
    • Output.

    Below is an example of the different processes running in a typical game like Call of Duty on Xbox Live, or World of Warcraft on PC. It illustrates the code groups.

    Input

    • Check local player controls.
    • Check online player actions.
    • Receive network data.

    Processing

    • Internal clock: Keep all processes synchronised and updated.
    • Implement rules and follow game narrative.
    • Game status monitor: Check for win/lose conditions, pause, mute, exit, etc.
    • Check AI routines and respond.
    • Create visuals in off-screen work area.
    • Net traffic: Process network data.
    • Respond to player controls.
    • Error handling: If the software crashes, fail as gracefully as possible.

    Output

    • Send finished visuals to display device.
    • Send music and sound effects to the audio device.
    • Send feedback information to the controller.
    • Send network data.

    Each of the processes will have a number of sub-processes and they may also have sub-processes and so on. With so many little software processes floating around like jellyfish, it’s vital to keep everything carefully structured and organised. Untangling things later can be very painful!

    Start by plotting out the general structure, like a skeleton or framework, and then flesh it out. Don’t start with the details and work up. Block in the main elements and then add more detail to each part.

    After a few attempts at turning flow diagrams into real code, you’ll get much better at both designing flow charts and programming. Your early games won’t be as advanced as the previous example but it’s wise to get into good habits right from the start. It will make your life much easier later on!

    While the code is being created, various additional elements are required, like images and sound. The next phase covers making them.

    Next phase: ASSETS - Create visuals, audio and words.


Yes. Spanner's his real name. And, yes, he's heard that joke before.