Doom injected into an SQL database
What happens when you try to render the legendary game Doom”>Doom using a database? Initially, some might suggest it’s a terrible idea. But deep in the world of coding and retro gaming, developers are constantly pushing the boundaries of what’s possible, and this project proves that sometimes the most absurd ideas yield the most spectacular results.
Enter the SQLDoom project, an ambitious endeavor that marries the immersive world of classic shooters with the structured power of SQL databases. While the concept might sound far-fetched, the execution behind SQLDoom is anything but simple. It’s a masterful blend of database theory and high-performance graphics generation.
The secret behind bringing Doom”>Doom into the realm of data lies in a sophisticated system. SQLDoom doesn’t rely on a single, monolithic query; instead, it employs a small Python client to manage the input, timing, and overall game flow. The true magic, however, is hidden in the database structure itself.
The core of the graphical display is managed by a series of tables within CedarDB, which meticulously track the game’s geometry and state. To actually generate the visuals, the project utilizes about 1,300 lines of SQL Common Table Expressions (CTEs). These complex queries don’t just store data; they are the engines that implement the entire game logic and generate a staggering 35 bitmap framebuffers per second.
This level of detail transforms the raw power of a database into a dynamic, playable environment. This innovative approach represents a massive leap forward compared to earlier attempts. Previous projects, like Vogel’s DoomQL, aimed for a similar goal but ended up delivering a decidedly simpler experience.
Those earlier efforts resulted in raycasting-based, grayscale ASCII graphics, reminiscent of games like Wolfenstein 3D, which, while fun, lacked the visual fidelity of the original.
SQLDoom steps into that gap, delivering something truly transformative. By leveraging the relational power of SQL, the project successfully generates full-color 640×480 frames. The result is a visual experience that genuinely looks like it could have come straight from the original Doom”>Doom executable.