Sponsored By

Ludicrous speed: What developers should know about relativity for games

The next generation of gaming platforms will open the door even further toward next-generation physics. We explore the possibilities of special relativity in video games and give some technical rules of thumb for straightforward implementations of it.

Daniel Strano, Blogger

May 30, 2013

4 Min Read
Game Developer logo in a gray background | Game Developer

With a new generation of high-power gaming platforms upcoming, we have the power to instill mind-bending relativistic effects in today's games. “Braid” is a stunning example of the 20th century physics achievable in even a 2D platformer. Einstein's physics can be exceedingly counter-intuitive, though.

The fundamentals of the essential math of special relativity is readily implemented and easily computed by processors running at gigahertz frequencies, but physical paradoxes creep up on the developer, and it can be difficult to envision the larger ramifications and applications of time slowing down and space shrinking as the player approaches the universe's speed limit. How do we orient ourselves in worlds built on hyperbolic geometry? For that matter, how much difference does the inclusion of special relativity make for a game?

More than just an “add-on” to conventional modes of gameplay, relativistic space-time geometry can open entire new worlds to designers, such as in the context of space-faring adventures. Consider games like “Star Control II: The Ur-Quan Masters,” which use flip-side worlds of “sub-space” tunnels for transit over astronomical distances. Without such alternate means of travel, players are necessarily limited by the speed of light to finite radii of practical traversal to explore in any reasonable amount of play time, correct?

Actually, no! From the perspective of someone on Earth watching a ship travel about 4 1/4 light years away to the star Proxima Centauri, its intuitive to think that a person necessarily must be at least 4 1/4 years older by the time the ship reaches its destination. This should render true-time space-travel impractical from the player perspective. However, it turns out that, from the perspective of the ship, the several light-year trip could theoretically take an arbitrarily small period of time, down to seconds, without crossing the speed of light barrier!

The key to the equations is a factor commonly called “gamma,” which is the reciprocal of the square root of one minus the squared relative velocity of the ship over the squared speed of light. (What a mouthful! Gamma and the simplest relativistic considerations are easily looked up through Google and Wikipedia, however.) When the ship speeds up, time intervals stretch out by a factor of gamma and length intervals shrink by a factor of one over gamma.

The upshot of this for the game developer, is that, from the ship perspective, a player can cross one-thousand light years distance, shrunk by the the increase in speed of the ship, in a matter of seconds, though the trip appears to take about one-thousand years from the perspective of other characters on earth. Computationally, implementing the physics can be accomplished essentially by just two multiplications by gamma and one over gamma on time and distance intervals respectively.

Virtually no distance is too great to cross, and entire civilizations lasting millions of years can rise and fall in seconds from the perspective of the player. This is hyperbolic geometry ala the “hyperbolic time chamber” of Dragon Ball Z.

We aren't limited to perfectly rigorous implementations of special relativity in our games, though. Within the universes of our games, we are free to tweak and reverse the geometry of relativity as we wish.

The length-shrinking paradoxes of relativity are not simply resolved with low-overhead game objects. In the case of variants of the “barn paradox,” we need to compromise; it is generally not feasible to physically simulate objects down to infinitesimal elements of length. Per the discussion in the link given, it's often safe to assume that the rest frame perspective of apertures through which objects might pass are qualitatively accurate. Imagine a space-fighter squeezing through a millimeter exhaust grating on an enemy space-station.

The time-stretching paradoxes have a similar corollary; the character or object that felt the forces of acceleration has generally aged slower when ultimately compared to objects that did not experience accelerating forces.

However, for the purposes of a game, we are not limited to just scientific rigor in resolving every particular of relativity. Just as “Braid” played with qualitative relativistic effects, we are free implement whatever “answers” to these paradoxes we chose that are consistent with our game-play mechanics, not necessarily perfect scientific accuracy.

An entire genre of games could be built on “self-contradictory” resolutions to relativistic paradoxes that are perfectly consistent with the game mechanics of various player perspectives, in a way like the perspective shifts of “Super Paper Mario.” Rather than bogging down mechanics, the complications of apparent relativistic paradoxes can become the jumping-off point for entirely new systems of fantasy physics.

Of course, as we progress along the exponential curve of Moore's law, more and more physical rigor is attainable even in real-time interactive game simulations. Speaking from my own forays into game special relativity and quantum mechanics, new frontiers are open to the intrepid developers who seek to distill the full modern understanding of physical reality in games.

It's an exciting time for game development; there is no better way to understand the universe today than to poke it with a controller.

Read more about:

Blogs
Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like