DOOMQL 是一个可玩的类毁灭战士射击游戏,其所有方面——移动、AI、渲染和像素——完全由 SQLite 查询计算,Python 仅作为最小的终端传输层。

Stars

56

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

MIT

最近更新

2026-07-13

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它证明了一个复杂的实时游戏可以完全构建在 SQL 数据库内部,挑战了人们对 SQL 能力的传统认知,并作为 SQLite 功能的创意技术演示。

适合谁使用

  • 对非传统渲染管线感兴趣的游戏开发者
  • 寻求高级用法的 SQL 爱好者和数据库工程师
  • 探索最小依赖和终端 UI 的系统程序员
  • 寻找戏剧性方式教授 SQL 概念的教育者

典型使用场景

  • 通过实时显示每条查询的交互式游戏学习 SQL
  • 演示 SQLite 在帧级性能关键型计算中的能力
  • 作为构建其他 SQL 驱动应用或游戏的参考实现
  • 为喜欢深奥、极简游戏设计的人提供娱乐

项目优势

  • 零第三方 Python 依赖;仅需 Python 3.11+ 和 SQLite 3.45+
  • 实时 SQL 审计,在游戏同一事务中显示确切查询和状态变更
  • 全面的 36 项测试套件,涵盖游戏玩法、确定性以及 SQL 与 Python 之间的纯度边界
  • 完全开放的架构,SQL 拥有的逻辑与最小宿主传输层清晰分离

使用前须知

  • 需要类似 Unix 的环境或 WSL;不支持原生 Windows
  • 需要支持 24 位色和 Unicode 方块字符的终端,且至少 80×33 终端尺寸
  • 不同 SQLite 构建中的浮点三角函数差异可能导致跨环境确定性回放失效
  • 自定义数据库可注入任意终端文本(若不受信任),因此仅使用提供的或受信任的数据库

README 快速开始

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

项目描述

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

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
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 与机器学习AI 智能体
2,390
slvDev
精选
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 与机器学习大语言模型
1,960
littledivy
精选
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 与机器学习
1,482