Game Engine Architecture

(Ben Green) #1

738 14. Runtime Gameplay Foundation Systems


z defi ning the location at which a particle eff ect or audio eff ect should
originate,
z defi ning waypoints along a race track,
z and the list goes on.

14.3.3.1. Object Type Schemas
A game object’s att ributes and behaviors are defi ned by its type. In a game
world editor that employs a spawner-based design, a game object type can be
represented by a data-driven schema that defi nes the collection of att ributes
that should be visible to the user when creating or editing an object of that
type. At runtime, the tool-side object type can be mapped in either a hard-
coded or data-driven way to a class or collection of classes that must be instan-
tiated in order to spawn a game object of the given type.
Type schemas can be stored in a simple text fi le for consumption by the
world editor and for inspection and editing by its users. For example, a sche-
ma fi le might look something like this:
enumLightType
{
Ambient, Directional, Point, Spot
}

typeLight
{
String UniqueId;
LightType Type;
Vector Pos;
Quaternion Rot;
Float Intensity : min(0.0), max(1.0);
ColorARGB DiffuseColor;
ColorARGB SpecularColor;
...
}

type Vehicle
{
String UniqueId;
Vector Pos;
Quaternion Rot;
MeshReference Mesh;
Int NumWheels : min(2),max(4);
Free download pdf