HeadlinesBriefing HeadlinesBriefing.com

Doom Ported to SQL: Real 1993 Game Logic in Database

Hacker News •
×

The original 1993 Doom has been ported entirely to SQL, running its game logic and renderer inside a database. The game loop operates at the original 35 FPS, while the renderer produces full 320x200 frames at up to 60 Hz on an AMD Ryzen 7 7840 U. Python only handles timing, keyboard input, and displaying the bitmap. Deathmatch multiplayer is supported with four slots on EU and US servers. The shareware version of the first episode is available, with queueing if servers are full. The project builds on DOOMQL, an earlier ASCII-art version, but now includes BSP trees for correct depth ordering, textures, and varying floor heights. The WAD file was translated into relational tables, with importing taking about 18 seconds. The renderer outputs exact RGB pixels via SQL, and the game logic runs on a fixed 35 Hz loop. The client is deliberately minimal, only managing input, timing, and display.

The architecture separates game logic and renderer into two SQL paths: game logic updates state tables, while the renderer is a pure function of those tables. This allows the client to request frames as often as needed. The project demonstrates that complex game mechanics can be implemented purely in SQL, using user-defined functions where necessary. The original Doom’s fun factor is preserved, with visuals and feel matching the 1993 classic.

Source: Hacker News · Summarized by HeadlinesBriefing