作者ZMTL (Zaious.)
看板AI_Art
标题[闲聊] OpenGame:一句提示词生成游戏
时间Thu Apr 23 09:55:04 2026
你有没有想过,脑袋里有一个游戏的点子,但因为不会写程式所以只能放弃?
OpenGame 就是想解决这个问题的开源框架。只要用一段文字描述你想要的游戏——
类型、玩法、画风、角色——它就会自动帮你把完整的可游玩网页游戏写出来,
不需要你动一行程式码。
这个专案来自香港中文大学 MMLab 研究室,在 2026 年 4 月刚刚正式开源。
它不是一般的 AI 补全工具,而是一套完整的「AI 代理人框架」。
背後的核心技术叫做 Game Skill,分成两个部分:
Template Skill 负责根据游戏需求选择合适的引擎(比如 Phaser、three.js、Canvas)
并建好专案骨架;
Debug Skill 则会在沙盒环境中自动执行游戏、找出错误、一直修到可以玩为止。
这两个技能让 AI 从「写出看起来合理的程式码」进化到「真的能跑、能玩的成品」。
驱动这套框架的模型叫 GameCoder-27B,
是一个专门为游戏开发训练过的 270 亿参数语言模型,
经过游戏引擎知识的预训练、有监督微调、
以及以「能不能跑起来」为奖励讯号的强化学习三个阶段打磨出来的。
换句话说,这不是拿通用模型硬用在游戏上,
而是真的针对多档案的游戏逻辑做了专项训练。
要怎麽用呢?装好环境之後(Node.js + npm install),
直接在命令列输入一段游戏描述就可以了。例如:
opengame "Build a playable web game about dodging meteors"
它就会自动跑完整个流程:选引擎、搭骨架、写程式、执行测试、修错误,
最後给你一个可以在浏览器打开的游戏。
研究团队用 150 个不同难度的游戏 prompt 做了评测,
OpenGame 在「能不能跑起来」、「画面能不能看」、「玩起来符不符合描述」三个维度
都达到了目前开源方案的最佳成绩。
GitHub:
https://github.com/leigest519/OpenGame
专案页面:
https://www.opengame-project-page.com/
论文:
https://arxiv.org/abs/2604.18394
Playable Demos
以下 6 个 Demo 都是由一句 prompt 直接生成的完整游戏,可在专案页面或 GitHub
README 的 Live Demo 连结直接玩:
漫威复仇者:无限打击
prompt(原文):"Build an epic side-scrolling action platformer starring the
Avengers. I want to select between Iron Man (lasers & flight), Thor (hammer
melee & lightning), or Hulk (smash attacks) to fight through 3 distinct
levels: a ruined City, a SHIELD Helicarrier, and finally Titan. Each hero
needs a basic attack, a special skill, and a screen-clearing Ultimate move.
The final boss must be Thanos using Infinity Stone powers. The art style
should be hardcore 90s Capcom arcade pixel art, not cute/chibi."
prompt(中文翻译):建造一款以复仇者联盟为主题的横向卷轴动作游戏。可选择钢铁人
(雷射+飞行)、雷神(鎚击+闪电)或浩克(砸击)闯过三个关卡:废墟城市、神盾局航
空母舰、最终决战泰坦星。每位英雄需有基本攻击、特殊技能与清场终极技。最终BOSS为
使用无限宝石能力的萨诺斯。美术风格为90年代CAPCOM街机像素风,非可爱风。
demo连结:
https://www.opengame-project-page.com/demos/marvel.mp4
哈利波特:算术占卜学院
prompt(原文):"Create a turn-based card battle game set in a pixel art
Hogwarts. I want to play as a wizard student dueling a rival in the Dueling
Club. The twist is that magic requires knowledge: to cast spell cards like
'Expelliarmus' or 'Stupefy', I must answer trivia questions (Math/Science)
correctly. Include a 'Magic Resonance' combo system where getting consecutive
right answers boosts my spell damage. The style should be atmospheric Gothic
fantasy pixel art with parchment-style UI and magical particle effects."
prompt(中文翻译):制作一款以霍格华兹为背景的回合制卡牌对战游戏。玩家扮演魔法
学生在决斗俱乐部挑战对手,施放「除你武器」或「昏昏倒地」等法术卡片前需正确回答
数学/科学知识问答。加入「魔力共振」连击系统,连续答对可提升法术伤害。画风为哥
德奇幻像素风,UI采羊皮纸风格搭配魔法粒子特效。
demo连结:
https://www.opengame-project-page.com/demos/harryPotter.mp4
知识拳皇:大闹天宫
prompt(原文):"Make a local 2-player quiz fighting game that looks and
feels like a classic 90s SNK retro arcade fighter (like The King of
Fighters). Instead of punching, players fight by racing to hit a 'Buzzer Key'
to answer physics questions. If you answer fast and correctly, you deal
damage; if you're wrong, you take self-damage. The setting is a grand
fighting tournament stage located in a majestic 'Heavenly Court' (Chinese
celestial realm), complete with ancient jade gates, floating auspicious
clouds, and golden traditional motifs. Include dramatic health bars, screen
shake on hits, and a 'K.O.' sequence. Visuals should be highly detailed
16-bit pixel art, typical of 90s arcade cabinets."
prompt(中文翻译):制作一款双人对战抢答格斗游戏,风格仿照90年代SNK街机格斗(
如拳皇系列)。双方不靠出拳,而是抢按「蜂鸣器键」来回答物理问题,答对造成伤害,
答错反伤自己。场地设定在庄严的「天庭」,有古老玉门、祥云浮动与金色传统纹饰。包
含夸张的血条、受击震动与「K.O.」动画。视觉为高细节16-bit像素风,符合90年代街机
美学。
demo连结:
https://www.opengame-project-page.com/demos/kombat.mp4
哈基米保卫战:金枪鱼危机
prompt(原文):"Make a hilarious tower defense game called 'Hajimi Defense'
where cute cats defend a 'Golden Tuna Can' from an invasion of household
pests (Cucumbers and Vacuums). The towers should be funny cat memes: a
spitting Tabby, a sniper Siamese, and a fat orange cat that throws buns for
AOE damage. Include a mechanic where players can click to break obstacles
(like boxes) to free up building space. The art style should be hand-drawn,
pastel, and super cute (Kawaii)."
prompt(中文翻译):制作一款搞笑塔防游戏「哈基米防卫战」,可爱的猫咪们要守护「
黄金鲔鱼罐头」对抗小黄瓜和吸尘器的入侵。防御塔为猫咪梗图风格:喷口水的虎斑、狙
击型暹罗猫、丢面包造成范围伤害的橘胖猫。加入点击破坏障碍物(如箱子)以释放建设
空间的机制。美术风格为手绘粉彩超卡哇伊风。
demo连结:
https://www.opengame-project-page.com/demos/hajimi.mp4
星球大战:曼达洛人协议
prompt(原文):"Create a high-intensity top-down action RPG shooter set in
the Star Wars universe. Play as The Mandalorian fighting through an Imperial
Base to rescue Grogu. The gameplay should be a Twin-Stick Shooter style where
I can use a Blaster (ranged), a Beskar Spear (melee), and a Jetpack Dash to
dodge."
prompt(中文翻译):制作一款高强度俯视角动作RPG射击游戏,背景为星际大战宇宙。
玩家扮演曼达洛人突破帝国基地拯救古鲁。玩法为双摇杆射击风格,武器包括爆能枪(远
程)、贝斯卡长枪(近战)及喷射背包冲刺回避。
demo连结:
https://www.opengame-project-page.com/demos/starWars.mp4
鱿鱼游戏:一二三木头人
prompt(原文):"Recreate the intense 'Red Light, Green Light' scene from
Squid Game as a survival reflex game. The player controls a character in a
green tracksuit running across a sandy field towards a finish line. There is
a Giant Robot Doll on the right; when she sings, we run; when she turns her
head, we must stop instantly or get shot. Crucial visual detail: Dead bodies
and blood pools should NOT disappear, they must pile up on the field to
create a chaotic atmosphere. Use a gritty, realistic 16-bit pixel art style."
prompt(中文翻译):重现鱿鱼游戏中紧张的「一二三木头人」场景,做成生存反应游戏
。玩家控制穿绿色运动服的角色在沙地上冲向终点线,右侧有巨型机器娃娃;她唱歌时跑
,她转头时必须立刻静止,否则中枪淘汰。重要视觉细节:死亡屍体与血迹不消失,要在
场地上越堆越多制造混乱气氛。画风为写实粗砺的16-bit像素风。
demo连结:
https://www.opengame-project-page.com/demos/squidGame.mp4
-
其实蛮好奇独立游戏开发者目前的感受是喜欢AI还是拒绝AI XD
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 1.161.109.157 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/AI_Art/M.1776909307.A.DC0.html
※ 编辑: ZMTL (1.161.109.157 台湾), 04/23/2026 09:56:44
1F:推 error405: 能直出点阵图平台跳跃吗 完成度真高 04/23 10:01
2F:推 Destiny6: 期待能复刻玛奇决战的那天到来... 04/23 10:20
3F:推 Jotarun: 我只知道玩家讨厌 04/23 11:48
4F:推 v86861062: 可以色色ㄇ 04/23 12:00
5F:推 hwider: 联合 04/23 13:00
6F:→ hwider: 厉害,打错字 04/23 13:00
8F:→ error405: 全丢给agent做 对阿 04/23 21:39