Another pitfall of computer simulated physics is the fact that when values change in the real world, they change in a way that is perfectly gradual – that is to say, if I increase the velocity of the car I am driving from 10mph to 20mph, I conceptually hit every single possible velocity value in between (see Zeno's Dichotomy Paradox). In a computer, values can only be stored to a certain precision (ie. a decimal can only extend so far), and on top of that a value must always be discreet – meaning that no matter how good the computer, if you zoom in on a supposedly linear velocity graph far enough, it will eventually look like a bunch of tiny stair steps as the computer loops through its processing cycle.

The inability of computers to emulate the fine (in fact, infinitely fine) resolution of the real world can also cause its share of problems:



First, some background: Kerbal Space Program (Squad, 2011) is a very realistic (as far as orbital dynamics are concerned) space flight simulator in which players build and manage their own space program manned by happy little green people called kerbals. The player builds ships, satellites, rovers, and all other manner of space vehicles out of sets of components that lock together. As part of the realism, the joints on between parts can only withstand so much force before failing. There are struts that can be added to increase a joints strength, but of course the physics calculations are still running.

What happened in this video is several joints in the front area of the player's space plane spontaneously failed, even though under very little stress and having already proven it could withstand much more by making it to the faraway planet it was landed on. This is a variant of a large set of loosely (if at all) related Kerbal Space Program bugs known as the "Kraken". This particular bug is, in fact, the original Kraken, which gained its name because of its seemingly random occurrences when journeying through space (which is, of course, analogous to sea travel and thus relates to the mighty Kraken).

While this bug looks somewhat tame compared to the likes of the Skyrim bugs we talked about, it is a demonstration of how fundamental a problem variable precision is in computer physics.

Decimals and Computers

In order to understand this problem, one needs a basic understanding of how decimals are stored in computers. They are generally stored using a system called "floating point" decimals. Without delving too deeply into how floating point works, it essentially stores a number in what you may call scientific notation: with one number representing the base and another number representing magnitude ie. 3.01x102 = 301. The problem that arises is that all calculations made using floating point numbers must eventually round off – there is only a limited amount of space to store that data after all. When you begin making thousands upon thousands of calculations based on one original value, the amount of error compounds itself, eventually leading to answers that can no longer serve their purpose accurately.

In the case of the Kraken, rounding errors of this sort build up over the course of a long flight as a ship's position is repeatedly calculated. all that needs to happen then is a restart of the physics engine (by either a restart/load of the game or activating and deactivating in-game time compression) and all of a sudden the positions of several of the ship's components are off just enough to move them into or too far away from their neighboring components. The result is catastrophic loss of tiny green life.

Now, in this case, the round off error was being exaggerated by the fact that the physics engine was viewing the home planet of Kerbin as the center of its coordinate system, which meant that as the spacecraft moves farther and farther from Kerbin, the order of magnitude of its position components increased greatly This causes round off errors to be much more damaging, as now that last decimal place being cut off represents, for example, 10 meters instead of .001 meters.

The game's developers were able to largely remedy this problem by adjusting the physics engine to place its coordinate system's origin on the player's spacecraft instead of stuck to Kerbin. Which just goes to show how incredibly important your coordinate system is!!

next

back