Porting Doom to inappropriate platforms is one of the internet's favourite hobbies. Devices compatible with id Software's definitive FPS now include Lego bricks,pregnancy tests, and player-pianos. One ingenious PhD student even displayed Doom on gut bacteria cells, making the shooter a literal cultural phenomenon.
Now, an enterprising high schooler has further extended Doom's platform omnipresence, successfully porting the FPS to a PDF pile. This latest bizarre port of Doom, creatively named DoomPDF, is the work of github user ading2210, who describes themselves as a «high school student with an interest in programming, web development, and cybersecurity».
Porting Doom to a PDF file is possible, ading2210 says, because the PDF file format supports Javascript. Indeed, they point out that the full specification in Adobe Acrobat «contains some ridiculous things like the ability to do 3D rendering». In theory, this makes a port of Doom to a PDF relatively straightforward. However, ading2210 points out that «On Chromium and other browsers, only a tiny amount of this API surface was implemented.»
As for how they approached the port, they say that compiling it to run was easy enough, as was facilitating keyboard inputs, as «Chromium's PDF engine supports text fields and buttons.» Making the game run satisfactorily within the file was «a lot more of a challenge», however which ading2210 explains as follows:
Previous interactive PDF projects I've seen use individual text fields that are toggled on/off to make individual pixels. However, Doom's resolution is 320x200 which would mean thousands of text fields would have to be toggled every frame, which is infeasible. Instead, this port uses a separate text field for each row in the screen, then it sets their contents to various ASCII characters. I managed to get a 6 color monochrome output this way, which is enough for things to be legible in-game.
The result of ading2210's work can be played here, though ensure you're running
Read more on pcgamer.com