wachumacallit Posted October 30 Share Posted October 30 [from Scientific American] Everyone makes mistakes—and sometimes those mistakes can lead to surprising discoveries. In the early 1990s, while programming the computer game Doom, game developer John Carmack set the value of pi (π) by hand—and in true nerd fashion, he wrote the number down to the ninth decimal place from memory: 3.141592657. Do you notice anything strange about that figure? The last digit is wrong. The number should instead be 3.141592654. (Pi is often truncated without rounding, in which case the ninth decimal place would be filled by 3, but it rounds to 4 because the subsequent digit is 5.) Fortunately, this error has little impact on the game. In Doom, one of the earliest first-person shooters with three-dimensional graphics, you take on the role of a space marine who, because of a failed teleportation experiment, ends up on a moon of Mars, where he fights demons and zombies. The game has a great story but terrible graphics. That’s not because of the incorrect pi value but rather a reflection of how little computing power was available in the 1990s. Still, the error inspired U.S. engineer Luke Gotszling to investigate the possible consequences of incorrectly programming pi at a larger scale in the game—an idea he presented at a hackers conference in 2022. Because Doom is an open-source computer game, you can download the code—and modify it. Gotszling did just that, testing what would happen if he changed the programmed values of pi. The results can make a viewer feel a bit nauseous. When Gotszling set π = 3, for example, the pixelated world of Doom became distorted, with walls and pillars moving in unexpected ways. Nevertheless, the game was playable. When pi was set to the value of Euler’s number, 2.718..., the strangeness intensified. As a player moved straight in the game world, surrounding objects would move to different sides. Enemies could appear out of nowhere and disappear again. “With enough intoxication, you can re-create this,” Gotszling joked in his presentation. Things got really bad when he set a value of π⁄2 for pi. Walls would flash and disappear. Invisible obstacles block the player’s movement. The game wasn’t particularly fun in this state. ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.