Rendering Doom in SQL
Lukas Vogel has successfully rendered the classic game Doom using an SQL database, achieving an impressive 35 frames per second. In a detailed blog post, Vogel explains the mechanics behind the SQLDoom project, which utilizes a small Python client to manage input and output, control game timing, and display each frame.
How It Works
The project employs a series of CedarDB tables to track game geometry and state. Approximately 1,300 lines of SQL queries are distributed across 89 common table expressions, implementing the game logic and generating bitmap framebuffers. This marks a significant advancement over Vogel's earlier project, DoomQL, which attempted to create a multiplayer Doom-like shooter entirely in SQL but resulted in grayscale ASCII graphics reminiscent of Wolfenstein 3D.
Improvements in SQLDoom
Unlike DoomQL, SQLDoom produces full-color 640×480 frames that closely resemble the original Doom executable. Converting Doom's classic WAD files into a relational database was straightforward due to the game's structure, which breaks levels into vertices, lines, and sectors. The famous binary-space partition trees of Doom can also be translated into SQL using a pre-computed sort_key for each position at load time.












