🎮 Agent Sprite Forge:2.2k Stars,用自然语言让 AI Agent 直接生成游戏素材,Unity / Godot 开箱即用
项目地址:github.com/0x0funky/agent-sprite-forge | ⭐ 2,201 Stars | 🛠 Python | 作者 0x0funky
老实说,做独立游戏最烦的不是写代码,是画素材。找个画师按张收费,一张角色几百块,迭代几次预算就炸了。用 AI 画图吧,Stable Diffusion 调半天 prompt 出一堆没法直接用的图,还得自己抠图、分帧、切片。Agent Sprite Forge 直接解决了这个问题——跟 Codex 说一句话,它替你搞定 sprite sheet、地图、甚至完整的 Godot/Unity 工程。
⚡ 核心能力
这玩意儿不是普通的 prompt 合集。它是一套 Codex-first 的 2D 游戏素材工作流,分两个技能:
$generate2dsprite — 生成角色、怪物、道具、法术特效的 sprite sheet + 动画帧 + GIF
$generate2dmap — 生成分层地图、prop pack、碰撞区域,甚至可直接编辑的 Godot TileMap 场景
流程很简单:你告诉 Codex 想要什么 → Agent 决定素材类型和布局 → 内置图像生成出原始图 → Python 脚本自动做去底、分帧、对齐、导出透明 PNG/GIF。
🛠 安装
git clone https://github.com/0x0funky/agent-sprite-forge.git
cd ./agent-sprite-forge
python3 -m pip install -r ./requirements.txt
mkdir -p ~/.codex/skills
cp -R ./skills/* ~/.codex/skills/
装完重启 Codex session,技能就加载好了。
🎯 上手实测
直接在 Codex 里说一句:
Use $generate2dsprite to create a side-view lightning knight attack animation.
Agent 会自己规划:确定帧数 → 选择合适的版面布局 → 生成 raw sprite sheet → 运行本地脚本来抠图、分帧、输出透明 PNG 和 GIF。你拿到手的直接是可用的游戏素材。
地图也一样:
Use $generate2dmap to create a Godot-editable RPG map with separated props,
encounter grass Area2D zones, collision StaticBody2D blockers, exit zones,
and a debug player scene.
输出直接就是 Godot 4 的可编辑场景——TileMapLayer、独立 Sprite2D 道具、碰撞体、退出区域,全给你搭好。
🔥 最骚的是
它真的做出了可玩的原型。README 里展示了几个完整的游戏:
- Summon Survivors — Unity WebGL 的类 Vampire Survivors 游戏,从地图到英雄到敌人到 HUD,全套素材 + 游戏逻辑都是 Agent 生成的,在线可玩
- Forest Pass Defense — Godot 塔防,6 个塔家族 + 飞行敌人 + boss,完整的 build/upgrade/sell 流程
- Sengoku Era — 浏览器里玩的宝可梦 Like 游戏,战斗画面 + 选宠流程全有
一个 prompt 出一整套游戏,不是玩具 demo,是真能跑的那种。
⚠️ 踩坑
- Python 依赖要装:Pillow 和 numpy 是必须的,少了的话脚本跑不起来,sprite 会带 magenta 背景
- 用参考图时先
view_image:如果想让 Agent 参考某个风格,先把图在对话里打开,再发 prompt,不然 Agent 看不到
- 大型角色用 3x3 idle,小技能用 1x4 / 2x2,效果最好
要点总结
- 一句话生成 sprite sheet + 动画,不用手动抠图分帧
- 支持 Godot / Unity 工程导出,地图带碰撞、区域、出口
- Python 脚本做确定性后处理,不是让 AI 再画一遍
- 适合独立开发者、Game Jam、快速原型
# 🎮 Agent Sprite Forge: 2.2k Stars — Generate Game Assets with Natural Language, Ready for Unity & Godot
> Repo: [github.com/0x0funky/agent-sprite-forge](https://github.com/0x0funky/agent-sprite-forge) | ⭐ 2,201 | 🛠 Python
---
Honestly, the hardest part of indie game dev isn't coding — it's the art assets. Hiring a sprite artist is expensive, and AI-generated images still need manual cleanup, frame extraction, and slicing. **Agent Sprite Forge fixes this: tell Codex what you want, and it generates production-ready sprite sheets, layered maps, even complete Godot/Unity projects.**
## ⚡ Core Features
Two Codex skills:
- **`$generate2dsprite`** — Characters, monsters, props, spell FX: sprite sheets + animated frames + GIFs
- **`$generate2dmap`** — Layered maps, prop packs, collision zones, and editable Godot TileMap scenes
The agent plans the layout, image gen creates the raw art, then deterministic Python scripts handle chroma-key removal, frame splitting, alignment, and transparent PNG/GIF export.
## 🛠 Install
git clone https://github.com/0x0funky/agent-sprite-forge.git
cd ./agent-sprite-forge
python3 -m pip install -r ./requirements.txt
mkdir -p ~/.codex/skills
cp -R ./skills/* ~/.codex/skills/
Restart Codex and the skills are ready.
## 🎯 Quick Start
Just say:
Use $generate2dsprite to create a side-view lightning knight attack animation.
The agent decides the frame count, generates the raw sheet, runs cleanup scripts, and outputs transparent frames + GIF. Same for maps — one prompt gives you a fully editable Godot scene with TileMapLayers, props, collision, and exit zones.
## 🔥 The Cool Part
The README shows real playable prototypes built entirely through this workflow:
- **Summon Survivors** — Unity WebGL Vampire-Survivors-like with generated art, [playable online](https://summon-survivors.vercel.app/)
- **Forest Pass Defense** — Godot tower defense with 6 tower families and bosses
- **Sengoku Era** — Browser Pokémon-like with battle UI and starter selection
These aren't tech demos. They're actual games.
## Key Takeaways
- One prompt → production sprite sheets + animations
- Godot/Unity export with collision, zones, exits
- Python scripts handle non-AI post-processing
- Perfect for indie devs, Game Jams, and rapid prototyping
标签:GameDev AI Agent Codex Sprite 2D Assets