2022 - Non-Euclidean Doom: what happens to a game when pi is not 3.14159…
Summary
TLDRIn this talk, the speaker explores the impact of altering the value of pi in the classic game 'Doom,' resulting in non-Euclidean gameplay. They discuss the game's history, its initial release in 1993, and its open-source nature. The speaker humorously details how incorrect values of pi were used in the game's source code, leading to peculiar gameplay experiences when modified. They also touch on the game's technical requirements in 1993 and the networking issues it caused. The presentation concludes with a live demonstration of 'Doom' with various pi values, showcasing the game's adaptability and the strange,扭曲 worlds that result.
Takeaways
- 🎮 The presentation discusses the classic game 'Doom', a first-person shooter released in 1993, and its development history.
- 👨💻 John Carmack, a key figure in the game's development, made a significant mistake in the networking stack which led to unintentional denial of service attacks.
- 🔄 Doom was open-sourced in 1997 under a non-profit license and then under GPL in 1999, leading to various ports, including 'Chocolate Doom' which aims to be true to the original game.
- 📦 The game was initially shareware, allowing users to try before purchasing the full version.
- 🖥️ The minimum requirements for running Doom in 1993 were quite modest, including a 386 processor and 4MB of RAM with no 3D acceleration.
- 🕸️ Doom's networking issues led to network administrators at universities banning or restricting the game due to its impact on network stability.
- 👾 The game has been ported to numerous platforms, including a badge, showcasing its widespread appeal and adaptability.
- 📜 An incorrect approximation of pi (π) was hardcoded in the game's source code, which was a mistake admitted by John Carmack himself.
- 🧩 The game utilizes lookup tables for trigonometric functions due to the limitations of the hardware at the time, emphasizing the need for fast computations.
- 🔢 Experimenting with different values of pi in the game's source code resulted in various visual and gameplay effects, highlighting the importance of pi in rendering and geometry.
- 🌐 The presentation concludes with a discussion on other projects related to Doom, such as 'Ray Tracing Doom' and 'JPEG Injection', showcasing the game's lasting impact and the creativity of its community.
Q & A
What is the game 'Doom' about and when was it released?
-Doom is a classic first-person shooter game where space marines fight against invading demons from hell. It was released in 1993.
Who was one of the main people behind the development of Doom?
-John Carmack was one of the main developers behind Doom.
When was Doom open-sourced and under which license?
-Doom was initially open-sourced in 1997 under a non-profit license and then under the GPL license in 1999.
What is Chocolate Doom and why is it significant?
-Chocolate Doom is a port of the original Doom game that aims to be very true to the original game's experience.
What were the minimum system requirements for playing Doom in 1993?
-The minimum requirements for Doom in 1993 were a 386 processor with four megabytes of RAM, running at a 320 by 200 resolution with no 3D acceleration, and using IPX for networking instead of TCP.
What was the issue with the networking stack that John Carmack wrote for Doom?
-John Carmack made a mistake in the networking stack by underestimating the impact of a few packets on network performance, which inadvertently caused denial of service attacks and led to network administrators banning or restricting Doom in universities.
Why was the value of pi incorrect in the original source code of Doom?
-The incorrect value of pi in the original source code of Doom was due to John Carmack incorrectly recalling the 10th digit of pi.
What is the significance of lookup tables in the context of Doom's development?
-Lookup tables were used in Doom to speed up trigonometric calculations, which was necessary given the lack of 3D acceleration and the need for fast rendering on the hardware available in 1993.
What happens when the value of pi is changed in Doom's source code?
-Changing the value of pi in Doom's source code affects the game's rendering and gameplay, creating non-Euclidean spaces and altering the game's geometry in various ways, depending on the value assigned to pi.
What is the largest playable value of pi that can be used in Doom, according to the script?
-The script does not specify the largest playable value of pi in Doom, but it mentions that the value used by John Carmack in the original game was marginally larger than the incorrect value and still playable.
What other interesting projects related to Doom were mentioned in the script?
-The script mentions projects such as Ray Tracing Doom, which improves the game's graphics with ray tracing, and a JPEG injection project that demonstrates code injection via a renamed JPEG file.
Outlines
🎮 Introduction to Doom and Its Historical Context
The speaker introduces the classic first-person shooter game, Doom, which was released in 1993 with a team led by John Carmack. Initially shareware, it became open source in 1997 and fully GPL-licensed in 1999. The presentation uses Chocolate Doom, a port faithful to the original. The speaker humorously contrasts 'euclidean' and 'non-euclidean doom' and sets the stage by highlighting the game's minimum requirements and the networking issues that arose from Carmack's underestimation of packet impact on network stability, which led to network administrators banning or restricting the game due to its potential to crash networks.
🔢 The Impact of Pi in Doom's Trigonometric Functions
This section delves into the technical aspects of Doom, discussing the game's use of lookup tables for trigonometric functions due to the lack of 3D acceleration and the need for fast computation in 1993. The speaker points out an incorrect approximation of pi (3.14156) hardcoded in the game's source code, which was a mistake by John Carmack. The talk explores the effects of altering the value of pi in the game, demonstrating that while some values like 2 or 4 break the game, others like 3 create a 'non-euclidean' gaming experience, and the correct value of pi allows the game to function normally.
🤔 Experimenting with Pi: From Euclidean to Non-Euclidean Gameplay
The speaker recounts experiments changing the value of pi in Doom's source code, resulting in various gameplay experiences. When pi is set to e or pi/2, the game becomes increasingly difficult to play, with distorted spatial orientations. The presentation also touches on the game's collision detection remaining intact despite the altered geometry. The speaker invites the audience to try similar experiments with Chocolate Doom and to explore the effects of different values of pi on the game's geometry.
🌐 The Legacy and Curiosities of Doom's Incorrect Pi Value
In the final part, the speaker discusses the legacy of Doom's incorrect pi value, noting its influence on other projects and the discovery of over 2,000 code results on GitHub and thousands on Google that have mistakenly copied this value. The talk concludes with an interactive Q&A session where the speaker addresses questions about the largest playable value of pi, the definition of 'not playable,' and the potential for further experimentation with the game's trigonometric functions.
Mindmap
Keywords
💡Non-Euclidean Doom
💡John Carmack
💡Chocolate Doom
💡Shareware
💡Open Source
💡Network Stack
💡Denial of Service (DoS)
💡FPGA Port
💡Pi (π)
💡Lookup Tables
💡Ray Tracing
Highlights
Introduction to 'non-euclidean doom', a variant of the classic first-person shooter game 'doom'.
Doom's initial release in 1993 and its open sourcing in 1997 and 1999.
Use of Chocolate Doom, a port that aims to be true to the original game.
Doom's initial shareware model requiring payment for the full game.
Technical requirements for running Doom in 1993, including a 386 processor and 4MB of RAM.
Networking issues in Doom that led to denial of service attacks.
John Carmack's role in developing Doom and the initial networking stack.
The widespread porting of Doom to various platforms, including a badge and an FPGA.
Incorrect approximation of pi in Doom's source code and its impact on gameplay.
Explanation of lookup tables in Doom for trigonometric functions due to hardware limitations.
Experiments changing the value of pi in Doom's source code and their effects on gameplay.
Doom's gameplay with pi set to 2, 3, e, and other values, showcasing non-euclidean geometry.
Challenges in defining what makes Doom 'playable' when experimenting with pi values.
Ray tracing Doom as an example of enhancing the game's visuals.
JPEG injection as a method of code injection via image files.
Existence of other non-euclidean games and their approaches to spatial orientation.
The propagation of Doom's incorrect pi value in other projects and code repositories.
Invitation for audience to try modifying Doom themselves and explore other pi values.
Questions and discussion about the limits of playable pi values and the impact on game mechanics.
Transcripts
[Music]
all righty thank you for the warm
welcome and thank you for being out and
about at almost 11 o'clock at night this
is non-euclidean doom if you are here
for euclidean doom you are in the wrong
room
so to begin with doom
classic first person shooter space
marine fighting invading demons from
hell
released 1993
the initial team was only a handful of
people john carmack being one of the
main folks behind it it was open sourced
in 1997 under non-profit license and
then open sourced under gpl in 1999 and
there's a bunch of ports
i'm using chocolate doom which is a port
that intends to be
very true to the original game and it
was shareware initially so you would
download it and then you could play it
and then if you liked it to buy the full
game you would send its software some
money and then you could have the full
game
so this is what it looks like
[Music]
this is what it looks like
when pie is just a little off so it
looks mostly fine
all right so
let's take a very very brief segway to
1993.
the minimum requirements for the game
was a 386 with four megabytes of ram
running a very very small 320 by 200
resolution no 3d acceleration and
networking we not tcp it was ipx
and also in 1993 we had hacking at the
end of the universe so the predecessor
conference to this conference was also
taking place at that time and very very
brief segway to hacking at the end of
the universe i just love the description
from that conference about there will be
a guarded depository for your
laptops and valuables and you might get
your stuff back
and then also
um
you could make payment at the door which
we don't have
now and then very important bring many
guitars and laptops was for a 1993
hacker camp so anyway back to doom
so john carmack
wrote the networking stack for it and he
made a big mistake
he thought that only a couple of packets
would not cause any problems when people
were playing the game networked but it
turned out it did so you could actually
there were denial of service attacks
that were caused inadvertently by people
playing doom so you would have a few
dozen players that could completely
a network with a few thousand
endpoints and then there was a lot of
network administrators at universities
that wound up banning doom or
restricting
it because it would literally take the
network down if you are playing the game
and the other thing is it runs on
everything people have ported doom to
all sorts of platforms
including
your badge so
runs on doom
and sylvain lefebvre did the fpga port
so it's actually an fpga port of of the
game game originally of course was
written in c
so pi we all know pi the ratio of the
circumference to the diameter of a
circle all right well this is going to
be some crowd crowd interaction here all
right one
four
no
no that's not right
but
but that's what the original game was
compiled with so rather than then then
four would would be the appropriate
digit there it was compiled with seven
and then one person said happy pi day
the source code includes an incorrect
approximation of pi instead of the
correct one i hope someone got fired for
that blunder
which is very very mean um
especially again back in 1993 it was not
that easy to just go online and get the
value and then john himself
admitted it he incorrectly recalled
the 10th digit of pi
so
john i think we forgive you
for this mistake
it was not noticeable in the game and it
was left in the source uh incorrect
um
so of course where does pi come up in
doom well there are some lookup tables
and this is the original source
um so look up tables do not try to look
them up
so that's in the original source of doom
and then the order of appearance so
there's one lookup table for tangents um
there is a
binary
representation of angles
um
they're doing some bit shifts everything
is memory constrained it's 1993. uh
sign lookups guess what it serves as
coastline too because you can just shift
it
remarkable thing is how to use bams with
this so
unanswered comment in the code i guess
some things don't change since 1993.
um and then tan to angle arctan lookup
table
maps the tan of the angle to the angle
fast got a search so this is in the
original source and now you say like
well it's
it's just a lookup table why but why
would you do a lookup table for simple
trigonometry um this is the the initial
uh values of the lookup table for find
sign it's it's just a simple
trigonometric function why would you
even do a lookup table well the reason
um for that i'll go ahead into in a
little bit but this is the source for
example for for calculating the fine
sine lookup table again
very very simple doing some very basic
operations you know it doesn't really
seem to make sense why you would need a
lookup table for just some trigonometry
but never forget this is why so the game
is going to be running on this right so
no 3d acceleration you're going to be
having to make all of those queries
fast and it turned out that in 1993 the
way to make those queries fast was to
pre-compute a lookup table
and then the value of pi is embedded in
those lookup tables
so now we're going to get to the fun
part we're going to change pi
um and then we're going to
figure out whether it compiles and
whether it plays so first we're going to
make pi equal to 2 pi
okay so does it compile
anyone
yes
does it play
no
um i know
not fun all right so now we're gonna
make pi equal four does it compile
yes it does does it play uh also not fun
the the hyperbolic values are not very
very good uh we're going to make pi
equal to pi
does it compile actual pi not the wrong
value
yes it does compile does it play yes it
plays and of course it the game looks
like normal because it was
changed at the 10th digit so that's
very very far out so
you don't really have a difference in
terms of how it looks but remember how
this looks because this style of play
through i'm going to do for
the other values so this is what it
looks like with the correct value of pi
everything seems to be
very logical and makes sense
now
pi is equal to three
does it compile
yes
does it play
yes it does now it gets interesting all
right so here is the non-euclidean doom
alright
so
you can see that in the demo that plays
in the beginning of the game it's it's
completely shifted so this is the same
script that plays in the normal doom but
you it winds up killing you because
because the game isn't expecting that
that dynamic
now
we're gonna see what it looks like
when it pi is equal to three so
you start to see things kind of move
a little bit
so things are a little off the walls are
moving in a way that you do not expect
and so things start to shift
right so
because it's non-euclidean now there's
you know a straight line is no longer
the shortest path between two points and
one thing i was curious about is whether
whether the the shots would actually be
straight and weirdly enough the shots
were straight that's probably because of
the the the uh the target detection that
they were doing but everything else
starts to kind of
be a little weird but but it's playable
with with pi equal to three um and yeah
so that
starts to look kind of interesting now
we're going to make pi equal to e
does it compile yes
does it play also yes
so now it will get a little more
interesting
alright so now
yeah
yeah it's
it's dancing yeah
yeah with enough intoxication you can
recreate this
and then the other funny thing that
happens is they disappear if you move or
they they kind of jump left and right as
well
but it starts to
yeah it's really it starts to get really
funky
all right pi over two does it compile
yes does it play yes it does all right
it's getting more interesting now
so
now it starts to just be yeah
it's uh
it's yeah
um
a little
yeah
pretty pretty hard to play at this point
and then like the wall boundaries start
are also kind of get in the way um but
there is there's still collision
detection here so
it's not that easy to clip through walls
even with this kind of rendering
um so yeah this is pi equal to pi over
2.
all right pi equals
0.0001 does it compile
yes does it play
surprisingly it does
all right
that's yeah unfortunately it plays but
not a very fun game
all right
pi equals zero does it compile
no that's right it does not
divide by zero
and of course it doesn't play
negative pi
it compiles
unfortunately does not play that one
would have been good
negative one million
yes it compiles
unfortunately it does not play
so there's the table for the values i
tried
um i'm curious if there's other
interesting values um for those look up
tables that
that that could make this game
also kind of interesting
so if you want to try this yourself you
can get chocolate doom
you can modify the value of pi right in
the source
there's two functions that generate
those lookup tables so they're com
they're normally commented out because
those tables are pre-generated so you
uncomment them then you generate those
three lookup arrays
save those lookup arrays compile there's
a
builds tool that helps with the
compilation as well then you download a
map file of your choice so everything
here i did was on on doom 1 the original
but you can you can try this on doom 2
and other games and see
see how it looks
and enjoy and you could try this
yourself
so um to end off with i want to go over
some other projects so one person for
example did ray tracing doom
so this is making the game look better
so it's the original game but with wayne
tracing this was done by soul team
this is open source as well if you'd
like to see this um
ray tracing in a game that's from 1993
is
kind of interesting
jpeg injection this is also really
really interesting so
this is a jpeg
that's 117 kilobytes normal jpeg or it
looks like a normal jpeg
normal image you can download it it
renders fine
it's jpeg image
but
if you take this jpeg and you save it
as a doom save file
and then you load it
there's going to be something
interesting that happens and so this is
a video of that
that's right
code injection via jpeg that has been
renamed
[Applause]
[Music]
all in 117 kilobytes so that was a great
great project that was done
by keg sws on twitter
uh there's other non-euclidean games
weirdly enough they all look kind of
similar in terms of kind of spatial
orientation um so there's a great xena
rogue did a great post
listing a lot of new games that were
deliberately made to be non-euclidean
if you'd like to to read through them
there's uh there's a great post there
that lists i think there's over 20 at
this point where they all kind of do
different things with geometry
there's a fun little tidbit which is so
now that there's this incorrect value of
pi that was placed in the source code
well like
is this value has have other people just
copied this value thinking it was the
correct value of pi
and used it
and the answer to this question is yes
so
there and then these most of these are
not forks of the game so these are just
new projects where someone
copied this incorrect value enough times
that there's now 2 000
code results on github that use the
wrong value of pi
and then on google there's about four
and a half thousand results
i don't know how many of them reference
doom and how many of them are just
people incorrectly
copying the value but if you want to
look through those code results there's
the github link
and that's all so thank you so much and
happy to take questions
[Applause]
i'm left ah we do have some time left so
if you have any questions please line up
at the microphones
and
feel free to ask them
anyone yes perfect
so we saw some examples of pi being
smaller and still playable are there any
examples of pi being larger and also
still playable yeah so the the value
that john carmack used in the original
game was larger marginally and still
playable um
uh one thing i'd like to do is do a
search to find the largest playable
value which would be interesting i
haven't done that experiment yet but i i
know it's between the incorrect value
that john used them for because four is
not playable so it'd be interesting to
see what the largest playable pi value
is
as for the game
okay thanks
if you find it tell me
back microphone please
thanks thanks for your talk it was
really funny um i was wondering how is
not playable defined like i mean
obviously the you showed some examples
were also not very playable yeah so
yes so i define not playable as
basically the game's psych faults when
you try to play it so it's a hard crash
um so the ones that were listed as not
playable
it would load and then the game would
crash um so you literally couldn't do
anything it would psycfault uh i didn't
trace into the code to see where it was
psych-faulting but
but
non-playable meant meant that the game's
like faulted at start or at load
okay and the front microphone hello
thanks for the talk
soon you've been saying you've been
tweaking the argument of the sine and
the cosine function but have you been
tweaking the sine and the cosine
function itself as well
no but that would be another great like
thing to do as a follow-up is to change
those lookup tables if it if it expects
a cosine and you give it a sign for
example right and c
see how that kind of modifies the the
geometry
and this and the same for the for the
changes because i think
it's you get really odd results as well
i guess but uh okay thanks
okay are there any more questions
if that is not the case ah you have a
question
okay you don't good
if that if you have a question you can
probably also ask him afterwards he will
probably be available just outside the
tent so thank you for the really vivid
talk i really enjoyed it and give him a
warm round of applause
[Applause]
you
Ver Más Videos Relacionados
DOOM Eternal Review | Alpha Male Gaming | Amogus Edition
EA WRC Official VR Mode - OpenXR Best VR Settings - Quest 3
Concord Is A Dead Game Walking...DO NOT Pay $40 For What WILL BE A Free Game
مراجعة وتقييم لعبة Alan Wake 2
Sejarah Minecraft dari AWAL sampai SEKARANG dalam 13 Menit
The Truth Of Zenless Zone Zero Gameplay After 50+ Hours - How I Actually Feel
5.0 / 5 (0 votes)