Lukas Vogel built a project called SQLDoom that runs the classic first‑person shooter Doom by storing every piece of level data in a relational database and driving the game loop with pure SQL queries. The engine runs on CedarDB, while a lightweight Python client supplies input handling, timing and frame output at 640 × 480 full‑color resolution.
Key Takeaways
- SQLDoom stores Doom’s geometry and state in CedarDB tables and uses about 1,300 lines of SQL across 89 common table expressions for game logic.
- The Python front‑end renders 35 bitmap framebuffers per second at a classic 640 × 480 resolution.
- Vogel’s goal was to prove that a full game can be driven entirely from a database, even though he admits it’s “obviously a bad idea.”
| Metric | Value | Why it matters |
|---|---|---|
| Project | SQLDoom | Shows a novel use of SQL as a game engine. |
| Creator | Lukas Vogel | Provides the technical vision and blog documentation. |
| Database | CedarDB | Stores geometry, sectors and runtime state. |
| Client language | Python | Handles input, output, timing and frame display. |
| SQL code size | ≈ 1,300 lines across 89 CTEs | Implements the full Doom logic without external code. |
| Frame rate | 35 fps | Provides playable motion despite database overhead. |
| Resolution | 640 × 480 pixels, full‑color | Matches the original Doom visual footprint. |
What is SQLDoom?
SQLDoom is a proof‑of‑concept engine that re‑creates the original Doom experience by persisting every map vertex, linedef and sector in relational tables. The project’s blog post explains that converting Doom’s WAD files to a database was “relatively simple and straightforward” because the level data maps naturally to rows and columns.
How the Engine Leverages SQL
All gameplay mechanics—enemy movement, ray casting, collision detection and rendering—are expressed as SQL statements. Roughly 1,300 lines of queries are organized into 89 common table expressions (CTEs), each representing a stage of the rendering pipeline or game state transition. By chaining CTEs, the engine builds a complete frame from raw geometry to a bitmap buffer, all inside the database engine.
Performance Profile
Despite the overhead of round‑tripping through a relational engine, the Python front‑end manages to pull 35 bitmap framebuffers per second. The output is a full‑color image at 640 × 480 pixels, which mirrors the visual fidelity of the 1993 original while keeping the frame rate within a playable range.
Implementation Details
CedarDB hosts the static level geometry and the mutable game state (player position, health, monster locations). A minimal Python client polls the database, feeds keyboard input into the SQL pipeline, and blits the resulting bitmap to the screen. The separation keeps the heavy lifting inside SQL while the client remains a thin wrapper for I/O and timing.
“Rendering Doom in a database is obviously a bad idea.” – Lukas Vogel
Why It Matters
SQLDoom demonstrates that relational databases can serve as more than just storage back‑ends; they can act as the core compute substrate for interactive applications. While the approach is impractical for commercial games, it opens a dialogue about data‑centric architectures, the expressive power of modern SQL, and the potential for leveraging existing DBMS optimizations in unconventional domains.
Frequently asked questions
Who created SQLDoom?
The project was authored by Lukas Vogel, who documented the design in a personal blog post.
Which database does SQLDoom use?
SQLDoom stores all game data in CedarDB, a relational database system.
How many SQL statements are involved?
The engine comprises approximately 1,300 lines of SQL queries organized into 89 common table expressions.
What visual performance does the engine achieve?
It renders 35 bitmap framebuffers per second at a resolution of 640 × 480 pixels in full color.
What is the purpose of building a game this way?
The project aims to prove that a complete game can run solely from database‑driven data, showcasing a novel—if impractical—application of SQL.
Bottom Line
SQLDoom proves that a classic title can be reconstructed inside a relational database using roughly 1,300 lines of SQL, delivering playable frame rates at 640 × 480 resolution, but its creator concedes that the method is more a technical curiosity than a viable development strategy.
Future explorations may examine how database‑centric designs could influence real‑time analytics or cloud‑native game services.
Reporting based on: original source.
Comments
Post a Comment