AI产品精选

DOOMQL:用SQLite当游戏引擎,由GPT-5.6 Sol打造

DOOMQL

精选理由

Peter 用 GPT-5.6 Sol 整了个逆天项目:用 SQLite 跑游戏引擎,所有像素都是 SQL 算出来的。你可以在终端玩,还能在 Datasette 里围观实时地图。

AI 摘要

Peter Gostev 使用 GPT-5.6 Sol 构建了 DOOMQL,一个将 SQLite 完全作为游戏引擎的类 Doom 游戏。游戏中的移动、碰撞、敌人、战斗、进度和每个 RGB 像素均由 SQL 查询控制,核心是一个使用递归 CTE 的完整光线追踪器。项目实现为 Python 终端脚本,运行时生成 SQLite 数据库,可通过 Datasette 和 Datasette Apps 插件实时查看画面。Peter 用 Fable 5 在 Claude 中创建了一个 HTML+JavaScript 应用,能每秒刷新显示游戏状态并包含小地图。

原文 · Simon Willison’s Weblog

DOOMQL

DOOMQL Peter Gostev built this using GPT-5.6 Sol. This is a lot of fun: 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. It's implemented as a Python terminal script - I tried it out like this: cd /tmp git clone https://github.com/petergpt/doomql cd doomql uv run host/doomql.py Here's the huge SQL query that implements a full ray tracer in SQLite using a recursive CTE. Running the above script creates a /tmp/doomql/.doomql/doomql.sqlite SQLite database, which you can explore using Datasette like this: uvx --prerelease=allow --with datasette-apps datasette \ /tmp/doomql/.doomql/doomql.sqlite \ -p 4444 --root --secret 1 --internal internal.db The --with datasette-apps option installs the new Datasette Apps plugin, which supports creating custom HTML+JavaScript apps that can run SQL queries directly within the Datasette interface. I created a new app, pasted the copy-paste prompt into Claude chat (Fable 5) and told it : Build an app that displays the current state of the screen using the frame_pixels view with its x, y, r, g, b columns. have it refresh once a second. This got me a working HTML+JavaScript app inside Datasette that could reflect the current state while I played the game in my terminal. Then I added: add a minimap And now my Datasette App looks like this: Here's the HTML app code - paste that into your own Datasette instance (using the uvx --with datasette-apps recipe from above) to try it yourself. Via @petergostev Tags: games , sql , sqlite , ai , datasette , generative-ai , llms , ai-assisted-programming , gpt , datasette-apps