James Gentry III
Physics define the rules by which we live our physical existence. Many of us go about our day to day lives without any true understanding of the Laws which govern how we interact with our surroundings. Physics is our way of making sense of the forces which act upon us and shape the way we accomplish even the most menial of tasks. From walking to driving to playing a game of catch; Anyone can see physics in action.
A computer game programmer must take a special look at the forces at work around us. The programmers who code flight simulators, first person shooters, and similar games, often need to model their virtual world as closely as possible to our own. In this project we will look at the first person combat simulator called "Tribes™", by Dynamix. We will focus mainly on projectile motion, but we will also discuss the challenges the programmers had in computing ranges for projectiles, friction, and momentum. Also touched on, will be how they succeeded and failed in their efforts.
In Tribes™, the programmers had to create an environment for the players. The challenge is to model our real life Laws of physics as accurately as possible. However, programmers are not physicists and it would take a super computer to accurately model all physics in a real world environment. This environment includes a variable gravity. This was important to game play in that the programmers could now make different worlds for the players to fight in. A planet of different mass will obviously have a different gravity. The following equation shows the horizontal range of a projectile, R = (V²o / g) * sin(2Ø) (Halliday, et al 60-64). Where R is the range, Vo is the initial velocity, g is gravity, and Ø is the angle the projectile is fired at. It is easy to see from the equation that a change in gravity will affect the total horizontal range achievable by a projectile. An interesting note is that a 45 degree angle will provide the maximum horizontal range for the projectile, no matter what the force of gravity is. (Assuming gravity does not equal zero).
We are neglecting air resistance in our calculations, as did the makers of Tribes™. When the programmers did this however, they got some unexpected, yet fun results. While projectile motion was not affected greatly, a person flying in the game could reach insane speeds, as there was no terminal velocity. This was possible because a player could hit the 'jump' button very fast and 'ski' down a slope. When skiing down a slope, the player object was not affected by any frictional force from the ground. Combined with no air resistance, it was possible to project your player at unheard of velocities. This was obviously a huge oversight on the part of the programmers, however, it did make the game a lot more fun!
Galileo was the first person who ever accurately described projectile motion. He was the one who first broke down motion into it's separate horizontal and vertical components (Web 1). Galileo even took this idea further with his realization that there was more than one force at work upon the projectile. Utilizing these revolutionary insights, he then concluded that the curve of ANY projectile is a parabola. It was this idea that let us examine how two objects in a vacuum, even if of different shape and mass, will hit the ground at the exact same time, if both are dropped from the same height.
It does not take much imagination to see how the concept of projectile motion could be used in a military setting (Lab 25). From firing a cannon ball, to dropping a bomb out of an airplane, to firing a Volkswagon sized bullet out of a huge battleship gun, the equations of projectile motion allow us to accurately hit a target from great distances (Web 2).
In the program below, we model projectile motion. We utilize the following equations:
R = (Vo² / g) * sin(2Ø)
Equation of the Path:
y = (tanØ)x - [gx² / 2(Vo * cosØ)²]
In the program we show the distance to the target, how far your grenade flew, how far you missed the target by, the angle of the grenade to the origin as it flies through the air, the height of the grenade as it flies through the air, the secant line to the grenade as it flies through the air, and the path of the grenade (which is the parabola).
We used Java to model the projectile motion. This program also incorporates 'double buffering', which allows for smooth graphical representation. (MSDN 1.) We utilize the properties of threads to run the animation. (Silberschatz, A., et al 116-132)
To use the program, click on the red button next to velocity and slide it horizontally, until you have selected the value you want. The value appears to the right. Then click on the red button next to the angle and in the same manner, select the value you want. Next click on "Fire!" Now simply sit back and enjoy quality entertainment as you watch the grenade fly through the air, towards your target. If you hit the target, you get a cool message. Otherwise, you must try again.
After the grenade has landed, you can click on the red button underneath it and slide it left and right. When done, you can retrace the path of your projectile, observing the values that it had as it flew through the air.
|The physics of projectile motion greatly impacted our history. From warfare to game play we can see this impact. Without knowledge of physics in general we would not be able to defend our nation or enjoy cool computer games. In this project, we have taken one small element from a very large 'picture' and attempted to show its impact on the life of the human race. As we are able to further define the pieces of this 'picture', our understanding of the universe around us grows. One day, our grasp of physics will take us to different worlds, where our understanding of projectile motion will let us blow up enemy aliens from a safe distance!|
Tribes™. Scripts and code from Tribes game, made by "Dynamix", a game company based in Eugene, OR.|
Web 1. http://library.thinkquest.org/2779/
Web 2. http://www.mhs.ox.ac.uk/geometry/essay.htm
Lab Experiments. Physics 211 Laboratory Experiments 2000: 25-26
MSDN 1. Java++ Microsoft Developer Network documentation. (Docs that come J++ programming language.)
Halliday, D., et al. Fundamentals of Physics Extended 1997: 60-64.
Silberschatz, A., et al. Applied Operating Systems Concepts 1st Edition 2000: 116-132.