---
title: "DOOMQL：用SQLite作为游戏引擎的AI生成Doom风格游戏"
source: "Simon Willison 博客（Atom）"
source_tier: "t2"
url: "https://simonwillison.net/2026/Jul/13/doomql/#atom-everything"
permalink: "https://feed.astralor.com/items/itm_5d56648d8b0172024a741bfc"
published: "2026-07-13T22:34:41.000Z"
score: 71
channel: "ai"
tags: ["AI辅助编程","Datasette","DOOMQL","GPT-5.6 Sol","SQLite"]
---

# DOOMQL：用SQLite作为游戏引擎的AI生成Doom风格游戏

## AI 点评

> DOOMQL完美地展示了AI如何将看似不相关的技术（SQLite和游戏引擎）结合出惊人效果。对于数据库爱好者和AI编程探索者来说，这是一次绝妙的灵感碰撞。

## 速览

DOOMQL由Peter Gostev使用GPT-5.6 Sol构建，让SQLite充当完整游戏引擎，实现了包含光线追踪、碰撞、敌人、战斗和升级机制的类Doom游戏。每个像素由SQL递归CTE驱动，以Python终端脚本运行。结合Datasette和AI生成的App，可实时查看游戏画面和迷你地图，展现了AI在创意编程中的惊人潜力。

## 关键点

- 使用GPT-5.6 Sol生成，SQLite作为完整游戏引擎驱动移动、碰撞、敌人、战斗和画面渲染。
- 通过递归CTE实现完整光线追踪器，每个像素由SQL查询生成。
- 游戏作为Python终端脚本运行，同时创建SQLite数据库供Datasette实时分析。
- 借助Datasette Apps插件和Claude（Fable 5）生成HTML+JavaScript应用，实时显示游戏画面和迷你地图。

## 全文

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

---

引用前请核对原文;本文由星际流动整理:https://feed.astralor.com/items/itm_5d56648d8b0172024a741bfc
