A triple-A video game might take a decade to build, require a team, or multiple teams, of hundreds of people, and requires tens of millions of dollars to capitalise. Their development cycles are normally sagas themselves, filled with tales of endless crunch time and developer burnout.
Billions of people every year play video games in one form or another, whether that is on their mobile phone, one of the dedicated games consoles, or on the PC. And yet, despite their massive popularity, most people have no real insight into how games are created; they can’t tell their cell-shaders from their GUI elements.
In this article, we’ll be breaking down some of the basic building blocks of how our favourite video games are made and how some of those basics haven’t really changed since they were used in the arcade version of Donkey Kong.
Textures and Polygons
One very basic element in any video game is the ability to create 3D objects. In order to do this, most gaming software uses polygons. A polygon is, at its most basic, any area defined by at least three lines. These three lines are used to connect coordinates in the 3D “world” that the game creates.
The point where these lines interconnect is called a vertex and each vertex has X, Y and Z coordinates. These coordinates tell the shape where to be. How far up or down, left or right, back or forward it should be. Once the game knows the shape of the 3D object it is creating and what its position should be, it then needs to know what it should look like. Which is where textures come in.
A texture is a 2D image that is applied, like a decal, to the 3D shape created by the polygons. If the walls in your video game are created by polygons, then the brick pattern, or wallpaper, or bullet holes on that wall are created by putting textures over those polygons. The more complicated the polygon and textures, the more detailed those objects can become. However, rendering complex polygons and textures uses up memory and graphics processing power. So, the prettier the game, the more it taxes your computer.
Shaders and Light
Games like The Witcher 3 have rightly won awards based, at least partly, on their ability to create something close to realistic lighting conditions. Flickering torches, sputtering campfires, sunsets, and dappled light coming through trees all help to draw the player into the game.
Modern games create their lighting effects through some very technical processes, but one of the most basic is using shaders to affect how each pixel is represented. A pixel is basically the smallest part of an image and shaders tell those pixels what colour to be. As you walk down a hall with a lit torch in-game, the shaders are telling the pixels closest to the light source to be the brightest and then fade to black as the light source moves away from them.
Once you have your 3D shape, its position in the 3D world, and its image properties, you might then need to interact with the world around it, especially if it represents something living in that game world.
How elements in a game make decisions is often referred to as artificial intelligence, but in reality, it is more like machine learning. The object you have created follows a rule set and uses those rules to decide what it’s doing and how it reacts to input. AI for in-game objects can either be relatively simple or fantastically complicated, depending on the game and the console the game is running on.
Random Number Generation
RNG, or random number generation, is a simple-sounding concept that underpins a huge amount of gaming content. The ability to produce a non-biased random number underpins everything from what treasure you get in Skyrim, your attacks in World of Warcraft, and nearly everything you can play on SkyVegas.
RNG in-game is essentially like rolling the dice when you are playing an RPG. It produces a random number that can then be modified by other numbers, adding an element of randomness to the game that replicates, to an extent, how random elements affect our day to day lives.
The Basics of Gaming
Taken together, textures, polygons, shaders, AI, and RNG represent some of the more basic building blocks of video games. Despite the huge strides forward that video games have seen in just the last decade, these basics still play an integral part in game creation.