O'Reilly logo

Programming Game AI by Example by Mat Buckland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

away at 10 o’clock.” They are describing the location of the target relative
to their own position and facing direction.
This ability to transform objects between local and world space can help
simplify many calculations as you’ll see later in the book. (Although you
need to understand the concept, how it’s actually done is beyond the scope
of this book — check out the matrix transformations chapter of a computer
graphics book.)
Physics
My dictionary defines the science of physics as:
The science of matter and energy and of the interactions between the
two.
As a game AI programmer you’ll frequently be working with the laws of
physics, and especially ones concerned with motion, which is what will be
covered in this section. You’ll often find yourself creating algorithms for
predicting where an object or agent will be at some time in the future, for
calculating what the best angle is to fire a weapon, or what heading and
force an agent should kick a ball with to pass it to a receiver. This isn’t AI
per se of course, but it is all part of creating the illusion of intelligence and
is normally part of the AI programmers workload, so you need to know
this stuff.
Let’s take a look at some of the fundamental concepts used in physics.
Time
Time is a scalar quantity (completely specified by its magnitude and with
no direction) measured in seconds, abbreviated to s. Until recently, a sec
-
ond was defined in terms of the rotational spin of the Earth, but as the
28 | Chapter 1
Physics
Figure 1.25. Objects transformed into the vehicle’s local space

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required