Vibeleaderboard
← All Intel
Intel / article

DOOMQL

Source
simonwillison.net
Author
Simon Willison
Date

Context

DOOMQL turns database queries into a playable first-person game. Its repository explains that SQLite calculates movement, collisions, combat and the screen image. For each frame, a query reads the player and map tables and produces rows containing pixel positions and colors. A second SQL view converts those rows into colored terminal text; Python supplies input and timing, then prints the result.

Because the image exists as queryable data, another interface can display the same game state. Simon Willison describes building a browser display from the pixel view while playing in the terminal. This is an original Doom-like experiment in making SQL perform simulation and rendering.

Key takeaways · AI-distilled
  • DOOMQL puts the game itself inside SQLite: SQL owns movement, collision, enemies, combat, progression, and the RGB value of every pixel on screen. The Python script is only the terminal shell around the database.
  • The renderer is one enormous SQL query — a full ray tracer written as a recursive CTE (common table expression), the construct that lets a query feed its own output back into itself.
  • Because game state lives in an ordinary SQLite file on disk, you can point Datasette at it mid-game and query the running game from a second process.
  • The Datasette Apps plugin lets you write HTML+JavaScript apps that run SQL inside Datasette. One prompt — display the frame_pixels view's x/y/r/g/b columns, refresh once a second — produced a live mirror of the screen; a follow-up added a minimap.
Key quotes

“DOOMQL started with a deliberately unreasonable question: what if SQLite were the game engine, not merely the place where a game stores data?”

“The result is a small, original Doom-like game in which SQL owns movement, collision, enemies, combat, progression and every RGB pixel on screen.”

Read the source simonwillison.net
More from Simon Willison
Recommended reads
Comments

Checking sign-in…

Loading comments…