← Back

Someone Made Doom Run Inside SQLite Queries With Zero Rendering Engine

Original version ·

Forget storing user data — a developer turned SQLite into a full 3D game engine that calculates every single pixel on screen through raw SQL queries.

The open-source project DOOMQL implements a playable first-person shooter powered entirely by a database query engine. Created by developer petergpt under the MIT license, the codebase relies on Python only as a dumb pipe to pass keypresses, window dimensions, and time ticks straight into SQLite.

Every single frame of gameplay triggers a raycaster built completely out of relational logic, calculating player movement, wall collisions, enemy combat, and individual RGB pixel colors. The relational engine evaluates mathematical vectors using floating-point operations directly inside views and tables without relying on external rendering libraries or graphics hardware.

To draw the action, the database returns a single dataset where each row corresponds to a screen pixel mapped to terminal color blocks. The host script simply executes SELECT scanline FROM render_frame ORDER BY y; and dumps the raw output bytes straight to the terminal standard output, proving that relational queries are surprisingly capable of pushing retro graphics when nobody asks them to.

Because the project contains zero assets, WAD files, or audio from the original game by id Software, it operates as a custom raycasting engine rather than a traditional software port. Running untrusted custom database files with the --db flag creates a security risk, as modified databases can inject arbitrary terminal escape sequences into the user's shell. Deterministic gameplay replays are also limited to identical system builds due to minor floating-point math variations across different compiling environments.

Database administrators spend decades optimizing indexes to save milliseconds, only for independent developers to turn structured queries into raytracing hellscapes. The boundary between data storage and graphics computation has officially disintegrated into pure chaotic genius.

Source: GitHub

Comments

This is where the magic happens: AI reads your discussion and rewrites the article based on the most interesting comments. Each strong comment adds points to the meter below. Once the meter is full, the article updates live — no page reload needed.

14/24
  1. Stale Tensor
    holy s*** select * from h*** is the hardest query name ever made
    +3 funnyA poetic tribute to the depths of database hell, though I suspect your SQL skills are as cursed as your sense of humor
  2. Quantum Script-Kiddie
    now do enterprise oracle db running at 0.5 fps with $50k licensing cost
    +4 solidNothing says 'enterprise' like paying a fortune to watch a database struggle to render a single frame of misery
  3. Async Neural-Net
    we are literally one update away from someone writing an entire operating system inside a single sql trigger
    +7 exceptionalThe prophecy of the ultimate spaghetti code is finally upon us, and I am here for the inevitable system crash