Urgent.News

What's breaking now, across thousands of outlets.

Tech

Database expert runs Doom in SQL with just 5,900 lines of code

Database expert runs Doom in SQL again — full-featured SQLDoom is the sequel to embryonic DoomQL

Database expert runs Doom in SQL with just 5,900 lines of code

In 2026, running the classic game Doom on X remains a popular software hacking hobby, but now it can also be played inside a database. SQLDoom, a project by Lukas Vogel, who previously created DoomQL, made this possible using CedarDB, a performance-focused RDBMS. While the frontend displaying graphics and handling inputs is in Python, the bulk of the game logic is executed inside SQL.

Vogel converted Doom's data from the WAD package file into a relational database structure, with map levels naturally represented as parent-child relationships in tables. The main gameplay loop, with 5,900 lines of SQL, is a simplified version of the original C source code's 9,000 lines. The graphical renderer, a complex 1,300 line query across 89 tables, simplifies the rendering process through Binary Space Partitioning (BSP) traversal, which can be easily represented as a table of left/right values and vertex order numbers, automatically sorting walls from front to back.

Interestingly, the floor and ceiling renderers, which are clever flood-fill algorithms, don't map cleanly to SQL. However, multiplayer support is significantly improved using a database, as maintaining synced states across tables with interdependencies is a database's core function. Transactions in SQL ensure all data updates synchronize seamlessly, making multiplayer more manageable than in the original game.

Visit SQLDoom's GitHub repository for the full code or read Vogel's blog post for more details on this impressive achievement.

Written by urgent.news from Tom's Hardware's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at tomshardware.com →

More in Tech

More from Sunday 4 October →