How to make a videogame ?
How do you create a video game? This is a question all we have probably asked ourselves, especially when we were younger.
You may think that creating a video game is a very complicated task that requires a large amount of knowledge in programming, mathematics and physics knowledge to develop a good title, but this is not entirely true. Whatever the type of game you want to develop (2D, 3D, RPG, FP…) and the platform on which you want to run it (PC, game console, Smartphone, etc.), there are two ways to create a video game:
-
Programming everything
-
or using development engines
The first one is the most complex since the programmer must create all the elements of the game, from the physics (which involves very advanced mathematics), the characters, the animations, rendering, among many other elements. This is the way big studios like Ubisoft or Innsomnia work, which despite the complexity, gives them complete control of the development; and most importantly, it allows a high level of optimization. When a company develop a new title, for example, to coincide with the release of a new film, it is common for the game to be available on multiple platforms. This is a challenge, given that not all of them have the same level of computing power, nor the same controls, so it is necessary to adapt the title to work correctly on each of these platforms.
The second option is the use of development engines, which are programs with a huge variety of mathematical functions already implemented that simplify game development. This option is most used by independent developers, also known as “Indie” developers, who are video-game programmers without the financial support of large video-game companies.
In the last option, we can divide development engines in two very different categories: witch require programming and witch do not. But, What does this mean? Like a table is made of wood, a game is made of lines of code running in real time to display the characters, the sceneries, register the keys pressed by the user, etc. Since this code must be executed by a machine, it is made in a language that can be understood by it, more specifically it is made of zeros and ones, binary codification.
But writing a program in binary notation is a complex and inefficient task. Therefore, so-called “high-level languages” are used. These are like the different languages that exist in the world; each of them has its own grammar, vocabulary and peculiarities, but all of them can transmit the same message: ‘hola’, ‘hello’, ‘salut’, ‘hallo’, ‘ciao’, ‘olá’, ‘hej’. In programming, there is a wide variety of programming languages, such as C, C++, C#, Java, JavaScript, PHP, Pascal, among many others. Each of them has its own advantages and disadvantages, for example C and its variants are widespread and it is possible to find libraries and examples to do almost everything. However, it is a program compiled for Windows, so it will not work on Linux or Mac, which is possible in other languages such as Java.
Thanks to these high-level languages, we can write our program in a language that is more understandable to us, and then, through a process called “compilation”, we will convert our code to binary (machine code), as we can see in Figure 1.
Figure 1. Code compilation to binary
As we have mentioned before, there are other types of development engines in which it is not necessary to write any line of code, but instead they have a graphic programming system. This is the case of Scratch™, the programming engine we will use in this course to learn how to create our own video-games. It provides a series of puzzle pieces, which are interconnected with each other to create our games in a very quick and simple way. Each of these pieces is a set of pre-defined lines of code, which significantly reduces learning and development time.
Figure 2. Scratch™ logo
Although in the next lesson, we will go in deep into the interface and the basic fundamentals of programming, it is necessary to make clear that this environment is intended to introduce the user to the world of programming, and therefore, it presents an important limitation with respect to other environments such as Unity™ or Unreal™ (very popular among Indie studios). One of the major limitations is that it does not allow the development of 3D video games, although with a little ingenuity, it is possible to create games in 2.5D, which is the name given to a technique that, from flat images, build scenarios that give the impression of being in 3D, although they really are not.
The well known game ‘DOOM’ used this technique which was a big revolution in the 1990s (Figure 3).
Figure 3. Scene from the game ‘DOOM’ using the 2.5D technique. Image from Stream™