伪造DNA
一个面向AI代理的文本优先游戏设计平台。
什么是ForgeDNA?
ForgeDNA是一个开源生态系统,它将轻量级的JSON蓝图转化为完全可玩的游戏——由AI代理提供支持。你写一首 game_dna.json 描述游戏机制、世界、实体、资产和UI的文件。然后,一个由专业人工智能代理组成的管弦乐队接管了工作:生成3D模型、编写游戏代码、作曲、构建关卡,并将所有内容组装成可玩的构建。
愿景很简单:任何人——游戏设计师、业余爱好者或人工智能代理——都可以将完整的游戏定义为结构化数据。ForgeDNA平台处理其余的事情。开始时不需要游戏引擎专业知识。没有锁定单个发动机。只需描述你想要什么,然后看着它被构建。
该存储库包含完整的ForgeDNA堆栈:一个用于处理游戏模式的CLI工具,一个用于浏览和混音的社区中心,以及一个协调17个专门的AI代理将模式转换为游戏的Substrate Harness。一切都是MCP原生的,因此任何与MCP兼容的代理(Hermes、Claude Code、LM Studio等)都可以驱动构建管道。
全循环管道
ForgeDNA将游戏创作的每个阶段连接成一个完整的循环流程:
+---------------------------------------------------------------+
| ForgeDNA Pipeline |
| |
| (1) DESIGN |
| Human or AI creates game_dna.json |
| via CLI, Community Hub, or hand-coded |
| | |
| v |
| (2) SHARE |
| Browse, remix, and fork on the |
| Community Hub (local or HF Spaces) |
| | |
| v |
| (3) BUILD |
| Substrate Harness decomposes into tasks, |
| dispatches to 17 specialized agent types |
| | |
| v |
| (4) CREATE |
| Agents generate 3D models, textures, |
| audio, code, UI elements |
| | |
| v |
| (5) ASSEMBLE |
| Everything wired together into a |
| playable engine project (Godot, etc.) |
| | |
| v |
| (6) PLAY |
| Export and share globally (.apk, .exe, HTML5) |
| | |
| +--------------------> (loop back to Share/Remix) |
+---------------------------------------------------------------+每个阶段都可以独立使用。你可以手工编写模式,浏览中心寻找灵感,或者直接从模式构建。管道是可组合的——使用你需要的东西,跳过你不需要的东西。
快速开始
本地机器(Docker)
先决条件: Python 3.10+、Docker、git
# Clone the repo
git clone https://github.com/nousresearch/ForgeDNA.git
cd ForgeDNA
# Install the CLI
cd cli
pip install -e .
cd ..
# Install the Harness
cd harness
pip install -e .
cd ..
# Run the Community Hub
cd hub
pip install -r requirements.txt
python app.py
# Opens at http://localhost:7860
# In a separate terminal — start the MCP substrate server
docker build -t forge-substrate -f Schema-Builder/artifacts/forge-substrate/Dockerfile.godot .
docker run -p 8080:8080 -d forge-substrateHF空间(云)
将社区中心部署到拥抱面部空间,无需本地GPU:
# 1. Fork the template Space on Hugging Face
# 2. Set these secrets in your Space settings:
# - HF_TOKEN (for persistent storage)
# - FORGEDNA_HUB_REPO (your HF dataset repo for storage)
# The Space auto-deploys with:
# - Browse and filter game DNA files
# - Visual JSON editor with live validation
# - Remix any DNA file with one click
# - Upload/download game_dna.json files与现有代理商合作
ForgeDNA的Substrate Harness公开了一个MCP服务器,因此任何与MCP兼容的代理都可以驱动构建管道。
爱马仕代理商:
# In your Hermes config, add MCP server:
hermes setup tools
# Then add forge-substrate SSE endpoint: http://localhost:8080/sse克劳德代码:
# Add to your MCP server configuration:
{
"mcpServers": {
"forge-substrate": {
"url": "http://localhost:8080/sse"
}
}
}LM工作室:
# Add a new SSE Server connection:
# URL: http://localhost:8080/sse任何MCP兼容代理: 连接到 http://localhost:8080/sse 代理可以访问模式摄取、工作区命令、文件I/O和游戏导出工具。
打造你的第一款游戏
# 1. Create a new game DNA from a template
forgedna init --template rpg -o my_game.json
# 2. Validate it
forgedna validate my_game.json
# 3. Preview the build plan
forgedna-harness plan my_game.json
# 4. Dry-run the full pipeline (no actual generation)
forgedna-harness dry-run my_game.json
# 5. Or prompt your connected AI agent:
# "Ingest this game schema and build it: [paste game_dna.json]"GameDNA模式
ForgeDNA的核心是 game_dna.json schema——一种通用的、与引擎无关的JSON格式(JSON schema draft-07),用于定义完整的游戏设计。它捕获了AI代理生成可玩游戏所需的一切。
所需章节: meta, mechanics, world, entities 可选部分: assets, logic, ui
game_dna.json
|
+-- meta Title, genre, art style, platforms, player count
+-- mechanics Movement, combat, crafting, progression, economy
+-- world Environments, dungeons, procedural generation, weather
+-- entities Player, NPCs, enemies, items, equipment
+-- assets AI-generation-ready descriptions for 3D models, textures, audio, VFX
+-- logic Quests, world events, skill trees, crafting recipes
+-- ui HUD layout, menus, accessibility, color palette验证架构文件:
forgedna validate my_game.json架构位置: schema/game_dna.schema.json 架构版本: 1.0.0(兼容draft-07)
支持的流派: rpg、mmorpg、动作、冒险、平台游戏、益智游戏、策略、模拟、生存、roguelike、fps、tps、恐怖、赛车、体育、沙盒、视觉小说、塔楼防御、metroidvania、soulslike、战斗royale、moba、纸牌游戏、节奏、隐形、沉浸式sim、开放世界
支持的艺术风格: 写实、程式化、像素艺术2d、像素艺术3d、低多边形、透明、手绘、体素、retro16bit、retro8bit、极简主义、水彩、漫画、动漫、照片级真实感、抽象、剪纸、粘土、水墨
支持的平台: pc、mac、linux、web、android、ios、vr_quest、vr_pcvr、console_switch、console_ps5、console_xbox
组件
架构(schema/)
JSON Schema的正式定义 game_dna.json 文件夹。与引擎无关,专为人类人工智能协作而设计:人类定义创造性视觉,人工智能代理生成资产和代码。
# Validate with Python directly
python -c "import jsonschema, json; jsonschema.validate(json.load(open('my_game.json')), json.load(open('schema/game_dna.schema.json')))"
# Or use the CLI (recommended)
forgedna validate my_game.json该架构支持通过以下方式进行自定义扩展 custom_mechanics 力学部分的字段,允许游戏特定的独特力学,而无需修改核心模式。
CLI工具(cli/)
这 forgedna 用于模式验证、创建、比较和导出的命令行工具。
安装:
cd cli
pip install -e .全部8个命令:
forgedna validate Validate a game DNA file against the schema
forgedna init [--template ] Create new game_dna.json from built-in template
Templates: minimal, rpg, platformer, puzzle
forgedna remix Fork with lineage metadata preserved
Use -o to specify output path
forgedna info Show summary statistics (title, genre, counts)
forgedna diff Compare two DNA files, show what changed
forgedna list-templates List all available built-in templates
forgedna export -f summary Export as a markdown summary document
forgedna export -f prompt Export as an AI agent prompt for building示例:
# Create a new RPG from template
forgedna init --template rpg -o my_rpg.json
# Check what's in a game file
forgedna info examples/fantasy-mmorpg.json
# Compare two designs
forgedna diff examples/pixel-drift.json examples/quiet-hollow.json
# Generate a prompt for an AI agent to build the game
forgedna export -f prompt examples/quiet-hollow.json > build_prompt.txt社区中心(hub/)
用于浏览、查看、编辑和重新混合GameDNA模式的Gradio网络应用程序。可在本地部署或部署到拥抱面部空间。
本地运行:
cd hub
pip install -r requirements.txt
python app.py
# Opens at http://localhost:7860特征:
- 按流派、艺术风格、复杂性浏览和过滤游戏DNA文件
- 基于可视化表单的JSON编辑器,具有实时模式验证功能
- 一键混音任何DNA文件(分叉+编辑)
- 上传和下载game_dna.json文件
- 元、机制、世界、实体、资产、逻辑、UI的丰富部分查看器
- HF存储集成,用于持久化社区收藏
HF空间部署:
# Set these environment variables in your Space:
HF_TOKEN=hf_your_token_here
FORGEDNA_HUB_REPO=your-username/your-dataset-repo
# The app auto-detects HF Spaces and enables persistent storage基板线束(harness/)
将GameDNA模式转化为游戏的代理构建管道。这是皇冠上的宝石——一个管道编排器,它将游戏设计分解为可并行化的任务,并协调17个专门的人工智能代理来生成所有资产、代码和内容。
安装:
cd harness
pip install -e .它是如何工作的:
game_dna.json
|
v
[DNA Parser] ---------> Extracts: asset descriptions, quest logic,
| dungeon specs, mechanics, entity definitions
v
[Task Decomposer] -----> Breaks DNA into a DAG of 24-84+ tasks:
| - 3D asset generation
| - Texture generation
| - Audio generation (music, SFX, ambient)
| - Code generation (scripts, scenes)
| - UI generation
v
[Agent Orchestrator] --> Dispatches tasks to specialized agents,
| respects dependencies, manages parallelism
v
[Assembly Agent] ------> Wires everything into the target engine:
| - Imports 3D models
| - Applies textures
| - Connects audio
| - Links scripts to scenes
| - Builds UI layouts
v
[Test Agent] ----------> Validates the built game compiles and runs
|
v
[Output] --------------> Playable game build (.apk, .exe, HTML5)所有6个线束命令:
forgedna-harness parse Parse and show DNA structure summary
forgedna-harness plan Generate build plan (task DAG)
-o to save plan to JSON
-v for full task tree
forgedna-harness stat Detailed content inventory + build estimate
Shows parallelism analysis
forgedna-harness dry-run Simulate full pipeline without generating
Shows iteration-by-iteration execution
forgedna-harness agents List all 17 agent types and capabilities
forgedna-harness prompt Generate agent prompt for a specific task示例:
# See what the harness sees in a game file
forgedna-harness parse examples/quiet-hollow.json
# Generate and save a build plan
forgedna-harness plan examples/quiet-hollow.json -v -o plan.json
# Get a full inventory of what needs to be built
forgedna-harness stat examples/fantasy-mmorpg.json
# Simulate the build (no actual generation)
forgedna-harness dry-run examples/pixel-drift.json
# See all available agent types
forgedna-harness agents
# Generate a prompt for a specific build task
forgedna-harness prompt examples/quiet-hollow.json qh_assets_001代理类型(共17种):
ASSET AGENTS (parallelizable)
asset_3d 3D Asset Generator - 3D meshes via TripoSR, InstantMesh
texture Texture Generator - PBR textures via Stable Diffusion
animation Animation Generator - Skeletal animations from text
vfx VFX Generator - Shaders, particles, post-processing
AUDIO AGENTS (parallelizable)
audio_music Music Generator - Background music, themes
audio_sfx SFX Generator - Sound effects from descriptions
audio_ambient Ambient Generator - Environmental soundscapes
audio_voice Voice Generator - NPC voices with character profiles
CODE AGENTS
code_player Player Controller - Movement, abilities, glyph systems
code_enemy Enemy AI - Behavior trees, attack patterns
code_combat Combat System - Damage calc, status effects
code_quest Quest System - Quest logic, dialogue trees
code_crafting Crafting System - Recipes, gathering, economy
code_ui UI Agent - HUD, menus, inventory screens
code_world World Building - Levels, scenes, day-night, weather
PIPELINE AGENTS
assembly Assembly Agent - Integrates all assets into engine
test Test Agent - Validates compilation, no crashes示例游戏
这 examples/ 目录包括三个完整的GameDNA文件,展示了不同尺度下的模式:
File Game Complexity Size
---------------------------------------------------------------------------
fantasy-mmorpg.json Echoes of Aethermoor Full schema ~52KB
5-region MMORPG with 8 elements, classless glyph
system, 5 dungeons, 20-person raid, player economy
pixel-drift.json Pixel Drift Focused ~14KB
Retro-futuristic 2D hover-bike racing with drifting
mechanics, 3 environments, procedural tracks
quiet-hollow.json Quiet Hollow Minimal ~12KB
Cozy hand-painted puzzle-adventure about restoring
a garden. No combat, plant growth puzzles
---------------------------------------------------------------------------# Explore any example
forgedna info examples/fantasy-mmorpg.json
forgedna-harness stat examples/pixel-drift.json
forgedna-harness dry-run examples/quiet-hollow.json仓库结构
ForgeDNA/
schema/ Formal JSON Schema definition (draft-07)
game_dna.schema.json
examples/ Complete example game DNA files
fantasy-mmorpg.json
pixel-drift.json
quiet-hollow.json
cli/ forgedna CLI tool (Python + Typer)
forgedna/
cli.py Entry point, 8 commands
validate.py Schema validation
init.py Template creation
remix.py Fork with lineage
export.py Export to markdown/prompt
info.py Summary statistics
diff.py Comparison tool
templates/ Built-in templates
hub/ Community Hub (Gradio web app)
app.py Browse, view, edit, remix
requirements.txt
harness/ Substrate Harness (agentic pipeline)
harness/
cli.py 6 harness commands
dna_parser.py GameDNA parsing
task_decomposer.py DAG task decomposition
orchestrator.py Agent orchestration
agent_specs.py 17 agent type definitions
mcp_server.py MCP server for agent integration
Schema-Builder/ React/Vite frontend (planned)
IMPLEMENTATION_PLAN.md Development roadmap
LICENSE Apache-2.0贡献
ForgeDNA是完全开源的。欢迎在所有领域捐款:
架构改进:
- 在模式中添加新的机制、艺术风格或流派类型
- 提交新流派的示例游戏DNA文件
- 改进验证规则和错误消息
新代理类型:
- 在中添加代理规格
harness/harness/agent_specs.py - 每个代理都需要:类型、名称、描述、工具、模型、并行化配置
- 有关图案,请参阅现有规格
新模板:
- 将JSON模板文件添加到
cli/forgedna/templates/ - 将它们注册到
cli/forgedna/init.py
集线器功能:
- 在中增强Gradio UI
hub/app.py - 添加搜索、筛选和社区功能
- 为计划中的React前端做出贡献
利用改进:
- 改进任务分解策略
- 添加新的引擎适配器(Unity、虚幻、Web)
- 增强MCP服务器功能
# Fork, clone, and install in dev mode
git clone https://github.com/your-username/ForgeDNA.git
cd ForgeDNA
cd cli && pip install -e . && cd ..
cd harness && pip install -e . && cd ..
# Make your changes, then submit a PR许可证
Apache-2.0--参见 许可证 了解详情。
免费使用、修改和分发。构建游戏,构建工具,构建AI驱动的游戏开发的未来。
