Can Doom Run It? An Adding Machine in Doom
blog.otterstack.com
blog.otterstack.com
I love this write-up, especially the interactive diagrams at the end. My vid doesn't go into as much detail on the actual circuit design, but like the article it uses a bunch of BCD ripple-carry adders. For output I use standard 7-segment decoders. As noted in the comments there are faster ways to do logic in Quake which I overlooked in my research, but to my knowledge noone has made a circuit this large before. I've put the source code on github for anyone that wants to take a deeper look: https://github.com/matthewearl/q1logic/
In other words, this device is the analogue of a transistor in electronic machines --- a signal-controlled signal switch. The notion that NAND is the "most basic level" required for digital computation is widespread, but a lower level exists, and this is it.
My system is not Turing complete, and it's because it doesn't have unbounded loops and state. When monsters arrive at their destination, they stay there forever. There's no way to "reset" monsters. This can probably be done by selectively recalling (teleporting) certain monsters so they can act as input to the next iteration of the calculation. This is probably the next step to proving whether or not Doom is Turing complete.
The other person's article linked near the end shows that he came up with the exact same thought:
We'll place a teleporter right in front of them and they'll find themselves locked away in a circuit of our devising spinning a hamster wheel for our benefit. Forever. Just make sure the circuit is placed where the player will always be a specific direction (e.g., south) so they'll forever keep trying to run in that direction.
Thus, the monsters can be thought of as the "electrons" or "working fluid" of this machine.
One of the ideas I've had in my mind but never got around to is to generate a game level that replicates the 6502, which has been reverse-engineered completely: https://davidmjc.github.io/6502/cd.svg
edit:
>The respawning happens after a randomized time delay (roughly 8 seconds to 5 minutes) - https://doom.fandom.com/wiki/Spawning#Monster_respawning
for particularly subjective definitions of 'shortly'
It's not quite the same I think. With NAND you only need the NAND. With transistors you need two kinds of transistors, N-channel and P-channel, or a transistor and a pull-up/down resistor.
That is, you need one device that conducts with "1" as input, and one that conducts with "0" as input. In this Doom circuit he has a device with both functions built into one device, one side opens on "1", the other opens on "0".
This implementation actually reminds me more of "Petri nets" and asynchronous logic. I wonder if using techniques from that domain would be useful for implementing circuits in Doom.
But surely the ultimate punchline is “Can Doom run Doom?”
Not to take from that achievement away, though, I just don't think it fits in the context of this post!
In fact now I’ve confused myself, what would constitute doom running doom?
I think what is being discovered right now is whether DOOM itself is Turing complete, and if so, can you program DOOM inside of DOOM by making a computer inside of DOOM composed of DOOM monsters and map features that, when ran, recognizably played DOOM.
Sum up: creating a computer inside the game of DOOM and programming that computer to itself play DOOM would constitute DOOM running DOOM
In the genre of "an implementation of game X on an accidentally Turing-complete Y", it never hurts to bring up Tetris implemented in the Game of Life: https://codegolf.stackexchange.com/questions/11880/build-a-w...
It sound like an interesting exercise to make a vanilla-compatible variant of the map.
You can find the post about it here: https://www.doomworld.com/forum/topic/131881-conways-game-of... and the code: https://github.com/pwiecz/conway.wad
Duke3D's Build Engine?
To connect two of these candle NAND gates together, you’d have to make sure it wouldn’t burn in reverse though. I’ll leave that exercise to the reader…
1. https://web.cecs.pdx.edu/~mperkows/temp/June16/ConservativeL...
I also read a sci-fi book (forgot the title) that involved a pre -tech civilization that had invented computation, and executed code with large crowds of people standing in a grid following set rules to act as logic gates.
[1]: https://en.wikipedia.org/wiki/The_Three-Body_Problem_(novel)
https://www.youtube.com/watch?v=IxXaizglscw
https://patents.google.com/patent/US3314439A/en
And maybe some inspiration:
It's been baffling me since late childhood that this isn't a thing everybody loved until they became "oh no, not another one of those!" frequent. Remember when fountains of that giant stone sphere slightly elevated by water pressure type weren't definitely not cool anymore yet?
I think I even saw this on here a few months back.
Had a good chuckle over that one.