The famous 'DOOM' is finally being ported to PDF files
The FPS 'DOOM' is known for the 'DOOM Challenge' in which players install it on everything from
GitHub - ading2210/doompdf: A port of Doom (1993) that runs inside a PDF file
https://github.com/ading2210/doompdf
You can get a good idea of what it feels like to play DOOM in PDF by playing the movie below.
You can also play the game by clicking the link below.
doom.pdf
(PDF file) https://doompdf.pages.dev/doom.pdf
A normal PDF is just a static document format, but in fact there is a standard for embedding JavaScript, and some browsers such as Chromium and Firefox can execute JavaScript with restrictions. DoomPDF makes full use of JavaScript functions and text fields to realize drawing and operation of DOOM.
However, the JavaScript environment of PDF has much more limited functionality than JavaScript on a typical browser. Therefore, DoomPDF uses text fields to represent the DOOM play screen in ASCII. Since Doom's resolution is 320x200, thousands of text fields must be switched for each frame, but the creator of DoomPDF, Github user ading2210, divides the DOOM play screen into rows and uses a separate text field for each row. In addition, the number of characters output is kept to a minimum to reduce the processing load.
In addition, WebAssembly is generally used to run DOOM, which was developed in C, on a web browser, but its operation is severely limited in PDF's JavaScript environment. Therefore, DoomPDF uses an older version of Emscripten to run DOOM with asm.js. This allows it to run in PDF's JavaScript environment, which does not support WebAssembly.
Below is a screenshot of DoomPDF when I accessed it using Google Chrome. There was a slight lag, but I was able to play it.
Related Posts: