DOOMQL is a playable Doom-like shooter where every aspect—movement, AI, rendering, and pixels—is computed entirely by SQLite queries, with Python serving only as a minimal terminal transport.

Stars

56

7-day growth

No data

Forks

0

Open issues

0

License

MIT

Last updated

2026-07-13

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It proves that a complex, real-time game can be built entirely inside a SQL database, challenging conventional assumptions about what SQL is capable of and serving as a creative, technical demonstration of SQLite's power.

Who it is for

  • Game developers interested in unconventional rendering pipelines
  • SQL enthusiasts and database engineers seeking advanced use cases
  • Systems programmers exploring minimal dependencies and terminal UIs
  • Educators looking for a dramatic way to teach SQL concepts

Use cases

  • Learning SQL through interactive gameplay that exposes every query in real time
  • Demonstrating SQLite's capabilities in performance-critical, frame-by-frame computation
  • As a reference implementation for building other SQL-driven applications or games
  • Entertainment for those who enjoy esoteric, minimalist game designs

Strengths

  • Zero third-party Python dependencies; only requires Python 3.11+ and SQLite 3.45+
  • Live SQL audit that shows the exact queries and state changes in the same transaction as the game
  • Comprehensive test suite (36 tests) covering gameplay, determinism, and the purity boundary between SQL and Python
  • Completely open architecture with clear separation of SQL-owned logic and minimal host transport

Considerations

  • Requires a Unix-like environment or WSL; no native Windows support
  • Needs a terminal with 24-bit color and Unicode block characters, and at least 80×33 terminal size
  • Floating-point trigonometry variances across SQLite builds can break deterministic replay across different environments
  • Custom databases can inject arbitrary terminal text if untrusted, so only use provided or trusted databases

README quick start

DOOMQL

SELECT * FROM HELL

A playable first-person shooter whose framebuffer is a SQL query.

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. There is no SVG, browser, Canvas or game engine, and the playable runtime contains no Python graphics code.

How does SQL become a picture?

For each frame, SQL reads the player and map tables and produces one row per pixel:

x    y    red    green    blue
40   20   232    240      248
41   20    30     35       45

A second SQL view turns those RGB rows into coloured terminal blocks. The Python host does no drawing: it supplies raw keys, time and terminal size to SQLite, then prints the completed query result unchanged.

player + map tables
        ↓
SQL simulation and raycasting
        ↓
frame_pixels(x, y, r, g, b)
        ↓
render_frame(y, coloured scanline)
        ↓
terminal

The complete visible frame is returned by one query:

SELECT scanline FROM render_frame ORDER BY y;

Play

You need:

  • macOS, Linux or another Unix-like environment; Windows users can use WSL
  • Python 3.11 or newer
  • SQLite 3.45 or newer with mathematical functions enabled
  • A terminal with 24-bit colour and Unicode support
  • At least 80 columns × 33 rows recommended

There are no third-party Python dependencies. From the repository root, run:

make run

The game follows the live terminal size. Enlarge the window for more SQL-rendered pixels, or increase the terminal font size to make each pixel physically larger.

Controls

KeysAction
W / SMove forward / backward
A / DStrafe left / right
J / L or arrow keysTurn left / right
SpaceFire
EUse the index gate
PPause
RRestart after death or victory
Ctrl-CExit

Objective

  1. Find the cyan-and-gold INDEX TOKEN.
  2. Return to the amber gate and press E.
  3. Defeat the red DEADLOCK.
  4. Reach the cyan commit portal.

Along the way you will meet ORPHAN enemies, ranged LOCK WAITERS, health tuples and ammo pages.

Watch the real SQL while you play

This is the best way to demonstrate

Description

A playable terminal FPS whose simulation and framebuffer are calculated in SQLite.

Related repositories

Similar projects matched by category, topics, and programming language.

lopopolo
Featured
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI & Machine LearningAI Agents
2,390
slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
littledivy
Featured
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI & Machine Learning
1,482