2022 - Non-Euclidean Doom: what happens to a game when pi is not 3.14159…

673,104
0
Published 2022-07-24
media.ccc.de/v/mch2022-236-non-euclidean-doom-what…



We all know that the value of pi is a constant with a particular immutable value. Anyone who has done any graphical programming also knows that visual rendering relies not just on pi but trigonometry more broadly as well as other mathematical techniques. If we look into the source code of the first person shooter Doom we find that the value of pi used in the game is wrong. In this talk I will explore what happens when we subtly and not so subtly break math in the source.

Doom is a well known classic first person shooter game with source code released under the GPL in 1999. In this talk I will begin by exploring what happens to the game when we make the value of pi even more wrong. What about when we change other trigonometric functions and constants to incorrect values? How will our familiar understanding and ability to traverse this virtual world change when we do this. Are there any interesting gaming possibilities with non-Euclidean geometries? A brief segway will cover some optimization tricks made to enable the game to run well on hardware available at the time. At the end I will provide a link to other games and public source code repositories that also use an incorrect value of pi. Pointers will also be provided to allow the audience to compile their own incorrect math version of the game.

Luke Gotszling

program.mch2022.org/mch2022/talk/ZM99EG/

#mch2022 #MCH2022Curatedcontent

All Comments (21)
  • @dannadx3840
    Most important conclusion: Rounding down pi to 3 is an acceptable practice in game development
  • Pi = (Health + 1) / 201 * 3.1415... The world becomes more and more unhinged as you loose health. You MUST find health bonuses, soul spheres, and mega spheres in order to have a normal experience. +1 so that PI is never 0.
  • @PTFVBVB
    As an engineer, I use the identity of pi=e=√g
  • @AdrianMagni
    Carmack is always right, it's circles that are wrong!
  • At university we scattered parts of a zip file for installing Doom across the generic logins used for night classes. A batch file would go and retrieve the parts, assemble them, and install, and delete itself after. To hide from the sysadmin...
  • @CoolAsFreya
    When he said "Pi=0 does it run?" and all the software developers in the audience confidently yell "NOOO!"
  • @MrSkaizZ
    I love the Jpeg injection part. Now the question isn't "can it run doom ?", it is "can it run on doom ?"
  • @TerjeMathisen
    It was my friend John Cash who discovered that Doom ran by using global broadcast packets, he saw that when he used a LanAlyzer to capture the traffic from their regular night-time deathmatches on the corporate IPX net. When he told Carmack, Carmack replied by sending him the source code and told him to "fix it!" Cash did so and later joined Carmack and Abrash to make Quake...
  • @surthing6711
    imagine making a friend on acid play the 3π version while he thinks its just normal doom
  • @veiledAutonym
    Now I want to make the lookup tables dynamic and make damage / healing cause the tables to regenerate with a value of pi with accuracy based on remaining health
  • @plasma5545
    breathes really heavily into your ear "yeah"
  • The “I hope somebody got fired for that blunder” was a tongue-in-cheek Simpsons reference, lol
  • @Kazuo1G
    Pi over 2: You have collapsed space-time into a smaller area. XD
  • @Dayanto
    An issue with this is that the maps are still euclidean even though the rendering is not, so you get a clash between different geometries.
  • @SeveralGhost
    The next frontier isnt what can we run doom on, its what we can run in doom. Asteroids is just the first step.
  • @PlatFormerlyKno
    someone make me a sign that says if you are here for euclidean doom you're in the wrong room 😂
  • @paultapping9510
    wait. That timeline though? Doom was released in 92 but opensourced in 1997? Opensourcing a game after just 5 years of release is wild, considering modern aaa are still expecting players to purchase games made 10+ years ago for modern day, adjusted for inflation, full-price.