Physics for Sports Games
During play, your game will be running a physics engine that determines the behavior of moving bodies in the match. The physical behavior of an inanimate object such as a baseball is comparatively easy to implement. The physical behavior of humans, however, is much more complicated. Early sports games tended to treat a running athlete rather like a rocket: She had a velocity vector that gave the speed and direction of her movement and an acceleration vector that gave the force and direction with which she pushed. Modern sports games have much richer simulations with a great many variables, taking into account such things as the friction coefficient of the playing surface—for example, rain and snow make fields slippery and reduce traction.
Designing the physics simulation for a sports game is a highly technical problem and is beyond the scope of this book. However, beware: Because a sports game is a simulation of the real world, it is a common error to think that the physics in a sports game should be as realistic as possible. It shouldn't be, for two reasons:
■ First, the player is not actually running around on the playing field herself; she is watching a screen and controlling an athlete through a handheld controller. She has neither the immediate experience of being on the field nor the precise control over her movements that a real athlete does.
■ Second, the player is not a professional athlete. There is a good reason why only a small number of people can hit a baseball pitched at 95 miles per hour. The length of time that the ball is within reach of the bat is about 0.04 seconds. It's simply not realistic to expect that an ordinary person looking at a video screen without the benefit of depth perception could react quickly enough to "hit" a ball thrown at this speed.
For both of these reasons, you need to adjust the physics to make the game playable. In a baseball game, slow the pitch to give the batter a reasonable chance of hitting the ball, and artificially adjust the position of the bat so that it intersects the path of the ball. Whether the physics perfectly copies that of the real world doesn't matter as much as whether the game seems to be producing a reasonable
simulation of the sport as it is played by professionals. Even in a highly realistic game, your objective is to provide an enjoyable experience, not a mathematical simulation of nature.