HeadlinesBriefing HeadlinesBriefing.com

Doom Rendered in SQL Database by Lukas Vogel

Ars Technica •
×

Lukas Vogel writes in a lengthy blog post explaining how he managed to render Doom using an SQL database. The SQLDoom project uses a small Python client to handle input and output, drive the game’s timing, and display each frame. Behind that, a series of Cedar DB tables tracks game geometry and state, while about 1,300 lines of SQL queries across 89 common table expressions implement game logic and generate 35 bitmap framebuffers per second.

SQLDoom is a major improvement over Vogel’s previous Doom QL project, which built “a multiplayer Doom-like shooter entirely in SQL” but ended up with grayscale ASCII graphics. The newer SQLDoom generates full-color 640×480 frames resembling the original Doom executable.

Converting Doom’s classic WAD files to a relational database was straightforward, Vogel says, because the game broke levels into vertices, lines, and sectors. Doom’s binary-space partition trees can be broken down into SQL using a sort_key pre-computed for each position. With this, a simple “ORDER BY” statement determines which parts of walls to display each frame.

Source: Ars Technica · Summarized by HeadlinesBriefing