You are on page 1of 40

1.2.

Introduction to Game Engines

Introduction to game engines and an overview of architecture

Introduction to Game Engines


Definition and features of a game engine

Definition of a game engine


A game engine is a piece of software designed for the creation and development of video games. It offers a number of components and/or tools which can be (re)used to economise game development. ore functionalit! t!picall! provided b! a game engine includes"
rendering engine (#$/ %$) scene graph collision detection (and response) ph!sics engine scripting animation artificial intelligence sound networ&ing streaming memor! management threading

Definition of a game engine


Game engines ma! also provide development tools and/or an integrated development environment to aid developers.

'ome game engines onl! provide real(time %$ rendering capabilities (providing attachment hoo&s for the other t!pes of needed game functionalit!). 'uch engines are generall! referred to as a graphics engine or rendering engine.

Platform and Hardware Abstraction


)an! game engines provide platform abstraction (i.e. the! can be run multiple platforms * including + s, consoles, handhelds, mobile devices, etc.). -!picall! the rendering s!stem in a game engine is built on top of a defined graphics A+I (e.g. $irect%$ or .penG/) providing access to the G+0. .ther libraries such as $irect1, .penA/, etc. ma! also be supported to provide hardware( independent access to input devices, sound cards, networ& cards, ph!sics accelerators, etc.

Com onent!based Architectures


E2tensibilit! within a game engine is important given the diverse and progressive nature of game development. As such, man! game engines adopt a component(based architecture, permitting engine components to be replaced or e2tended (either b! the developer or using specialised middleware components). ommon middleware components include" 3avo& (ph!sics), 4).$ (sound), 'caleform G42 (0I), 'peed-ree (trees/vegetation), 5in& (video), Grann! %$ (content/animation), etc.

Develo ment Histor"


Earl! games were t!picall! bespo&e and designed/developed from the ground up for a particular game with little/no reuse between games. -his was often necessitated b! the need to ma2imise performance given limited hardware capabilit!. -he game engine largel! emerged in the mid(6778s from 4+' games. -he popularit! of I$9s $oom and :ua&e entailed that other developers licensed core portions and added their own game assets and content. /ater games, i.e. I$9s :ua&e III or Epic9s 0nreal were design with reuse in mind (i.e. engine and content were cleanl! separated).

E#am le game engines


0nreal Engine (Epic Games) 'ource Engine (;alve id -ech < (id 'oftware) r!Engine ( r!te&)

orporation)

Gamebr!o Engine (Emergent Game -echnologies)

$ideo not available in on!line slides

Game Engine Architecture


%verview of &" ical Game Engine Architecture

Game Engine Architecture


-he is no archet!pal game engine architecture design, although, man! games engines will offer certain forms of functionalit!, or define common t!pes of component.

Game ' ecific 'ubs"stems


Game la" .oundations .ront!end

,endering engine

Animation $isual Effects

Human Interface Devices

Audio
'cene Gra h ) Culling Collision and Ph"sics ,enderer ,esource -anagement and Game Assets Core 'u ort and +tilit" '"stems

/etwor0ing

Platform Inde endence *a"er 'D(s ) Drivers ) %' Hardware

Hardware Hardware
-he target hardware la!er on which the game will run. A game engine ma! be capable of running on top of a number of hardware la!ers.

'D(s ) Drivers ) %' 'D(s)Drivers)%'


-!picall! some means of communicating with the underl!ing hardware is needed. -his can be accomplished using either device drivers or through A+Is e2posed b! the .'. In some cases, e.g. + s, the .' strongl! controls e2ecution of the game engine (which is one e2ecuting process amongst man!). )ost game engines use %rd part! '$=s to provide access to"
>ead! made data(structures and algorithms (e.g. '-/ or 5oost in Graphics hardware (e.g. $irect1 or .penG/) ollision detection and +h!sics (e.g. 3avo&, +h!s1 or .$E) etc.

??)

Platform Inde endence *a"er Platform Inde endence


Game engines which can run across multiple platforms often provide an abstraction la!er hiding platform specific differences from higher(level la!ers. -he platform independence la!er assures that standard data t!pes, libraries, fundamental A+Is, etc. offer consistent behaviour across the different supported platforms. 'upported abstractions can include"

+latform Independence /a!er


Atomic Data &" es
Collections and Iterators

.ile '"stem

/etwor0 &rans ort *a"er

&hreadi ng *ibrar"

Gra hic s 1ra er s

Core 'u Core '"stems

ort and +tilit" '"stems

In order to function game engines t!picall! depend upon underl!ing utilit! and support classes. $epending upon the game engine, this might include"
Core 'u ort and +tilit" '"stems -ath *ibrar"
Debug Printing and *ogging

-emor" Allocatio n Assertio ns

*ocali2ati on 'ervices
/etwor0 &rans ort *a"er

Profiling ) 'tats Gathering

,andom /umber Generator

Parser s

-ovie Pla"er

,&&I ) ,eflection 3 'eriali2ation

