Game Engine Architecture

(Ben Green) #1
719

A game object class hierarchy usually begins small and simple, and in
that form, it can be a powerful and intuitive way to describe a collection of
game object types. However, as class hierarchies grow, they have a tendency
to deepen and widen simultaneously, leading to what I call a monolithic class
hierarchy. This kind of hierarchy arises when virtually all classes in the game
object model inherit from a single, common base class. The Unreal Engine’s
game object model is a classic example, as Figure 14.3 illustrates.


14.2.1.3. Problems with Deep, Wide Hierarchies


Monolithic class hierarchies tend to cause problems for the game develop-
ment team for a wide range of reasons. The deeper and wider a class hierarchy
grows, the more extreme these problems can become. In the following sec-
tions, we’ll explore some of the most common problems caused by wide, deep
class hierarchies.


Actor

Brush

Controller

AIController
PlayerController

Info

GameInfo

Pawn

Vehicle
UnrealPawn
RedeemerWarhead
Scout

Light

Inventory

Ammunition
Powerups
Weapon

HUD

Pickup

Ammo
ArmorPickup
WeaponPickup

...

...

...
...

...

...

... ...

...

Figure 14.3. An excerpt from the game object class hierarchy from Unreal Tournament 2004.


14.2. Runtime Object Model Architectures

Free download pdf