Programmer ports "Doom" as playable PDF
News + Trends

Programmer ports "Doom" as playable PDF

Debora Pape
15/1/2025
Translation: machine translated

The classic game "Doom" from 1993 has conquered numerous platforms. Now another bizarre highlight has joined this illustrious circle: "Doom" also runs in a PDF. And you can try it out for yourself.

Do you feel like playing a classic today? Then why not play "Doom" in a PDF file. "Doom" can be run as ASCII art at 12 fps in a PDF file around six MB in size. All you need is a browser based on Chromium, for example Google Chrome, Microsoft Edge or Opera.

This link will take you to doom.pdf. If you open the PDF in your browser, you can get started right away. Clickable, labelled surfaces or keyboard input are available for control. The control surfaces don't work perfectly for me, the keyboard input works better. In order for the PDF to register your entries, you have to click on the field labelled "Type here for keyboard controls". You can then start and play a new game with the corresponding entries.

The start screen of the Doom PDF.
The start screen of the Doom PDF.
Source: Debora Pape

How can "Doom" run in a PDF?

The user ThomasRinsma has already come up with the idea of running a game in a PDF. Just a few days ago, he programmed a "Tetris" version for PDF, which you can play here. He takes advantage of the fact that the PDF format supports Javascript. For security reasons, the possibilities in browsers are very limited, but they are obviously sufficient for simple games. Chromium-based browsers support buttons and text fields in PDF files, allowing you to interact with the stored code.

The programmer "ading2210" was inspired by this and ported "Doom" for the PDF version. On his Github project page, he describes how he ported the game. He first had the C code of "Doom" output as Javascript using the Emscripten compiler. This can be inserted into PDF files.

The graphical representation of "Doom" is much more difficult compared to "Tetris". Displaying every pixel of the 320 × 200 pixel resolution as a text field would have been too complex. Ading therefore came up with a workaround: he only uses 200 text fields, each of which presents one line of the output image. These text field lines are filled with ASCII characters, which together form a rough image. Six colours can also be displayed in this way. "Doom" in ASCII has been around for some time as Open Source.

The image update takes around 80 milliseconds per frame, resulting in a jerky fps rate of 12.5. Both the graphics and the fps rate are anything but pleasant to play. I got a headache after a short time. Nevertheless, the project demonstrates once again how creative some people can get.

"Can it run Doom?"

"Doom" as a PDF is the latest of several adventurous "Doom" experiments in the past. When the first-person shooter "Doom" was released in 1993, the game was a milestone in the field of three-dimensional games. The code was released in 1997 and was subsequently used in numerous fan projects.

Among programmers and developers, the question "Can it run "Doom"?" has become a challenge. The game has already been output on a wide variety of devices, including an electric toothbrush, on intestinal bacteria (yep), as a non-playable video on a digital pregnancy test and on a piano.

You can find more examples here. Basically, no screen is safe from "Doom".

Header image: Debora Pape

18 people like this article


User Avatar
User Avatar

Feels just as comfortable in front of a gaming PC as she does in a hammock in the garden. Likes the Roman Empire, container ships and science fiction books. Focuses mostly on unearthing news stories about IT and smart products.


These articles might also interest you

Comments

Avatar