Game Engine Architecture

(Ben Green) #1
733

// Cache-friendlier struct-of-arrays approach.
struct AllGameObjects
{
U32 m_aUniqueId [MAX_GAME_OBJECTS];
Vector m_aPos [MAX_GAME_OBJECTS];
Quaternion m_aRot [MAX_GAME_OBJECTS];
float m_aHealth [MAX_GAME_OBJECTS];
// ...
};
AllGameObjectsg_allGameObjects;

Att ribute-centric models have their share of problems as well. For ex-
ample, when a game object is just a grab bag of properties, it becomes much
more diffi cult to enforce relationships between those properties. It can be hard
to implement a desired large-scale behavior merely by cobbling together the
fi ne-grained behaviors of a group of property objects. It’s also much trickier
to debug such systems, as the programmer cannot slap a game object into
the watch window in the debugger in order to inspect all of its properties at
once.


14.2.2.5. Further Reading


A number of interesting PowerPoint presentations on the topic of property-
centric architectures have been given by prominent engineers in the game
industry at various game development conferences. You should be able to
access them by visiting the following URLs:


z Rob Fermier, “Creating a Data Driven Engine,” Game Developer’s Con-
ference, 2002. htt p://www.gamasutra.com/features/gdcarchive/2002/
rob_fermier.ppt.
z Scott Bilas, “A Data-Driven Game Object System,” Game Developer’s
Conference, 2002. htt p://www.drizzle.com/~scott b/gdc/game-objects.
ppt.
z Alex Duran, “Building Object Systems: Features, Tradeoff s, and
Pitfalls,” Game Developer’s Conference, 2003. htt p://www.gamasutra.
com/features/gdcarchive/2003/Duran_Alex.ppt.
z Jeremy Chatelaine, “Enabling Data Driven Tuning via Existing Tools,”
Game Developer’s Conference, 2003. htt p://www.gamasutra.com/
features/gdcarchive/2003/Chatelaine_Jeremy.ppt.
z Doug Church, “Object Systems,” presented at a game development con-
ference in Seoul, Korea, 2003; conference organized by Chris Hecker,
Casey Muratori, Jon Blow, and Doug Church. htt p://chrishecker.com/
images/6/6f/ObjSys.ppt.

14.2. Runtime Object Model Architectures

Free download pdf