An engineer has achieved something impressive: running the classic video game Doom directly inside a relational database. This project, called SQLDoom, demonstrates that it is possible to transform an action game into a data-driven system.
How Does SQLDoom Work?
The project uses CedarDB tables to store the game's geometry and state, along with approximately 1,300 lines of SQL queries distributed across 89 common expressions. These queries implement all the game logic and generate 35 frames per second as bitmap maps.
WAD File Conversion
Converting Doom's WAD files to a relational database was relatively straightforward thanks to how the original game breaks down levels into vertices, lines, and sectors. Even BSP trees can be converted to SQL using a precalculated sort_key column.
Performance and Technology
- Up to 60 FPS performance on laptops with a Ryzen 7 processor
- Full-color frame generation at 640×480 resolution
- Optimization via ORDER BY for object culling
Advantages for Multiplayer Servers
The database offers significant benefits for multiplayer servers: there are no partial updates, physics errors, or disputes over which object hit. The persistent nature of the database enables a coherent game state.
Original source: Ars Technica

Comments
No approved comments yet. Be the first to share your thoughts.