Day 2: What Is a Game Engine?

A game engine is a system designed for the creation and development of video games. The capabilities of game engines are different one to another. Some game engines only provide a basic framework through which you can program your games in a high level without thinking of the technical subtleties. Others provide a user interface in which you can visually create your entire game, without the need for a line of code. Below is a screenshot of the 2013 game Gone Home, built using the Unity game engine.

Gone Home - 2013

If we are to design any form of game engine, no matter how simple, we need to understand the concept first. For this reason we break a game engine into its building blocks.

Components of a game engine

Rendering engine

We talked about rendering in the first day. Real-time rendering engines are available in different forms. The most famous real-time rendering engines are OpenGL and Direct3D. OpenGL, as we discussed before, is available for a wide range of devices, including mobile phones. A game engine is often built on top of one of these graphics engines, and uses it in the lower level. However, what the game developer observes is often a high level graphics framework that is easier to work with.

Physics engine

You can hardly find any 3-dimensional game that does not involve physics. By physics I do not necessarily mean sophisticated cloth motion and throwing of objects around in a physically accurate fashion. Collision-detection is the simplest form of physics, found in most story-based games. If your character does not sink into walls and cannot pass through some objects, the game you are playing has physics. Of course, some physics engines provide complex functionality. Ropes, cloth, and inverse kinematics (see example) are some of the features provided by modern physics engines.

Animation

Game engines provide high level frameworks for animation. The underlying graphics engine knows nothing but images (called textures), models (called meshes), and vectors. Introducing high level concepts such as sprites, characters, and environments is the task of the game engine. It translates a humanly comprehensible representation of the game into what the computer expects.

Sound

Playing sounds is an essential part of every game. A game engine is usually equipped with easy-to-use functions to provide audio capabilities a game needs and conforms it to the capabilities of the underlying system. Caching, 3D sound effects and dynamic volume control are some functions of this component.

Scripting

A script is a series of commands used to perform a task. Modern games are often equipped with a scripting language (such as lua) that can do tasks for them in run-time. Compiling and running a game again for every simple change can be a lengthy process. Scripting helps the developer to do some tasks on-the-fly. A modern game consists of a series of scripts that handle specific tasks in the game. A level can be a script that runs when it is loading. The artificial intelligence of the enemies can be scripts. And you might have already noticed scripting consoles in games like Counter-Strike. Scripting is not limited to desktop games. It might come as a surprise that even Angry Birds uses scripting.

Networking

Massive multiplayers are becoming more and more popular, and game engines have responded to this fact. Networking in a game has many subtleties. Maintaining connections and passing information between users in an efficient manner are difficult tasks if done from scratch. There are, thankfully, software that make this easy. An example of such software is Steam, which provides digital distribution, digital rights management, multiplayer, and communications for games. There are other examples as well. When it comes to mobile phones, iTunes, Google Play, and Amazon Appstore all have their own communication platforms for games. Game engines can come with support for one or more of these frameworks for networking.

Scene graph

This is one of the advanced components of game engines. A scene graph is a graphical representation of a game scene that is easy to understand. Some game engines have an advanced scene graph manager on which you can visually design your game, and even fiddle with it while the game is running. Each item in the scene graph represents something in the game, and you can define relationships and interactions between them. Below you can scene a simple scene graph from the Unity game engine.

Unity Scene Graph

Artificial intelligence

The term can refer to something as simple as tic-tac-toe logic, or something as subtle as a game enemy soldier making battle decisions. It is the ability of the computer to think. A game engine might come with a set of features for artificial intelligence, depending in the type of the game engine and game genres it is designed for.

Examples and notes

Now that you have some idea of what a game engine is, it is worthwhile to take a glance at some of the world’s leading game engines. I have included a short list of games that are build on those engines. I have also linked them to their Wikipedia pages rather than their official home pages, so you can have a read about them.

  • Unreal Engine: Unreal Tournament, Sanctum, Devil May Cry, America’s Army, RoboBlitz
  • CryEngine: Far Cry, Crysis, Evolve, God Slayer, Warfare, Aion: Tower of Eternity
  • Havok Vision Engine: Arcania: Gothic 4, Carnival Island, Orcs Must Die!, Soul Worker
  • Unity: Bad Piggies, Castle Story, Dead Trigger 2, République, Wasteland 2

I finish this day with one note. Components described today are what game engines usually support. But it does not mean that a game engine must have all of them, and it does not mean that they are separable modules. Game engines and software components they rely on are more subtle than this. Sometimes some of these features are combined together and a single package has a touch on all of them. An example is Euphoria, which combines artificial intelligence, physics, and animation, to provide extremely realistic character animation. Grand Theft Auto IV engine and Max Payne 3 use Euphoria for pedestrians and other non-player characters. Here is the promotional video for Euphoria engine: