使用 Gemini 4 Carbon、Roblox MCP 和 Tripo Studio MCP 制作 Roblox 游戏

使用 Gemini 4 Carbon、Roblox MCP 和 Tripo Studio MCP 制作 Roblox 游戏

使用 Roblox MCP、Gemini 4 Carbon 和 Tripo 制作 Roblox 游戏。通过八个步骤,从游戏设计和 3D 资产走向可玩且经过测试的原型。

Mone
进阶其他原文链接

“AI 游戏开发正在 Roblox 上迅速增长,” a16z 在 X 上写道,并提到 Roblox MCP 使用量增加,以及过去 90 天内上线的游戏在热门游戏中的占比上升。如果亲手制作一款游戏,这套工作流会是什么样?

Roblox MCP 将 AI 编程客户端连接到 Roblox Studio,让它能够检查场景、编辑脚本和运行试玩。本教程以 Your Turn 为例:这是一款双人桌面对决游戏,使用 Antigravity 中的 Gemini 4 Carbon 开发,通过 Roblox MCP 操作 Studio,并用 Tripo 制作 3D 道具和物品图标。玩家隔着灯光照亮的桌子对决,利用有限信息和特殊物品智胜对手。

大约一小时内,这次开发产出了 12 个脚本、约 4,000 行 Luau、10 个 Tripo 模型和 11 个图标。按照下面八个步骤连接工具、构建游戏规则、导入资产并测试结果。

你将学到什么

  • 将 AI 编程客户端连接到 Roblox Studio MCP,并确认连接的是正确的 Studio 会话。
  • 连接 Tripo,生成案例使用的模型和物品图标。
  • 先用占位物体实现游戏规则,再导入并对齐生成的模型。
  • 扩展原型前,检查隐藏信息、玩法、界面和数据持久化。

Gemini、Roblox Studio MCP 和 Tripo 如何协作

这套工作流分为三类职责。Gemini 通过 AI 客户端规划和编写代码。Roblox Studio MCP 提供在当前打开的游戏项目中执行操作的工具。Tripo 生成可下载的资产,再上传并插入 Roblox。

组件在此工作流中的职责
Antigravity 中的 Gemini 4 Carbon理解设计文档、规划改动、编写 Luau 并评估工具结果。
Roblox Studio MCP检查场景、编辑脚本、运行 Luau、控制试玩模式并截取视口画面。
Tripo Studio MCP在 Antigravity 中通过 Tripo Studio MCP 生成并下载 3D 资产,并制作物品图标所需的图像资产。
Roblox Open Cloud 导入上传获准使用的本地文件、等待资产处理完成,再插入生成的 Roblox 资产。

Roblox MCP 内置于 Studio,因此 Gemini 可以直接操作当前打开的游戏。Tripo 创建模型和图标,Roblox 的导入工具负责把它们放入场景。

本项目使用 Antigravity 中的 Gemini 4 Carbon,AI 可以在其中运行工具并处理本地文件。跟随教程时请使用这一配置。

开始前的准备

  • 安装最新版本的 Roblox Studio,并登录有权管理目标体验的账号。
  • 提示词
    text
    Install Tripo Studio MCP for me. Install the Skill from https://github.com/Tripo-Developer/Tripo-Studio-MCP and connect to https://msapi.tripo3d.ai/mcp using OAuth with client ID studio-codex (loopback redirect http://127.0.0.1:<port>/callback). Open the browser for sign-in, then verify the tools are available.
    
  • 创建项目文件夹,保存游戏设计文档、导出的模型、图标和任务记录。

第 1 步:将想法整理成一份简短的游戏设计文档

从游戏循环开始,而非从工具开始。Your Turn 的设计确定了三局两胜制、用灯表示生命值、装有两至六发弹药的六膛道具、三个可选目标,以及揭示或改变信息的物品。之后增加美术、界面或成长系统时,书面规格能为智能体提供稳定的参照。

每次装填有两至六发弹药,至少包含一发红弹和一发白弹。三局两胜比赛的三局中,每位玩家分别拥有两盏、三盏和四盏灯。红弹命中会熄灭一盏灯,白弹为空包弹。向对手射击会结束回合;向自己发射空包弹可以再行动一次;射击假人会揭示该发弹药并结束回合。玩家有 25 秒作出决定,超时后游戏自动向对手射击。每次装填获得三个物品,最多持有六个。

建议提示词

text
I want to make a Roblox game in which two players duel with a revolver. This format suits the way Roblox players interact. Write a detailed design outline covering the game name, a one-sentence pitch, a game description, its elements, the systems built from those elements and how they interact, distinctive features, and a plain-language introduction to the story and play sequence for players (no more than 100 words). Then suggest additional designs and list the external support they would need, such as generating models with Tripo Studio MCP.

本案例的设计评审确立了四项约束:

  • 保持风格化的命中效果。项目用红白两色的“符咒弹”替代子弹,命中时熄灭一盏灯,并使角色的一部分变成纸张。不出现血液或尸体。
  • 不设置赌注:没有入场费、下注,或将对手物品作为奖品。为避免赌博设计,比赛结果仅影响评级和外观奖励。
  • 不出现酒精、烟草、药丸或酒吧场景。由于担心被评为 18+,场景改为街机厅后屋。
  • 标题或宣传中不使用“轮盘赌”或“赌博”,场景内也不放置赌场道具。

阅读平台的书面规则,并查看适合目标评级的现有游戏。规则评审涉及主观判断,不能保证通过审核;发布前应准确填写内容成熟度问卷。

案例设计图将比赛规则、隐藏信息、物品、观众和成长系统分别列出。
案例设计图将比赛规则、隐藏信息、物品、观众和成长系统分别列出。

设计文档规划了从 M1(纸面测试)到 M7(四人对决桌)的里程碑。首次开发聚焦于可玩的 1v1 桌面对决和 AI 对手,四人比赛留待后续。

第 2 步:将 AI 客户端连接到 Roblox Studio MCP

启用 Studio 并连接客户端

  • 在 Roblox Studio 中打开一个场所,然后打开 Assistant。
  • 点击省略号菜单,再选择 Manage MCP Servers。
  • 打开 Enable Studio as MCP server。
  • 在 Quick connect 下启用 Antigravity 或你选择且已安装的客户端。
  • 重启客户端以载入连接。如果列表中没有该客户端,请先安装它,再重启 Studio。

Roblox 的 Quick connect 选项包括 Antigravity、Claude Code、Claude Desktop、Cursor、Gemini CLI、Codex CLI 和 Visual Studio Code。如果你正在寻找 Roblox MCP 插件或 GitHub 下载,请优先使用这条内置路径。官方配置不需要单独的社区桥接工具。其他 JSON 和命令配置方法可参阅 Roblox Studio MCP 文档。

案例截图展示了启用后的 Studio MCP、已连接客户端,以及 Antigravity 的 Quick connect 选项。
案例截图展示了启用后的 Studio MCP、已连接客户端,以及 Antigravity 的 Quick connect 选项。

编辑前验证会话

text
Check whether Roblox MCP is connected. Read information only: tell me which place is currently open and what is in it. Do not make any changes.

确认绿色连接指示灯亮起,再让 Gemini 描述当前打开的场所。如果同时打开了多个 Studio 窗口,改动前先确认它选中了正确的窗口。

任务相关 Studio MCP 工具
找到正确的场所list_roblox_studios
检查场景search_game_tree, inspect_instance
读取和修改代码script_read, script_grep, multi_edit
构建或模拟execute_luau
运行试玩start_stop_play, character_navigation, user_keyboard_input, user_mouse_input
检查结果screen_capture, get_console_output
插入已上传的资产insert_asset
保存场所save_place

授权目标位置和上传文件夹

  • 打开一个属于已保存到 Roblox 的体验的场所。仅保存在本地的场所无法使用按游戏授予的 Open Cloud 权限。测试期间保持体验为私密状态。
  • 从 Studio 的 MCP 控件或 Assistant 设置中打开 MCP Permissions。
  • 启用上传工作流需要的 asset:read 和 asset:write 权限范围。
  • 在 Open Cloud upload directories 下批准项目导出文件夹。

选择 Open Cloud upload directories 中显示的项目文件夹,并启用本次导入所需的资产权限。上传前检查目标所有者;截图中可见的其他权限类别不属于这一步的必需项。

案例配置中的 Open Cloud upload directories。项目路径已遮挡,只应启用所需权限。
案例配置中的 Open Cloud upload directories。项目路径已遮挡,只应启用所需权限。

第 3 步:构建并测试灰盒对决

使用基础部件搭建房间、座位、灯、假人和左轮手枪占位物。这一轮的目的是先验证规则,再投入时间制作资产。为道具、枪口、摄像机和物品位置命名附着点,使最终模型可以替换占位物,而无需重写比赛逻辑。

text
Read Game Design Document.md in the project folder and build the game in the currently open Roblox Studio place. Scope: a playable 1v1 duel table and an AI dealer for solo play; leave ranks and the shop for later. First build a graybox with basic parts: a backroom lobby, four tables, two seats per table, lamps for each player, a placeholder revolver, and a dummy. Keep all rules on the server and never send the round order in the cylinder to clients. Use English for in-game text. After running it, play a match against the dealer yourself in Play mode and show screenshots.
案例中在 Roblox Studio 内通过 AI 辅助构建游戏的过程画面。

本案例将比赛状态、弹膛序列、AI 决策、共享视觉效果和客户端界面分开。弹膛序列仅保存在服务器上。客户端接收公开计数、已结算的射击结果;只有游戏行为赋予玩家查看资格时,才接收对应私密信息。

脚本或模块在案例中的职责
Main入座、AI 座位、远程事件、输入校验和聊天隔离。
Match单张桌子的回合、计时器、灯和三局两胜结果。
Chamber仅在服务器上保存隐藏弹药序列。
DealerAI 和 TableVisuals对手决策和共享视觉状态。
ItemDefs 和 Remotes共享物品文本,以及 Action、State、Private 和 Fx 事件。
YourTurnClientHUD、入座视角,以及道具和符咒效果。

Gemini 首先运行了 400 场完整的纯服务器模拟比赛,没有出现错误。随后进入 Play 模式,坐到桌前与庄家对战,通过截图和控制台输出检查胜利、失败和投降。多人和设备测试在这一轮之后进行。

第 4 步:加入物品、AI 庄家和虚张声势动作

Your Turn 的策略来自公开计数与私密知识之间的信息差。11 个物品会改变这一差距、生命值或回合顺序。它们的行为应定义得足够清晰,以便独立测试。

物品案例中的行为
Peephole私下揭示当前弹药。
Ratchet不揭示当前弹药,将其移到末尾;继续当前回合。
Odd Potion有 50/50 的概率恢复两盏灯或失去一盏灯。
Heavy Charm使下一发红弹熄灭两盏灯。
Hand Press跳过对手的下一回合;禁止连续使用。
Hot Tea恢复一盏灯。
Switch将当前弹药在红色和白色之间切换。
Whisper私下揭示后续某发弹药的颜色。
Sleight拿取并立即使用对手的一个物品。
Scramble打乱剩余弹药,并使先前窥视得到的信息失效。
Reverse反转剩余弹药的顺序。
text
Add the 11 items from the design document. Peephole and Whisper results are private information and must be sent only to the player using the item. Add an AI dealer that takes the empty seat when a player requests a solo match. The dealer must play fairly: it may use only the public red and white round counts and information obtained through its own items, never the hidden sequence. Add table-side actions (smirk, sweat, shrug, tap the table, stare, yawn, laugh, and point). They do not affect the rules and are only for bluffing. Hide spectator chat from seated players.

八个动作分别是坏笑、流汗、耸肩、敲桌、凝视、打哈欠、大笑和指向。它们不改变规则。使用私密信息物品后,玩家可以如实表现或虚张声势。案例为庄家单独记录其合法获取的信息,并在剩余弹药被打乱后清除过时知识。入座玩家看不到观众聊天。

第 5 步:使用 Tripo 生成三个核心道具

从玩家近距离看到的物体开始:黄铜左轮手枪、无脸庄家木偶和台灯。先做小批量,可以在制作房间其他部分前检查风格、几何和导入流程。

text
In Antigravity, use Tripo Studio MCP to generate three models: a brass revolver, a faceless dealer puppet, and a table lamp. Tell me the credit cost first. Use the same style description for all three and control their polygon counts so they can be imported into Roblox without extra cleanup. Save the files to the project folder and show previews.

三个核心资产的建议提示词:

text
An antique brass six-shot revolver, long barrel, paper-charm patterns engraved on the cylinder, dark walnut grip, ornate fantasy game prop, stylized hand-painted appearance, single object, side view.
text
A faceless wooden marionette dealer, smooth blank oval head with no facial features, wearing a dark red waistcoat, bow tie, and white gloves, waist-up bust, arms bent forward, hands resting flat in front, a fortune-telling automaton in an old arcade, stylized hand-painted game character, single object.
text
A small antique brass oil table lamp, transparent glass chimney, round base, ornate fantasy game prop, stylized hand-painted appearance, single object.

最初三个道具使用 P2.0 文本生成 3D,开启纹理并关闭 PBR,本次制作中每个花费 110 积分。开始下一批任务前,请检查所选设置的费用。

统一的风格描述可以让各次生成朝着相同方向发展,但仍需进行视觉比较。描述游戏实际需要的姿态:庄家是坐姿半身像,因为它不需要站立或行走。

生成的左轮手枪是一个整体网格。原型通过移动整个物体实现抬枪、瞄准和后坐力。可打开的弹巢或独立运动的击锤需要拆分部件,并额外进行一轮准备。

将核心道具导入 Roblox Studio

完成第 2 步的上传授权后,Gemini 通过 Open Cloud 上传各个 GLB,等待资产就绪,再插入场景并与 Tripo 预览比较。

检查导入后的结果,而不只是上传状态

案例观察原型中的调整
道具显得太小缩放放置的副本:左轮手枪 ×3、台灯 ×1.5、庄家 ×3.6。这些是本案例专用数值。
初始道具朝向错误统一朝向,并记录预期的前向轴。
道具没有锚定锚定静态物体,使其在游戏中保持原位。
纹理通过网格纹理 ID 导入修改材质前,先检查游戏中的实际外观。

左轮手枪采用统一朝向:枪管沿 −Z,顶部沿 +Y,并在 Root 部件上设置 Muzzle 附着点。后续皮肤可以采用同一布局,无需修改游戏代码。

生成面数上限设为 6,000 至 14,000 时,这些模型无需额外在 Blender 中减面即可进入 Studio。导入自己的资产前,请检查导出的网格。

第 6 步:布置房间并制作物品图标

初次导入成功后,案例又扩展了七个道具:训练假人、圆桌、椅子、街机、储物柜、弹球机和一叠 CRT 电视。沿用已认可的风格描述,再补充各个物体的功能细节。

建议提示词

text
In Antigravity, use Tripo Studio MCP to generate the remaining assets, all in the same style as the first three models: a training dummy, a round game table, a chair, an arcade cabinet, a locker, a pinball machine, and a stack of vintage CRT televisions. Then make a pixel-art icon for each of the 11 items. Upload and place all the assets: replace the tables, chairs, and dummies, and place the other props along the lobby walls.

桌子、假人、弹球机和 CRT 电视组的面数上限为 8,000;街机为 7,000;椅子和储物柜为 6,000。

每条道具提示词以物体描述开头,以相同的风格描述结尾:

text
…stylized hand-painted game prop, slightly grimy and worn, old arcade backroom, single object.

七个房间道具中的两个示例:

text
A round game table with a completely flat dark-green felt top, a thick carved dark-walnut rim inlaid with brass, a stout turned wooden central pedestal, and a wide round foot, stylized hand-painted game prop, slightly grimy and worn, old arcade backroom, single object.
text
A shooting training dummy: a coarse burlap sack torso stuffed with straw, a round burlap head with no facial features, mounted on a wooden post with a round wooden base, a wooden crossbar for arms, a red-and-white target painted on the chest, visible stitching, stylized hand-painted game prop, slightly grimy and worn, old arcade backroom, single object.

措辞上的小调整很有帮助:“completely flat”说明了游戏需要的平坦桌面,而“no text”和“blank marquee”避免街机和弹球机出现不想要的文字。请在生成预览中检查这些细节。

11 个物品图标使用统一的文本生成图像模板,仅替换主体:

text
Pixel-art game item icon: a steaming ceramic green-tea cup on a small saucer, chunky 32×32 retro style, hard pixel edges, thick dark outlines, limited to bone white, amber brass, rust red, and coal black, one centered object, solid flat background, no text, no border.

本次制作中,每个图标花费 10 积分。提示词中的“32×32”指复古风格;为 HUD 准备图像时,请检查实际输出尺寸。

案例中的 11 个物品图标使用相同的配色和像素画处理方式,仅主体随物品变化。
案例中的 11 个物品图标使用相同的配色和像素画处理方式,仅主体随物品变化。

道具和物品图标准备好后,下一轮重点是灯光和周围的 HUD。

第 7 步:调整灯光并制作复古 HUD

灯光

视觉方向是暗黑恐怖:PS1 时代的低多边形风格、工业磨损与衰败感,以及少量童话哥特元素。

text
The scene looks too flat. Give it a dark horror style like Buckshot Roulette: make the room almost completely black, put a hard spotlight above each table, make the felt tabletop the brightest part of the image, and add a little fog and low-saturation color grading. Show in-game screenshots from the seated player’s perspective, not editor screenshots.

这一轮将环境光降至接近黑色,在每张桌子上方悬挂投射阴影的聚光灯,并在房间内加入两盏舞台灯。雾效和低饱和度调色进一步强化氛围。每把左轮手枪下方都有一块带粉笔圆圈的发光毡垫,引导注意力聚焦桌面中央。

房间道具总计约 500,000 个三角形,并使用了许多投射阴影的灯光,场景负载相对较高。灯的渲染保真度设为 Performance。

复古 HUD

text
Here are three reference images. Rebuild the retro HUD to match their feel: torn-edge parchment panels on dark backplates, pixel buttons with bevels, outlines, and hard drop shadows, a small fixed palette, and the same pixel font throughout. Keep the center of the screen clear so I can see the table.
Studio 预览中的 Your Turn 大厅和复古 HUD。屏幕上的提示说明,进度仅在当前测试会话内保留。
Studio 预览中的 Your Turn 大厅和复古 HUD。屏幕上的提示说明,进度仅在当前测试会话内保留。

针对截图的反馈形成了五条 HUD 规则:

  • 全程使用一种字体。Press Start 2P 用在桌牌、所有界面元素,甚至大厅墙面的公告板上。
  • 给按钮添加纹理。纯色按钮的复古感不足,因此按钮、物品槽和桌牌使用了预先绘制斜面和阴影的小型像素图。
  • 保持文字易读。采用 1280×720 参考布局、20–25 像素字号,并随屏幕缩放。缩短标签,以适应字形较宽的字体。
  • 保持屏幕中央空旷。物品沿右边缘堆叠,庄家对话放在底部控制台,物品卡片放低。
  • 侧面板从顶部锚定。曾有一个版本采用居中锚定,导致面板在部分窗口尺寸下超出屏幕顶部。

HUD 纹理,包括九宫格缩放的羊皮纸面板、按钮、物品槽和标牌,均使用 Python 脚本绘制并作为图像上传。

第 8 步:测试、加入成长系统并保存

最后一轮加入了寻找对手、观看比赛和获取奖励的方式:同服务器匹配、观战视角、XP、任务、外观皮肤和大厅导航。

  • 匹配:同服务器队列和座位预留,只接受已入座玩家的操作,并设置频率限制,在断线或角色重置时清理状态。
  • 观战:仅展示公开比赛状态,不展示私密物品信息;入座玩家看不到观众聊天。
  • 成长:XP 和三个任务——完成五场对决、击败庄家,以及仅剩一盏灯时获胜。
  • 外观:四种通过 XP 解锁的左轮手枪涂装——Old Brass、Verdigris、Paper Ivory 和 Midnight Iron。
  • 评级:初始 PvP 评级为 1,000,设置从 Newcomer 到 Legend 的五个段位名称。
  • 大厅:包含 Find Opponent、Wardrobe、Progress、Watch Table、How to Play,以及 Settings / Friends 页面。

HUD 针对横屏手机进行了适配:将状态信息移到角落、采用紧凑的边缘面板,并隐藏空物品槽。Studio 预览仅保留当前测试会话的进度;持久化存档和手机性能仍需检查。

text
Prepare for private testing. Add same-server matchmaking, spectating that never displays private information, XP, a few quests, revolver cosmetics, and a PvP rating. Add lobby pages for these features, plus rules and settings. Write a repeatable test suite for match rules, items, and privacy rules. Adapt the HUD for landscape phones. Then save the place, keep it private, and record what was verified and what could not yet be verified.

案例实机画面:大厅、与 AI 庄家的对决、物品使用和游戏界面。

从设计文档到可玩的 Roblox 游戏

一小时的对话产出了设计文档、连通的工具链、规则完整且具备 AI 对手的对决、布置并打光的房间、符合选定风格的 HUD,以及可玩的 Roblox 游戏。创作者主要把时间花在决策上:选择视觉方向、打磨玩法,以及否定不合适的想法。

Roblox 内置的 MCP 服务器让 Gemini 4 Carbon 可以构建、试玩并截图,在运行中的游戏内检查改动。Tripo 通过已连接的资产工作流提供了十个道具和十一个图标,结合面数限制和统一风格描述,无需手动建模。

Tripo Studio

把教程里的方法,变成你的作品

打开 Tripo Studio,亲手尝试本篇教程中的创作流程。

这篇教程对你有帮助吗?

帮助我们持续改进内容。