Simulated Physics in Games
Trace Braxling
Physics 211 F03
One of the most common representations of physics in video games is
that of projectile motion. In everything from sports games to action
games, some form of this motion is calculated by the computer.
Featured is a interactive representation of the simulation of basic
projectile motion. By clicking on the number showing the angle of
the cannon, a new value can be typed in ranging from 1 to 90
degrees. By clicking on the number showing force, a new number can
be input, with any number up to five digits in length.
This particular simulation of projectile motion calculates the
motion using the equation pf = p0 + v0t
+ at2 where a is 9.8 m/s and 10 onscreen pixels being one
meter. The force is separated into its X and Y components with
cosine for X and sine for Y. Because it is simulated, the entire
motion can be calculated instantly. The program knows where the
projectile will land before it visually does.
Note that air resistance may or may not be simulated depending on
the type of game. Games that require quick thinking and action will
usually not include air resistance, as they require players to
easily determine where their projectile will go. As well, the less
calculations that the computer has to make means it will run faster.
However, some games that attempt to simulate real world physics as
close as possible do calculate air resistance. Many more recent
sports games calculate air resistance and even wind in two or three
dimensions.
One of my favorite implementations of gravity is in the Nintendo
game Super Mario Galaxy released in 2007.
The game features the protagonist Mario traveling through space
themed levels.
Official Box Art of Super Mario Galaxy, Nintendo 2007
One of the primary features of the game is the ability to traverse
around spherical planets. The player can run in a complete path
around them. If multiple planets are located close together, players
can jump from one to the other, exchanging from one planet to the
other once they are close enough. Three spherical planets present
close to each other. The player can walk entirely around each one,
and if they jump, they can travel from one to the next. It is worth
noting that the planets themselves are much too small to have to
perceived gravitational effect that they do in the game. This is an
example of a game having physics based on reality that have been
modified to fit the game. Although it could also be said that the
small planets are incredibly dense.
This screen in particular shows the character
walking on a hollow glass planet. For fun, lets calculate the
supposed density of the planet. Some major assumptions will have to
be made, but a somewhat realistic value can be calculated. Assuming
that the character is an average height of 1.75m [5] the radius of
the planet is approximately 4 characters long, or 7 m.
Screenshot from Super Mario Galaxy, Nintendo 2007
Using the following calculation, and assuming that the glass
is around 0.25 m, the volume is 4*pi/3 (7^3 - 6.75^3), or 148.5 m^3.
Also assumed is that the force of gravity of the small planet is the
same of that of the Earth, as the character in the game appears to
be have consistent acceleration throughout the entire game. The
Earth has a mass of 5.98*10^24 kg and mean radius of 6.37 *
10^6 m [1], so it has a volume of 4*pi/3(6.37 * 10^6)^3, or 1.08 *
10^21 m^3. The density is 5.52*10^9 kg/m^3. For the planet to have
the same force of gravity, it would have to have a density of 4.03 *
10^22 kg/m^3.
As a rough perspective, the naturally occurring element with the
highest density is Osmium, with density of 2.26 * 10^8 [6]. The
planet density is 170,000,000,000,000 times this.
[3].Hollow Sphere Representation and Equation, from In Engineers
Edge
So maybe the Mario video game doesn't have the most realistic
simulation of physics. But I'm sure if people wanted perfectly
realistic physics, they would go outside.
Plenty of games have slightly more realistic physics though. One of
those is a very cool game called Kerbal Space Program.
Promotional image for Kerbal Space Program, from
https://kerbalspaceprogram.com/
Kerbal Space Program is a rocket and space travel simulator.
In a construction mode, players are given a number of rocket parts
with different characteristics. They can arrange these parts in any
order. Players can take these completed sets of parts and simulate
them, seeing how practical their design is.
Many important factors go into this design process. Everything must
be considered, from fuel storage, to center of mass, to center of
thrust. Players can also designate staging.
Rocket designs can range from simple,
Screenshot from Kerbal Space Program, Squad 2014
To complex,
Screenshot from Kerbal Space Program, Squad 2014
To impractical
Screenshot from Kerbal Space Program, Squad 2014
Once the design of the rocket is finished, it is taken to a launch
platform. If the rocket is designed well, It can begin its ascent to
the heavens. Providing your rocket has enough fuel for its weight,
it can exit the atmosphere. From here, the spaceship has an
opportunity to plant itself in orbit around the planet. It should be
noted that simply propelling directly away from the planet will not
achieve any sort of orbit, or increase the radius of an existing
orbit. The game uses the concept of prograde and retrograde. In
terms of the game, prograde is accelerating towards the direction
the spaceship is traveling in, and will increase the radius of the
orbit. In terms of the game, retrograde is accelerating opposite the
direction the spaceship is traveling in, and will decrease the
radius of the orbit. Once the spaceship is in an orbit, a refueling
ship can dock with it, give it fuel, then release itself. With a
full tank, the first ship can slingshot itself gravity to one of the
other planets present in the game. Or when I play it, directly into
the sun, because I'm really bad at the game.
A screenshot of the rocket taking off
Screenshot from Kerbal Space Program, Squad 2014
It made it into a very lopsided orbit. This orbit can be evened out
by firing in the prograde direction on the side closest to the
planet, or in the retrograde direction at the far side of the orbit.
Screenshot from Kerbal Space Program, Squad 2014
Even in the fantastical world of video games, physics are integral.
People want to be able to understand the game they are immersed in,
and they enjoy concepts based on physics that may or may not be
perfectly accurate.
As games become more and more complex, so will the physics that they
will be able to accurately simulate. It is not that far-fetched to
expect some amazing games in the near future based on physics.
Bibliography
[1] Knight, R (2013) Physics for Scientists
and Engineers.Glenview, IL: Pearson Education Inc.
[2] Newton's Law of Universal Gravitation. (n.d.)
In The Physics Classroom retrieved from
http://www.physicsclassroom.com/class/circles/Lesson-3/Newton-s-Law-of-Universal-Gravitation
[3] Hollow Sphere Volume Equation. (n.d.) In Engineers
Edge retrieved from
http://www.engineersedge.com/volume_calc/hollow_sphere.htm
[4] Williams, D.R., Planetary Fact Sheet - Ratio
to Earth Values (2014) retrieved from
http://nssdc.gsfc.nasa.gov/planetary/factsheet/planet_table_ratio.html
[5] Cumulative Percent Distribution of Population
by Height and Sex: 2007–2008. (2012) From Us Census
Bureau retrieved from
https://www.census.gov/compendia/statab/2012/tables/12s0209.pdf
[6] Haynes, W.M. (1996) CRC Handbook of Chemistry
and Physics, 77th Edition
[7] Kerbal Space Program Official Website. (2014)
From Squad retrieved from https://kerbalspaceprogram.com/
[8] What is the Difference Between Prograde and
Retrograde Motion?. (2014) OSIRIS-REx Mission retrieved from
https://www.youtube.com/watch?v=lWfnsyTXm38