As"nchrono us .ile I)%

,esource -anagement and Game Assets Game Assets

-he resource manager provides a unified means of accessing the different t!pes of game asset and other engine input data, including but not necessaril! limited to model meshes, te2tures, fonts, s&eletal animation data, game/world maps, etc.

.ront!end

$isual Effects 'cene Gra h ) Culling ,enderer

-he rendering engine within a game engine tends to be a large and comple2 component which is often decomposed into separate la!ers

Rendering engine

,endering Engine

,enderer

,enderer

-his component encapsulates all the raw rendering facilities of the engine, providing a means of rendering a collection of geometric primitives as @uic&l! as possible. 'upported geometric primitives ma! include triangle meshes, line lists, point lists, particles, etc.

-his component t!picall! accesses the graphics device interface (possibl! through a defined platform independence la!er) and acts to configure the hardware state and game shaders using some defined material system and dynamic lighting system.

'cene Gra h ) Culling


It is the Aob of the scene graph to limit the number of geometric primitives sent to the renderer based on some form of visibilit! determination. -!picall! some form of world spatial decomposition (bsp tree, bounding volume hierarch!, etc.) is emplo!ed to build a set of potentiall! visible obAects.

'cene Gra h ) Culling

$isual Effects
-he rendering engine might provide support for the following t!pes of visual effect"
+article effects $ecal s!stem $!namic shadows /ight/environmental mapping 4ull(screen post render effects

$isual Effects

(e.g. 3$>, 4'AA, colour correction, etc.).

.ront End
A front end component provides a means of rendering #$ graphics (possibl! overlaid on top of a %$ scene), providing"
Game front end and menus In game 3ead(up(displa! (30$) In game graphical user interface (e.g. for

.ront!end

inventor! screens, etc.)


$ebugging and other tools (e.g. console)

Collisions and Ph"sics

Collision and Ph"sics

Bhilst collision detection and a real(time d!namics simulator can be separate entities, the! are often found together given the interdependence of ph!sics on collision detection. Given the comple2it! of both areas, most engines rel! upon a %rd part! '$= (e.g. 3avo&, etc.). A collision detection s!stem is often of use within a wide range of non(ph!sics related component.

Animation
)ost current game engines support s&eletal animation, permitting a mesh to be posed using a s!stem of bones. +oses are t!picall! interpolated or combined to produce a palette of matrices used to render the mesh parts (a process &nown as s&inning).

Animation

Animation

Animatio n 'tate &rees

Inverse (inemati cs

*E,P and additive blending

Animati on Pla"bac 0

'ub! s0eletal Animation

Animation Decom ressi on

Human Interface Devices

Human Interface Devices

Games often support a number of different forms of pla!er interface device, including"
=e!board and )ouse Gamepad 'pecialised

ontrollers (e.g. Bii 4it 5oard, dance pads, steering wheels).

It is often the role of this component to abstract the mapping of ph!sical controls and logical game functions. -he component ma! also embed support for detecting multiple simultaneous button presses and/or input se@uences, etc.

Audio

Audio

-he sophistication of audio engines between different game engines differs considerabl!. )ore advanced audio engines offer wide support for different input sound formats, including streaming, and output spea&er arrangements. Additionall!, different forms of pla!bac& support, including audio effects, ma! also be supported.

/etwor0ing
Game engines t!picall! provide support permitting multiple computers/ consoles to be lin&ed together in some form of mutli(pla!er game. -his is a different environment to massivel! multipla!er online games ()).Gs) where thousands of pla!ers are t!picall! managed using a server farm.

/etwor0ing

/etwor0ing
-atch! ma0ing and Game -agagement %b4ect Authorit" Polic"

Game 'tate ,e licatio n

Game la" .oundations Game la" .oundations


Gamepla! refers to the actions which ta&e place within the game. Gamepla! is either implemented using the same language as that used to create the underl!ing game engine, or through a higher(level scripting language, or some combination of both. -he gamepla! foundations la!er offers utilities of use to gamepla! formation and a means of readil! accessing some of the lower(level engine components.

Game la" .oundations High!level Game .low '"stem 'cri ting '"stem Game 1orld
D"namic Game %b4ects

'tatic 1orld Elements

Event) -essaging '"stem

Game la" .oundations Game la" .oundations


Game Borld -he gamepla! foundations la!er ma! define the game world structure in terms of both static (e.g. bac&ground geometr!) and d!namic obAects (e.g. C+ s, rigid bodies subAect to ph!sics). Event / )essaging '!stem In order to permit game obAects to communicate and interact an event based messaging s!stem is often emplo!ed.

Game la" .oundations Game la" .oundations


'cripting '!stem A scripting s!stem ma! be emplo!ed in order to provide more rapid, accessible and convenient development of gamepla! rules and content. -!picall! using an interpreted scripting language avoids the need to rebuild the code base given a gamepla! change.

3igh(/evel Game 4low '!stem 3igh(level control mechanisms, such as finite(state machines, etc. ma! be embedded within the gamepla! foundations la!er and made avaiable to the game specific sub(s!stems.

$ideo not available in on!line slides

-ools and -he Asset +ipeline


Game Engine &ools and the Asset Pi eline

$ideo not available in on!line slides

& ools and the Asset Pi eline


Game engines consume a lot of data in order to construct and pla! a game, including game assets, 'ound configuration files, scripts, etc" Animation '0eletal &e#tures
5an0
&ree Hierarch"

-esh

Particle '"stem

Asset Conditioning Pi eline

Borld Editor

Game Engine

Content Creation & ools


-he graphical and aural assets used within a game are t!picall! created using various digital content creation tools. 'ome e2amples of common tools include"
Autodes& )a!a (models and animation) %ds )a2 (models and animation) Adobe +hotoshop (te2tures) 'ound4orge (audio)

Asset Conditioning Pi eline


Bhilst content creation tools can e2port data in different formats, such output often needs to be Dconditioned9 before being usable within a game engine. -his is t!picall! done if the content creation tool e2ports data that" ontains more information than is needed, or structures the
information in inconvenient manner.
Is stored in a file format that is either closed proprietar! or cannot

be read sufficientl! @uic&l! at run time. A game engine which targets multiple platforms ma! also wish to store assets in a common game engine format suitable for deplo!ment across multiple platforms.

$ideo not available in on!line slides

$irected >eading
Directed reading on game engine architecture

Directed reading
)ore information on an overview of game engine architecture can be found

on pages <(<< of Game Engine Architecture.


Information on basic software engineering for games can be found on

pages 76(6%< of Game Engine Architecture


3ighl! recommended" Information on means of representing and updating

game obAects (d!namic and static) within a game engine can be found pages EFG(G7% of Game Engine Architecture

'ummar"
-oda! we e2plored"
1hat is a

game engine
&he t" es of

&o do6

,ead the

core com onents found within a game engine


&he tools and

asset i eline which feed into a game engine

ected ir d d e d n e m recom reading he t f o s t c e s a Identif" ou " h ic h w e in g game en l" find articular interesting

You might also like