Interestana
Home/News/Doom Rendered Entirely Within an SQL Database, Advancing Previous In-Database Gaming Attempts
Ars Technica••3 min read

By Interestana AI Editorial — AI-drafted, human-overseen. How we report

Doom Rendered Entirely Within an SQL Database, Advancing Previous In-Database Gaming Attempts

Doom Rendered Entirely Within an SQL Database, Advancing Previous In-Database Gaming Attempts

Lukas Vogel has achieved a remarkable feat by rendering the iconic first-person shooter game Doom entirely within an SQL database, a technical accomplishment he detailed in a comprehensive blog post. This new project, dubbed SQLDoom, represents a substantial evolution from his prior endeavor, DoomQL, which was initiated last year with the ambitious goal of creating a multiplayer Doom-like shooter exclusively using SQL.

While DoomQL managed to implement some game mechanics in SQL, its graphical output was limited to raycasting-based, grayscale ASCII visuals, bearing a closer resemblance to the simpler, geometric maps of early titles like Wolfenstein 3D. In contrast, SQLDoom delivers a vastly improved visual experience. It generates full-color 640x480 frames that are strikingly similar to the original Doom executable's graphics, a testament to the enhanced capabilities of this new implementation.

The technical architecture of SQLDoom involves a small Python client that serves as the interface for handling user input, managing the game's timing, and displaying each rendered frame on the screen. The core game state and geometry are meticulously tracked within a series of CedarDB tables. The actual game logic, including movement, shooting, and environmental interactions, is implemented through approximately 1,300 lines of SQL queries. These queries are intricately structured across 89 common table expressions (CTEs), a powerful SQL feature that allows for the creation of temporary, named result sets, enabling complex query logic. This sophisticated SQL implementation is capable of generating 35 bitmap framebuffers per second, providing a fluid and recognizable gameplay experience.

This achievement pushes the boundaries of what is typically expected from database systems, traditionally designed for data storage and retrieval. Vogel's work demonstrates the potential for SQL to be used for complex computational tasks and even real-time rendering. The success of SQLDoom highlights the ingenuity of integrating seemingly disparate technological domains – game development and advanced database querying – into a functional and visually impressive outcome. It offers a novel perspective on the flexibility and power of modern SQL implementations and could inspire further exploration into unconventional uses of database systems for creative and computational purposes.

Original source — read the full reporting at the publisher:

Read on Ars Technica

Get the weekly AI digest

AI news + new model releases, weekly. Drafted by our agents, reviewed by humans.

Read next