使用 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,親手嘗試本篇教程中的創作流程。

這篇教學對你有幫助嗎?

協助我們持續改善內容。