Skip to content

Build a game with AI

You can build a Rally game together with an AI app you already use, such as Claude, ChatGPT, Grok or Claude Code. You describe the game; the AI builds the world and writes the scripts in your game’s Studio draft while you watch; you play it, tell the AI what to change, and publish when you’re happy. This tutorial walks through that whole loop with a real example.

Your AI app connects to Rally’s MCP server and signs in as you. From then on, it can use Rally Studio’s tools on any game you own or collaborate on:

  • It works in your draft. Every change lands in the game’s Studio draft, the same one you edit. If you have the game open in Studio, you see each change the moment it’s made, labeled with the app’s name.
  • Everything is saved and reversible. Changes save automatically, and you can revert them from Studio’s Activity tab while you work.
  • Players see nothing until you publish. Publishing is a separate step, and when the AI asks to publish, you approve it in Studio.
  • Connect your AI app to Rally. Connect an AI app has the steps for Claude, ChatGPT, Grok, Claude Code, Codex, Cursor, VS Code and other apps; in Studio, Use my AI shows them too. Give it at least Read games and Edit games. If you want the AI to be able to ask to publish, it also needs Publish games.
  • Use a computer with a desktop browser, so you can keep Studio open while the AI works.

Ask your AI to start one:

Use the Rally tools to make me a new 3D game called "Lava Rise". Start it empty.

It creates the game with create_game and gives you its Studio link. A new game is private, and an empty one starts with a baseplate (in 2D, a strip of ground) and a spawn point to build on. The game is yours: you can rename it, share it or delete it like any game you made.

You can also create it yourself on Rally: open Games in the left rail, choose Create a game, give it a name and pick 3D or 2D (you can’t change that later). If you start from a template, its scripts open in Studio as compiled JavaScript, so ask the AI to rewrite them in TypeScript before it changes anything else.

Open the Studio link the AI gave you (or, on the game’s page, choose Open in Studio), and keep the tab open while you work with the AI. You’ll see its changes live, it can take screenshots of your viewport, and Studio is where you approve publishing.

In Studio, Use my AI in the toolbar gives you a first message to paste into your AI app that names this game and its id, so the AI starts in the right place.

A good first request says what the game is, how a round plays out, how players win or lose, what appears on screen and what should be saved. It also asks the AI to check its own work. Here’s an example you can adapt:

In my Rally game "Lava Rise", build a 3D survival game.
- Players start on a small island at the bottom of a tall tower of floating platforms.
- Each round, a huge sheet of lava rises from below for 60 seconds. Touching it kills you.
- Everyone still alive when the round ends gets a win. Show Wins in the player list
and save them, so players keep them between visits.
- Between rounds, the lava drops back down and there's a 10-second break.
- Show a round timer at the top of the screen.
Keep the rules on the server, put the tuning numbers in attributes so I can change
them in Studio, check that the scripts compile, and playtest with 2 bots before you
tell me it's done.

For a bigger game, ask for a plan first (“Before you build anything, tell me your plan: which objects and scripts you’ll create”). It’s easier to change a plan than a finished build.

As the AI works, Studio shows it in a few places:

  • In the toolbar, Studio says the app is working, for example Claude (via MCP) is editing, and the app appears next to the other people editing the game, with a robot icon instead of a picture.
  • In the Explorer and the viewport, the world fills in: the island, the platforms, the lava, and new scripts in ServerScriptService and StarterPlayerScripts.
  • In the Activity tab, in the same panel as Properties, every change gets an entry with the app’s name, such as Build objects: Workspace or Write script: ServerScriptService/Rounds.

Behind the scenes, an AI app typically reads Rally’s building guide with get_guide, finds your game with list_games, looks at what’s already there with get_game, reads Rally’s docs with search_docs, builds the world with create_objects, writes scripts with create_object and set_script, then runs check_scripts, playtest and screenshot. MCP tools describes every tool. If your app supports prompts, make-a-game starts it off this way for you.

If a change isn’t what you wanted, choose Revert next to it in the Activity tab. Ctrl+Z (Cmd+Z on a Mac) won’t help here: it only undoes your own edits.

The AI’s playtests catch script errors, but its test players are bots that wander around at random. Only you can tell whether the game is fun, so press Play (F5) in Studio and try it. To try it with more than one player, use Test on a real game server in the menu next to Play. See Testing.

Then report back with specifics. Some examples:

The third platform is too high to reach. Keep every jump under 6 studs up and
10 studs across.
When I pressed Play, the Output panel showed this error: <paste the error here>
Please fix it.
Take a screenshot and tell me whether the platforms make a path all the way to the top.

Screenshots show the world in your Studio viewport, from your current camera, but not the on-screen UI.

Ask for one change at a time, and test after each one:

Make the lava rise faster every round: 1 stud per second in round 1, then 0.25 more
each round.
Add a "Survivors: 3" counter under the timer that shows how many players are still alive.
Explain how the round script decides who gets a win, in a few sentences.

You can edit the game yourself at the same time: you’re both working on the same draft. If you change something the AI wrote, tell it, so it reads the new version before it edits that part again.

When you’re happy, ask the AI to publish:

I'm happy with it. Publish it, with a one-line summary of what changed.

Studio then shows a dialog saying that the app wants to publish Lava Rise, with the AI’s summary of the changes. You have five minutes to choose Approve and publish or Deny. Approving publishes the current draft as a new version, and the AI tells you its number.

Only a game’s owner can approve, and the owner needs the game open in Studio when the request arrives. If your connection doesn’t include Publish games, choose Publish in Studio yourself instead.

A new game is Private. To let others play, go to the game’s page, pick Unlisted or Public under Settings, and choose Save changes. See Publishing and versions.

An AI app connected to Rally can:

  • Create new games for you, empty or from a template.
  • Read everything in games you own or collaborate on: objects, properties, attributes and scripts.
  • Create, change, move, copy, group and delete objects, and write and edit scripts.
  • Compile your scripts and report errors the way publishing would.
  • Run a private test server for up to 30 seconds with up to 4 bots, and read the errors and logs.
  • Take a screenshot of the viewport in an open Studio tab.
  • Search Rally’s game API docs.
  • Ask to publish a game you own, if you gave it Publish games. You approve every publish in Studio.

It can’t:

  • Delete games, or change a game’s settings, such as its name, visibility or max players.
  • Publish without your approval, or publish a game you don’t own.
  • Play the game the way a person does. Its bots wander at random, so they find errors, not fun.
  • See your screen or your Output panel. It only sees its own playtests and screenshots of the viewport, which don’t include the on-screen UI.
  • Insert models from the Creator Store, or upload images, sounds or 3D models.
  • Manage collaborators, tokens or versions, or read your players’ saved data.

There are limits on how much it can do: 240 requests a minute, 20 new games an hour (counting the ones you create on Rally), 30 playtests an hour and 60 screenshots an hour, per account.

  • Name things. “The Lava part in Workspace” is clearer than “the red thing”, and asking for clear names makes later requests easier.
  • Give numbers. “Jumps of at most 6 studs up” beats “make it easier”.
  • Keep tuning in attributes. Ask the AI to read speeds, times and sizes from attributes, so you can tweak them in the Properties panel without touching code.
  • Keep rules on the server. Ask for game rules in Scripts and only display code in LocalScripts. Rally’s multiplayer model explains why.
  • Check the Activity tab. It lists what the AI changed, and it’s the fastest way to undo a change.
  • Roll back a bad publish. Every published version is kept: you can make an older one current again. See Publishing and versions.