Game Development Reference
by without a good physics engine, and the trend is rapidly spreading to other
genres, including strategy games and puzzles. This growth has been largely fuelled by
middleware companies offering high-powered physics simulation. Many high-profile
games feature commercial physics engines.
But commercial packages come at a high price, and for a huge range of developers
building a custom physics solution can be cheaper, provide more control, and be
more flexible. Unfortunately physics is a topic shrouded in mystery, mathematics,
and horror stories.
When I came to build a general physics engine in 2000, I found there was almost
no good information available, almost no code to work from, and lots of contradic-
tory information. I struggled through and built a commercial engine, and learned a
huge amount in the process. Over the last five years I've applied my own engine and
other commercial physics systems to a range of real games. More than five years of
effort and experience are contained in this topic.
There are other topics, websites, and articles on game physics, but there is still
almost no reliable information on building a physics engine—that is, a complete sim-
ulation technology that can be used in game after game. This topic aims to step you
through the creation of a physics engine. It goes through a sample physics engine
(provided on the CD) line by line, as well as giving you insight into the design deci-
sions that were made in its construction. You can use the engine as is, use it as a base
for further experimentation, or make different design decisions and create your own
system under the guidance that this topic provides.
Physics is a hot topic in computer games. No self-respecting action game can get