Modular Game Engine Design

Modular Game Engine Design

Aaron Boudreaux (University of Louisiana at Lafayette, USA) and Brandon Primeaux (University of Louisiana at Lafayette, USA)
DOI: 10.4018/978-1-4666-4301-7.ch058
OnDemand PDF Download:
$37.50

Abstract

The usage of software engineering principles in designing a game engine is discussed in this chapter using a simple tower defense game implemented using C# and the XNA Framework to illustrate usage of the engine. Essential functions, such as collision detection, input/output, graphics, object management, state management, and sound, will be implemented as independent units called managers. Because each manager is independent from the rest, essential development tasks such as implementing each manager and isolating bugs are much simpler.
Chapter Preview
Top

Introduction: What Is A Game Engine?

A game engine is a system designed to facilitate rapid development of video games. A game engine generally acts as a layer of abstraction between hardware or low level code and the engine interface to reduce the amount of time spent designing or coding a game. Additionally, game engines may utilize third party libraries to provide desired functionality, such as physics, sound, and artificial intelligence, rather than having to “reinvent the wheel”. There exist many libraries on each of these topics which can both quickly add new features to a game engine and reduce the overall time required for engine development.

“Game Engine” is a generic term and does not define any specific features which must be included other than aiding in the game development process. However, many game engines include, but are not limited to, any number of the following standard features:

  • 2D or 3D rendering

  • Audio

  • Physics

  • Input Detection

  • Scripting

  • Entity Management

  • Networking

  • Modeling and Animation

  • Graphical User Interface Management

  • Particle Systems

In addition to these core features, it is also desirable to develop the engine to provide these features using a component based architecture. Ideally, each of the previously listed features is implemented as an individual, independent component. Realistically, some inter-component dependencies may be required in order for some libraries to function correctly, or to prevent duplication of work. For example, the GUI system requires the input system in order to detect GUI interactions. While a GUI library may implement its own basic input detection, it would be completely unnecessary to use both the basic GUI library input detection, as well as a more fully-featured input library which may support many other input libraries.

Component based systems tend to be more modular. This allows engine developers to either swap out one implementation of a module or component for another, or provide multiple component implementations, allowing a game developer to have a choice of implementation. Additionally, a game engine may allow a game developer to either add new components or replace the default components with their own custom components. A great example would be a component based 3D rendering system which allows the developer to choose a target platform such as the Microsoft Xbox 360, Sony Playstation 3, or Nintendo Wii. It is even possible to compile the game using each of these systems to allow game developers to focus on multiple platforms.

This chapter illustrates the concept of modular design through actual design and implementation of a simple game engine. It features many of the components listed above, including 2D rendering, audio, input detection, and graphical user interface management.

Top

Background

This section will cover the basics of the XNA framework and C# before delving into our engine.

Complete Chapter List

Search this Book:
Reset