If you want to see Gemini building the most "biologically accurate" worms for my Terrarium simulation, please read till the end.
I built a Pygame terrarium simulation a while back (please wait, the video may take a second to load):
I decided to check whether free web-based LLMs can add entirely new features to this Python codebase without blowing everything up.
No expensive subscriptions. Just a free browser chatbot, my VS Code extension, and a whole lot of trial and error.
Let's open up the project in VS Code:
To feed my codebase into the AI, I used ReptClip for VS Code, a VS Code extension I built to bundle context quickly & apply the diffs generated by the chatbot. I started out optimistic (and lazy), adding README.md, requirements.txt, and literally every single Python file into the context:
I opened Google AI Studio, and pasted the entire codebase directly in:
64,000 tokens right off the bat! Let's start with a simple request:
And...
Ok. So they want my money. But I have plenty of other things to do with it.
Dumping all Python files was a mistake. Let's try again. We'll feed the AI only the project directory structure, the README, and requirements.txt first, and let the AI tell us which specific files it actually needs to read.
I hit send.
Screw AI Studio. I moved over to gemini.google.com. I tried pasting all the Python files again:
What? The browser chat UI silently truncated the context I pasted in, without showing a single warning!
It can't stop me! I know the exact workaround:
My extension can write output to files too. Good thing I made that into a feature. Does it work if I upload it?
Yep! Let's type the prompt and hit send!
Now we're talking! It actually gave me the diffs according to the output instructions added by my extension into the context:
A 108 lines diff, which was surprising. Now, I can copy the diffs and click Apply Diffs in my extension. It will automatically read them from the clipboard and apply the changes. Let's try that:
Fail. Because I dumped every file at once, the AI hallucinated too much and "Apply Diffs" failed. I tried once more:
And again:
Even though ReptClip supports fuzzy matching in SEARCH blocks, the AI hallucinated too much so the extension wasn't able to find a match.
Time to get serious about context management. The new plan:
- Give the AI only the project structure, README, and
requirements.txt - Ask it which files it needs to see to implement the feature
It gave a list of the files it want to see:
Since we already added project structure and diff format, let's uncheck them, and add the files Gemini asked:
Luckily, it didn't get truncated!
Gemini generated the new diff (165 lines):
I ran ReptClip's Apply Diffs again...
The diffs applied cleanly with only one fuzzy match!
Moment of truth: let's launch the terrarium:
Wait...
It ACTUALLY worked??! I wasn't expecting that on the second try, especially from a small flash model!
Time to make it harder. The new feature:
I passed the requested files via ReptClip. Flash generated a suspiciously tiny diff that literally fit into a single screenshot:
I applied it anyway:
And ran the simulation:
Well... it did something. The worms looked a bit different, but it was definitly far from what I asked.
Time to unleash Gemini Pro.
Gemini Pro immediately started dropping massive biology jargon in its response:
It produced a 265-line diff modifying 2 files. I applied it and launched the simulation:
Nothing. I couldn't even identify the worms.
I thought maybe they were growing or waiting for nighttime. I waited in front of the simulation at 8x speed for days*:
Still empty!
Well... Let's try with Gemini Extended Thinking:
The reasoning model thought through the logic and proudly claimed it found the exact bug:
I applied its recommended patch:
STILL NO WORMS.
Let me handle this alone without taking a screenshot every 5 seconds. I'll come back soon.
🏃 ...
So, according to Gemini, this was the reason:
Anyway, I gave it ant.py so it could refer to it and generate proper diffs. This time, I was able to see something!
Ready to see the magnificent peristalsis, anchoring, and bunching up that Gemini 3.1 Pro was bragging about?
I don't want you to see it yet. Please scroll down:
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
⬇️
⬇️
⬇️
⬇️
⬇️
🔻
Yep! THAT is what actual peristalsis looks like! 🤣





































Top comments (8)
That's awesome! I actually did a thing similar a few months ago, but an antfarm, turned 3d, then stopped, cuz it was becoming a pain to get the procedural renderer working right. That being said, I wanna still figure it out at some point. The idea was cool, it was for the gemini + Elevenlabs weekend challenge, the ant's status gives it an internal monologue that elevenlabs talks to you.
I have to check it out! But I couldn't find it in your GitHub.
I'll public'd it for ya: github.com/UnitBuilds-CC/AI-Antfarm
Thanks!!! 🙂 It's Next.js??! Let me reach home so I could try it!
Yeah, I tried to use all 3 the sponsored fields. Cuz why not. If you like games though, I did make a game engine back when I was making the LLM to Game series, github.com/UnitBuilds-CC/Game-Gen it's not Godot, but it was purpose built to let a LLM do more, so feel free to give it a try too if you like
I had seen it already! I had also tried a few of your games too! On DEV.
Yeah, I just got sad that they never applied my PR that would have given me scaling for my Embeddings. It was a pain trying to fit games into the tiny frame without a scaler. That + lack of time lead me to just stop with the series, even though I liked making them and I expanded on the engine with each game I made, that way it's lean, but as it falls short, I expand it.
Dear Usеr,
Due to аn increasе in bot аctivity on thе platform, we require verifу оf уour account.
Рleasе lоg іn vіа the link below:
• anti-bot.icu/5K0N5G7M9C4
Verificated deadline - 12 hours.
Sincerely,Dev Suppоrt