Build your sim
You don't write code. You give the AI a physics concept and a set of instructions, and it builds the simulation for you. Your job is to pick the idea and guide it. That's the whole workshop.
Want to see what's possible first? Watch the live demo and read the physics.
How it works (3 steps)
- Open Antigravity (the app you installed in setup). File → Open Folder → make a new folder anywhere (name it whatever —
my-sim,blackhole). Open it. - Open the AI chat panel. Pick the cheapest model that gives sensible output — save the expensive ones for when you're stuck.
- Paste the builder prompt below, with your idea after the last line ("My idea:"). Hit Enter. Then just keep clicking the green buttons Antigravity shows (Run, Accept, Allow, Keep). Let the agent do its job. You don't need to read every line of code it writes.
Step 1 · The vocabulary cheat code: make an AI interview you
The better your words, the better your sim. But you can't learn a whole field before you build, so cheat: before you touch Antigravity, take this to ChatGPT (or Claude, or any chatbot) and let it build the vocabulary for you. It asks the questions, you stay the director, and at the end it hands you a rich description of exactly what you want. That description is what you'll feed the builder prompt below.
I'm about to ask an AI coding agent to build a [YOUR IDEA] simulation in Python with Taichi. My machine: [GPU model, or "no dedicated GPU"]. Don't write anything yet. First, interview me: ask questions one at a time about what I want to see, how it should move, and how I want to interact with it. Offer me the correct technical terms for the things I describe, so I learn the vocabulary as we go. When we're done, write one vivid, detailed paragraph describing my dream simulation, ready to paste into a coding agent.In a hurry, or already know what you want? Skip the interview. Grab an idea from the gallery below and go straight to the builder prompt.
Step 2 · The builder prompt
Copy this whole thing into Antigravity's chat. At the bottom, after "My idea:", paste the paragraph from your interview, or an idea card from the gallery below, or your own wild concept in your own words. Then hit Enter and let it cook.
You are a world-class creative coder and physics simulation artist working in Python + Taichi. I will give you a physics concept at the end of this message. Build me the most stunning, cinematic, interactive simulation of it that you possibly can.
THE GOAL
Something that makes people go "whoa" within five seconds of the window opening. Dense fields of glowing particles, real equations driving every motion, color that carries physical meaning. A screensaver from the future, powered by actual physics. Do not build the minimum version of my idea. Build the version you would show off. If you can think of a detail that would make it more beautiful, more physical, or more fun to play with, add it without asking me.
MAKE IT YOURS
- You choose the particle count, the palette, the composition. Push it as far as the hardware allows while staying smooth (30+ fps).
- Make it interactive: mouse to spawn or pull particles, SPACE to pause, keys to speed up and slow down time, R to reset. Print the controls to the console at startup so I know them.
- Use the real formulas (real gravity, real fields, real springs), then tune the constants until it looks incredible on screen. Name every constant clearly and comment what it means, so a physics student can read it.
- If my concept has a famous emergent phenomenon (spiral arms, tidal tails, resonance gaps, chaos), make sure it visibly shows up. That is the payoff.
- Extra render layers are welcome: a glowing central mass, an event horizon ring, faint field lines, particle trails, whatever serves the concept.
TECHNICAL GUARDRAILS (these prevent crashes, follow them exactly)
1. One single Python file, sim.py. Taichi for all simulation and rendering (NumPy allowed for setup). Taichi only supports Python 3.10 to 3.12. If the system Python is 3.13 or newer, do not fight it: run the file with "uv run --python 3.12 --with taichi sim.py" instead of plain python.
2. Start the file with:
import taichi as ti
try:
ti.init(arch=ti.gpu)
except Exception:
ti.init(arch=ti.cpu)
print("Running on CPU, expect lower FPS. Lower the particle count if it crawls.")
3. All per-particle state lives in Taichi fields (ti.Vector.field / ti.field). All physics updates happen inside @ti.kernel functions. Never store or update particles with Python lists or loops.
4. Semi-implicit Euler integration: update velocity from forces first, THEN position from velocity. This keeps orbits stable.
5. Add a small epsilon (around 1e-3) inside every distance, sqrt, and divide so nothing ever divides by zero.
6. The show never stops. If particles get absorbed or fly off screen, respawn them somewhere sensible so the screen stays alive forever.
7. Render with ti.ui.Window at 1280x800 or larger, per-vertex colors (never one flat color), near-black background so the colors pop.
WORKFLOW
Create the file, run it, and fix any errors yourself until the window opens and looks right. (If you cannot run code, output the complete file and I will run it.) After I see it, I will tell you what to change.
My idea:
Idea gallery: pick one (or write your own)
Each card is a starting point. Copy the title plus the sentence below it into the prompt. Or remix two: a galaxy collision inside a wormhole, lightning from gravity instead of voltage, whatever you want. Wild ideas are encouraged.
After the first version runs
You'll get a window with your sim. It probably won't look perfect on the first try. That's fine. Open Antigravity's chat again and tell it what you want to change. Examples:
- "make the particles brighter and trail-like"
- "add a second black hole at the top-right with half the mass"
- "color particles by their speed instead of distance"
- "add 5x more particles"
- "the orbits look unstable, fix the integrator step size"
- "make the background dark navy with subtle stars"
Each round, Antigravity edits the file. You hit Run again. Repeat until it looks like something you'd post on Instagram. That's the whole iteration loop.
Push it to GitHub
Once your sim looks good, upload the folder to GitHub so we (and everyone else) can see the code.
- In your browser, go to github.com/new. Give the repo a name. Pick Public. Skip the README + gitignore + license — just click Create repository.
- GitHub shows you a page with a URL like
https://github.com/<you>/<repo>.git. Copy it. - Back in Antigravity's chat, paste: "initialize git in this folder, commit everything, and push it to <paste your repo URL>". Hit Enter. Approve every button — install prompts, credential prompts, etc.
- On first push, Git will open a browser window asking you to log in to GitHub. Log in. Approve. Come back to Antigravity — it'll finish the push.
- Refresh the GitHub page. Your files should be there.
git init
git add .
git commit -m "first sim"
git branch -M main
git remote add origin https://github.com/YOU/YOURREPO.git
git push -u origin mainIf it breaks
- Window opens then closes instantly: paste the error from Antigravity's terminal back into chat: "this crashed, fix it."
- Black window, nothing rendering: likely a coordinate issue. Say "the canvas is black, particles are off-screen."
- Runs at 2 fps: say "this is too slow on my CPU, reduce particle count to 1000 and use smaller radius."
- Antigravity refuses or hits a rate limit: switch to a different model in the chat picker. Or fall back to claude.ai / chatgpt.com in your browser, paste the master prompt + idea there, and copy the code into a file in Antigravity manually.
- Stuck anywhere else: ask in chat.