Module 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

Game Engine Architecture

Chapter 1
Introduction

Dr. S. Graceline Jasmine, SCOPE

Vellore Institute of Technology, Chennai


Runtime Engine Architecture
• Consists of the tools suite and runtime
components
• Large
▫ Spans hardware to high-level application
• Designed in layers
▫ Avoids circular dependencies to maximize reuse
and testability
Runtime Engine
Runtime Engine
• Low level components
• 3rd Party SDKs
• Platform independence layer
• Core systems
• Resources manager
• Rendering engine
• Profiling/Debugging
• Collisions and Physics
• Animation
• Human Interface Devices
• Audio
• Gameplay foundation system
Low level components

• Hardware
▫ This is the system that the game is to run on
• Device Drivers
▫ Shield the OS and upper layers from low level device
communications details
• Operating System
▫ Handles the execution and interruption of multiple
programs on a single machine
▫ Very thin on a console
3rd Party SDKs
• Data Structure and Algorithms
▫ STL – C++ standard template library data structures, strings, stream-based I/O
▫ Boost – powerful data structures and algorithms
 Boost libraries are intended to be widely useful, and usable across a broad spectrum of
applications. For example, they are helpful for handling large numbers having range
beyond the long long, long double data type (264) in C++.
• Graphics
▫ OpenGL and DirectX
• Collisions and Physics
▫ Havok, PhysX, ODE, Bullet
• Character Animation
• Artificial Intelligence – Kynapse
Platform independence layer
• Allows the engine to be developed without
the concern of the underlying platform
• Provides wrappers to common target
specific operations
• Include things like primitive types,
network, file systems, etc.
Core systems
• Assertions – error checking code
• Memory Management
• Math library – vector and matrix
math, numeric integrators
• Custom data structures
Resource manager
• Provides a unified interface for accessing assets
• The level of complexity is dictated by need
▫ Often the game programmers must do resource loading
directly
▫ Engines like UT do unpackaging and complex
manipulation of assets in the engine
Rendering
Rendering is the process of computing an image from contents of a
scene.

The renderer is responsible for gathering everything that should be


on the screen, and how it should look and getting it there.

Creation:
➢ The creation of 3D and 2D images use different principles.

➢ To make a 2D rendering, you need to have a firm grasp of


geometry, because a 2D model uses lines, shapes and symmetry.

➢ To make a 3D rendering, you need to use mathematics.


Rendering engine
• Low-level
• Scene graph management
• Visual effects
• Front end
Low-level Renderer
• Focuses on rendering primitives as quickly and richly as possible
▫ Does not consider visibility
• Graphics Device Interface
▫ Access and enumerate the graphics devices
▫ Initialize the GD
▫ Setup buffering
• Others
▫ Representation of the geometric primitives
▫ Abstraction of the camera interface
▫ Material system
▫ Dynamic lighting system
▫ Text and fonts
Graphics Objects
• Gameobjects- Anything to which components are attached
▫ Aggregation of other game objects

• Canvas – It is user interface which is normally the top most layer displaying
the game scores
• Layer – The various layers that hold gameobjects together
▫ Layer 0 has the full visibility
▫ Other layers may be occluded(hidden) based on the objects in other layers

• Sprite-are simple 2D objects that have graphical images (called textures) on


them. Whenever Unity makes a new sprite, it uses a texture. This texture
is then applied on a fresh GameObject, and a Sprite Renderer component
is attached to it.

• A renderer is what makes an object appear on the screen. Use this class to
access the renderer of any object, mesh or Particle
System. Renderers can be disabled to make objects invisible (see enabled)
Scene graph
• A scene graph is a data structure that arranges a graphical scene.

• A scene graph contains Node objects in a tree structure.


Scene graph
• Limits the number of primitives submitted for
rendering
• Uses frustum culling – remove things outside of
the visible screen
• Spatial subdivision
▫ BSP, quadtree, octree, kd-tree
Visual effects
• Particle systems
• Decal systems
• Light mapping
• Dynamic shadows
• Full screen post effects
Front end
• HUD
• Menus
• GUI for character manipulation
• Full-motion video for cut scenes
Profiling/Debugging
• Code timing
• Display stats on the screen
• Dumping performance stats
• Determining memory usage
• Dumping memory usage
• Record and playback game events
• Print statement output control
Collisions and Physics
• Usually rigid body dynamics
• Physics engine creation is its own unique
undertaking
• Many companies use available libraries
▫ Havok
▫ PhysX
▫ ODE
▫ Bullet
Animation

• Five types of animation are used


▫ Sprite/texture animation
▫ Rigid body hierarchy animation
▫ Skeletal animation
▫ Vertex animation
▫ Morphing
• Skeletal animations still the most popular
HID
• Keyboard and mouse abstractions
• Joypads
• Specialized controllers
• Massages raw data into useful
information
Audio

• Often overlooked until the end


• Varies in sophistication based
on need
• Many games use existing tools
▫ XACT
▫ Scream
Multiplayer/networking
• Four main flavors
▫ Single screen – multiple players on the same screen
▫ Split-screen multiplayer – multiple perspectives on
the same screen
▫ Networked multiplayer – multiple computers
networked together
▫ Massive multiplayer online games – run in a central
server
• Difficult to convert single to
multiplayer, easy to do the opposite
Gameplay foundation system
• Most everything that makes the game a game
• World loading
• Game object model
• Static world elements
• Real-time agent simulations
Event system
• Objects need to communicate with one another
• Easiest to handle this through a common system
• Objects send messages that are routed to the
event handler
Scripting system
• Allows for the creation on new game logic
without recompiling
• Speeds software development considerably
Artificial intelligence foundations
• Provides AI building blocks
▫ Path planning
▫ Nav mesh generation
▫ Object avoidance
• Autodesk has a middleware called Gameware
that provides many of these features
Game-specific subsystems

• All of the specific stuff needed for a game


• This layer could be considered outside of the
game engine itself
Tools and the asset pipeline
Digital content creation
• Game engines deal with data in many forms
• The data has to be created somehow
▫ 3D Meshes
▫ Textures
▫ Sound
▫ Animations
• Often created using outside tools
▫ Maya/3ds Max
▫ Photoshop
▫ SoundForge
• DCC tools need to be easy to use and very reliable
Assets conditioning pipeline
• DCC tools produce a variety of file formats that
are not optimized for game
• Game engines usually store the data in an easy
to read and platform specific format
• The ACP does this translation
Conditioning assets
• 3D Model/Mesh data
▫ 3D Models – Must be properly tessellated
▫ Brush Geometry – A collection of convex hulls with
multiple planes
• Skeletal animation data
▫ Must be compressed and converted to properly work
• Audio data
▫ Should convert multiple formats to a single format for
the target system
• Particle system data
▫ Usually need a custom editing tool within the engine
Game world editor
• Usually integrated into the engine
• Essential to allow game designers to work with
the engine
• Many examples
▫ UnrealEd
▫ Hammer
▫ Radiant
Resource database
• Need a way to store and manage the vast
amounts of data
• Some companies use relational databases
▫ MySQL or Oracle
• Some companies use version control software
▫ Subversion, Perforce, or GIT
• Still others use custom software
▫ Naughty Dog uses a custom GUI called Builder
Approaches to Tool Architecture
Stand alone Integrated
Web-based tools
• Various uses
▫ Asset management
▫ Scheduling
▫ Bug management
• Easier to build
▫ Usually easier to build than a stand alone
application
▫ Easier to update without forcing a reinstall
• If it just needs to present tabular data and have
forms – use a web interface

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy