Run-Time Game Engine Architecture Run-Through
Here’s a REALLY quick run-through of a typical game engine’s run-time architecture:
*The colours are not representative of relationships between components.
**The black lines show connections/relationships between components.
This is a rough visual representation of run-time game engine architecture.
Everything is built in layers: the highest level is the game-specific subsystems and the lowest level is the game’s hardware. I’m going to go through the different components one at a time, starting from the lowest level and working my way up, giving a rough description of each.
The lowest level is the target Hardware, or whatever platform the game is meant to be played on. Typical platforms are PC, Xbox 360, Playstation, 3DS, Wii, etc. The only ones I currently know to use are PC and Android; they are the most user-friendly and accessible platforms to release games on. The hardware influences just about everything higher than it, because it dictates the interactions and capabilities of the game.
Device Drivers are next; they are low-level software components that are beneath the operating system and make it work. They manage hardware resources and make the transition between the operating system and the hardware easier.
The Operating System is always running, and is what users interact with. Windows is an example on the PC, and any game on the PC needs to be compatible with the operating system it is meant to work with (i.e. games made for Windows 7 may not work on Windows 8). On consoles, it's the same thing, even going so far as to interrupt gameplay in order to display messages, or give players access to their main menu. On Xbox, this may be the dashboard, PS3 has the Xross media bar, and the 3DS has the home menu.
Third-Party SDKs has a bit more involved with it than the 3 lower levels. There are a number of third-party software development kits available, such as STL (Standard Template Library), BOOST, Loki, DirectX, OpenGL, Havok, PhsyX, etc. They are used for a variety of different purposes within the game engine, and often there are more than one implemented at once. For example, Bullet Physics may be in use for the physics part of the engine, and OpenGL for the graphics.
The Platform Independence Layer is a way of ensuring consistent behavior across all hardware platforms. It may include platform detection, atomic data types, collections and iterators, a file system, hi-res timer, threading library, graphics wrappers, and the physics/collision wrapper.
The Core Systems contains a handy collection of software utilities, or "core systems". A few facilities that may be provided here are: assertions, unit testing, memory allocation, math library, strings, movie player, parsers, random number generator, curves and surfaces library, object handles and unique IDs, and file I/O. Awful useful to have all bundled together in one convenient place.
The Resource Manager is always present in a game engine in some way or another. It is what provides the interface for dealing with any and all game assets and input data. Typically contains resources for 3D models, textures, materials, fonts, skeletons, collision, physics, and the game world or map.
The rendering engine is typically always the largest and most complex component of any game engine. There are so many different ways to make it work that there is no one "right way" to do it. One of the most common ways to implement it is by making a layered architecture of the low-level renderer, scene graph, visual effects, and front end.
The Low-Level Renderer takes care of all the raw rendering required in the engine. It focuses mostly on geometric primitives and spits them out as quickly and with as much quality as possible. It's subcomponents are: materials and shaders, static and dynamic lighting, cameras, texts and fonts, primitive submission, viewports and virtual screens, texture and surface management, and debug drawing.
The next level of the rendering engine is the Scene Graph or Culling Optimizations, a higher-level component which helps to limit the number of primitives depending on the visibility of the scene. This is where techniques like frustum culling and spatial subdivision are done. Occlusion is another commonly used technique.
The next level in the rendering engine is the Visual Effects layer. No modern game is complete without an array of visual effects such as particles, decals, shadows, and pretty shader effects. This takes care of all the specialized rendering needs of the visual effects. Some of the most common visual effects are: light mapping and dynamic shadows, HDR lighting, PRT lighting, subsurf, scatter, particles and decal systems, post effects (effects done on the entire screen after other rendering effects have already been applied), and environment mapping.
The Front End is the highest level in the engine renderer, and takes care of the 2D graphics display that is typically overlaid on the game scene. This has various uses: HUD, in-game menus, in-game GUI, wrappers or attract mode, in-game cinematics, and full-motion video are just a few examples.
Next to the engine renderer is the Profiling and Debugging Tools, which include recording and playback, memory and performance stats, and in-game menus or console. Profiling your game helps to optimize the performance.
It wouldn't be much of a game without Collision and Physics; that which defines player behavior and how things react to each other. This component defines the forces and constraints, ray or shape casting, the rigid bodies (always important :D), phantoms, shapes or collidables, physics or collision world, and ragdoll physics of the game.
The Animation component of the engine is a necessity (as I've learned it's hard to work without it) in any engine. Whether you want sprites, morph targets, rigid body hierarchy, or skeletons, this is the part of the game engine which is supposed to deal with them. It includes: animation state tree and layers, inverse kinematics, game-specific post-processing, LERP and additive blending, animation playback, sub-skeletal animation, and animation decompression.
Human Interface Devices (or HID) are what allow the player to interact with the game and is what makes games different from other entertainment medias. Examples of HIDs are: keyboard and/or mouse, joypad, gamepad, steering wheel, WiiMote, dance pads, etc. It works with the game-specific interface as well as the physical device I/O.
The next level is the Audio of the game. No game is complete without a good soundtrack. Can you imagine a horror game without creepy music or an adventure game without that motivational music? This needs DSP or effects, a 3D audio model, and audio playback and management.
What's next? The Online Multiplayer and Networking component. This is where match-making (and not the lovey-dovey stuff) and game management, object authority policy, and game state replication are taken care of.
Gameplay Foundation Systems are another big part of the game engine which defines the rules of the game; the GAMEPLAY. It looks at the hierarchical object attachment, static world elements, dynamic game object model, real-time agent-based simulation, even or messaging system, world-loading streaming, scripting system, and high-level flow system. This is what makes the game what it is, and is in charge of most objects such as environments, characters, NPCs, enemies, props, camera, the list goes on. Game objects need to interact or communicate with each other, which is dictated by the event system in this component of the engine. Certain game logic and data can be specified using scripting, and AI foundations are often found here as well.
Finally, Game-Specific Subsystems is the highest level, and includes everything specific to the game itself. Examples of this include (but are not limited to): weapons, power-ups, vehicles, puzzles, Game-Specific Rendering, Player Mechanics, Game Cameras, AI, etc. This is where terrain rendering and water simulation rendering falls, as well as the collision manifold, player movement, fixed cameras, camera-relative controls, player-follow camera, AI goals and decision making, actions, and path finding.
As much as goes into a good game engine, you only get out what you put in. All of the work involved in making a good and easy-to-work-with engine is so worth it.















