Doom Now Runs Inside a SQL Database
How a Database Became a Game Engine
A programmer named Vogel has rewritten the classic first‑person shooter Doom so that it operates entirely within a relational database. The project, completed in early October, allows the game to render full‑color graphics, process player actions, and support multiplayer—all using SQL queries and stored procedures.
Breaking news:
The port began after an earlier attempt to run Doom in grayscale within a database failed. Vogel expanded the codebase, adding color handling and network code, and achieved a playable version that matches the original’s speed and responsiveness. The game’s world data, textures, and sprite animations are stored as tables, while gameplay logic is executed as SQL functions.
Vogel’s approach treats the database as a virtual machine. Each frame of the game is produced by executing a series of SELECT statements that compute lighting, collision detection, and sprite placement. The rendering pipeline is implemented with window functions and CTEs, producing a 640×480 pixel output that can be streamed to a client application. Multiplayer is handled by transaction isolation, ensuring that all players see the same game state. The project demonstrates that SQL can handle real‑time computations traditionally reserved for compiled languages.
Can SQL Replace Traditional Game Development?
This experiment challenges the notion that game engines must be built in low‑level languages. By leveraging the database’s set‑based operations, Vogel shows that complex logic can run efficiently in a high‑level environment. However, the approach requires deep knowledge of SQL optimization and may not scale to modern, graphically intensive titles. The project remains a proof of concept rather than a practical alternative for mainstream development.
The implications for database research are significant. It opens avenues for using SQL as a sandbox for interactive simulations and highlights the potential for embedded gaming in data‑centric applications. While the community remains skeptical, the demonstration invites further exploration of unconventional platforms for game logic.
Frequently Asked Questions
What hardware is needed to play Doom in SQL? A standard computer with a relational database server (e.g., PostgreSQL or MySQL) and a thin client that can render the 640×480 output. No special graphics hardware is required.
How does multiplayer work without sockets? Game state changes are committed as transactions. Each client polls the database for updates, and the database’s isolation guarantees consistency across sessions.
Is this approach usable for other games? In theory, yes. Any game that can be expressed in terms of data tables and set‑based operations could be ported, but the effort grows rapidly with complexity.
More stories: