Game Frameworks  
Lecture 01: Introduction to Game Engines  
Edirlei Soares de Lima  
<edirlei.lima@universidadeeuropeia.pt>  
What is a Game Framework?  
A game engine, also known as game  
framework, is a software designed for  
people to create games.  
Programming libraries vs complete frameworks  
A game engine is extensible and can be  
used as the foundation for developing  
many different games without major  
modification.  
Examples:  
Quake engine (1996), Unreal Engine (1998),  
Source Engine (2004), CryENGINE (2004) ,  
Microsoft XNA (2006), Unity (2005), Frostbite  
Engine (2008), etc...  
Examples of Game Engines  
Unity  
https://unity.com/  
Unreal Engine  
https://www.unrealengine.com
Examples of Game Engines  
CryENGINE  
https://www.cryengine.com/  
Godot  
https://godotengine.org/  
Examples of Game Engines  
GameMaker  
https://www.yoyogames.com/g  
amemaker  
RPG Maker  
https://www.rpgmakerweb.com  
Game Engine Architecture  
A game engine generally consists of a runtime component and  
a tool suite.  
Like most software systems, game engines are built in layers.  
.
.
.
.
.
.
.
.
.
.
.
.
Digital Content Creation Tools  
A game engine’s input data comes in a wide  
variety of forms (3D mesh data, texture  
bitmaps, animation data, audio files).  
All of this source data must be created and  
manipulated by artists.  
Game Engine Architecture  
A game engine’s tool suite may be architected in any number  
of ways:  
Stand-alone pieces of software;  
Built on top of some of the lower  
layers used by the runtime  
engine;  
Built into the game itself.  
Low-Level Engine Systems  
Low-level support systems:  
Crucial tasks: starting up and shutting down the engine, managing the  
engine’s memory usage, handling access to file systems, providing  
access to a wide range of asset types, and providing debugging tools.  
Example: Optimizing Dynamic Memory Allocation  
Problem: Memory Fragmentation  
Low-Level Engine Systems  
Low-level support systems:  
Example: Optimizing Dynamic Memory Allocation  
Stack-Based Allocators  
Double-Ended Stack Allocators  
Low-Level Engine Systems  
Low-level support systems:  
Example: Optimizing Dynamic Memory Allocation  
Low-Level Engine Systems  
Low-level support systems:  
Example: Optimizing Dynamic Memory Allocation  
When differently sized objects are being allocated and freed in a random order,  
neither a stack-based allocator nor a pool-based allocator can be used.  
Solution: periodically defragmenting the heap  
Low-Level Engine Systems  
Low-level support systems:  
Example: Game Loop  
while (!quit)  
{
updateCamera();  
updateSceneElements();  
renderScene();  
swapBuffers();  
}
A game is composed of many subsystems that require periodic servicing (updates)  
while the game is running: device I/O, rendering, animation, collision detection,  
rigid body simulation, multiplayer networking, audio, etc.  
The rate at which these subsystems need to be serviced varies from subsystem to  
subsystem.  
Low-Level Engine Systems  
Low-level support systems:  
Example: Game Loop  
Multiprocessor Game Loops  
Rendering Engine  
One of the basic tasks of a game engine is rendering 2D or 3D  
objects:  
Taking a scene, or model, composed of many geometric objects arranged  
in 3D space and producing a 2D image that shows the objects as viewed  
from a particular viewpoint.  
Rendering involves considering how each object contributes to each pixel.  
Rendering Engine  
Rendering Pipeline:  
Rendering Engine  
Example of problem: aliasing  
Rendering Engine  
Optimizations: handling large game worlds  
Scene graphs: quadtrees, octrees, BSP trees, etc.  
Animation Systems  
The majority of modern games revolve around characters that  
need to move in a fluid and organic way.  
Sprite animation:  
Skinned animation:  
Animation Systems  
Example of problem: animation blending  
Physics Engine  
Rigid body dynamics and collision detection.  
Rigid body: infinitely hard and non-deformable solid object.  
Dynamics: process of determining how rigid bodies move and interact  
over time under the influence of forces.  
Many game engines make use of a physics middleware:  
PhysX: https://developer.nvidia.com/physx-sdk  
Havok: https://www.havok.com/havok-physics/  
ODE: http://www.ode.org/  
Audio Engine  
Games immerse the player in a realistic virtual environment  
and audio is an important tool to accurately reproduce what  
the player would actually hear if he were present in that  
environment.  
Audio Engine  
As the rendering process, audio also can have a dedicated  
pipeline.  
Audio Engine  
Context-Sensitive Dialog  
Further Reading  
Gregory, J. (2014). Game Engine Architecture (2nd ed.). Boca Raton, FL: A  
K Peters/CRC Press. ISBN: 978-1-4665-6001-7  
Part I: Foundations  
Part II: Low-Level Engine Systems  
Part III: Graphics, Motion and Sound