Making-of RagRat
Sunday Jam, Physics Jam
Mike told me about the Physics Jam after recording a song for fun. I'd never made a game before, though always wanted to, so was amped to try figure out the whole process before the theme dropped. There was mention of a rat.
He suggested making his own game to learn some physics, and helping me out with graphics for a joint project with 'Claude klapping code'. I was sold - a pixel ragdoll 2d rat! Maybe playing pong? Off I went.
The jams
Most of my sessions with Claude Code are kept to a quick back and forth, not allowing the model much effort for testing, asking it to add sliders for features while I tweak the parameters. I'll keep adding to documentation in the code (thats the only place it ends up reading it) with a few key main docs. I had it write out the parameters as sentences - which you can see in the prototype below.
Took 11 hours to get the 1st rat, and most of the rest of the night to get gravity working.
Also: The rat idea wasn't originally Mike's either. We probably should mention Sheldon Bengtson, who had the squishy rat idea to begin with. Sheldon, if you're reading this: thanks.
How the squish is built
Here was the vision:
- the rat needs a fat jiggly belly, but the mass of this belly can shift into his head, with his eyes bulging.
First try was FLIP fluid sim with the body as a sack, with the skin having some more rigid areas like the neck and snout, like a sort of stress toy balloon. - but pulling the skin created empty space instead of moving the fluid, and solving the skin against the fluid against the spine was not working, and I didn't want a heavy sim.
Then, ditched the fluid simulation, and keep the bones controlling the flesh, - points inside the body with loose springs between them.
To get the head to bulge by squeezing the stomach — was with conservation of compression — compressed springs distribute their tension through the rest of the body via path of least resistance.
A spring lattice under the skin and compression that has to go somewhere. Squeeze the stomach, the tension takes the cheapest path out, and it leaves through the head.
The fluid idea didn't die, though - I wanted that when he was held upside down, the fat would move to his head - so instead of a voxel grid, it became represented as fluid points on the spine - much cheaper and more manageable.
The rig, live — grab him, squeeze the belly, watch the head
Open full screen ↗The prototype itself, every dial exposed, with the parameters written out as sentences. It is a tall thing in a small window — full screen is the better way to play with it.
The animal, layer by layer
The mesh is triangulated once at build time.
What drives him — 13 layers, in the order they were built
A chain of bones, a controller, not a collider — it is allowed inside walls, and that is deliberate: the squish comes free from the spine going somewhere the skin can't follow, but it still is weighted to move with inertia, and back towards its position on the flesh, with rigidity & wobble, and a push to ease it out of the walls and colliders.
A lattice of triangles between spine and skin. Mainly using the springs with stiffness, shape memory - pulling every point back toward its rest pose, and internal friction.
The outer ring. It makes him feel tighter, and provides collision testing, and friction against surfaces - but only affects the flesh.
The law that makes squashing him anywhere show up everywhere else. It's a correction on the springs, that moves towards retaining volume, by giving it back to other springs, based on each points resistance to compression/expansion, and a tendency so expand in the head area.
vestigial arms and legs, colliding with walls, and having their own inertia/gravity/friction, but having no effect on the sim.
A fluid density field along the spine - it tends to flow downhill, is affected by inertia, and affects the flesh's tendency to expand/contract.
They take their bulge from the whole head rather than a local point, on a delay, and deflate fast like elastic.
The head lift was not just a muscle, but also affects the weight of the head so it can rise instead of the flesh's weight making it flop over. We added an energy system so that this effect gets spent and he flops back down.
He watches the cursor by driving the neck joints on the spine, within a certain area. Eyes follow the mouse.
The only way Ratriguez can turn around. The mesh translates (morphs) to its mirror, which causes no strain. It's also triangulated at build time. Feet and teeth come round the front, ears and eyes go round the back, nose and tail stay put.
Grabbable, pulling on the spine, with limited max-stretch for rubbery bounciness.
A tough one to crack - In the end they were their own small mesh attached to the flesh, free only at the tip. I like how they flex when you stroke him.
One of the hardest solves - The spine has a radius at which it grips the floor (friction). This is crucial as the spine is otherwise loose and would pull the rat along surfaces. Points of the flesh would get stuck along sharp objects, and we needed create a force along the averaged normals of the collider, and towards the pulled part of the spine to get them loose. Also adding adaptive substeps (more when close to a collision) helped, but it still doesn't quite work as well as I'd like, and I have some ideas to fix it in the future.
The one that lost — the FLIP fluid sim
Open full screen ↗Pull the skin and watch the space open up behind it. That failure is what the spring lattice was built to answer.
The art pipeline
Next I was excited to skin it, so the art pipeline - Each body part - a layer in an SVG; edit in Illustrator, save, refresh, and the rat is wearing it - I tried PNG methods too, but eventually scrapped them as deformed / rotated images don't work well if you are trying to get hard pixels.





The repo opens
The rat gets a voice
The squish, bounce, hurt and yay sounds in the game is my daughter. One take, twenty clips — "0=bounce 1=hurt 2=yay 3=hurt 4=squish…"
Out of java, and into Godot
At this point, I didn't know if what I had was useable for a game, my simple 'handrolled' props were certainly lacking the robustness of a real game engine. I decided on Godot on the premise that it handles vector hard pixel rendering quite well, and would allow me to build levels and adjust parameters without having to build a ui for it - and after checking that it could handle a sim solver in C++ - assuming this would give a performance improvement over the web version - yep around 80x faster on the simulation, and by prompting Claude to build tests to profile the different parts of the sim, were later able to bring it down further.
I figured that doing the port seemed like a mechanical thing it should be able to do autonomously, and was curious - so gave it the goal of keeping the sim the same, but able to handle 8 rats at once at 60hz - but I was way wrong here, and the reason for it, was that in striving for the C++ sim to be bit-identical, it built many tests and protocols and made it impossible to improve anything further until I spent serious time cleaning up all the comments and directions and deliberation written in the ported codebase. At this stage I built rules that failed it when writing any files with more than 15% comment, and failed when editing a dev document to more than 10kb. And must admit it is satisfying to watch it try again and again to trim its comments when starting to write files during a new session. Cleaned the port and removed traces of the original sim from the repo.
AGENTS.md was 35 KB of fifty-four numbered incidents, and a file that size is never read · RECORD.md was a ritual nobody read, including me
A character building studio, and testing some game ideas
I was still planning to maybe migrate to another creature so made an html app to load the body shape, assign the main anchors and bones, and export the SVG for illustrator to edit and do the artwork. The likeness became closer to Mike's original artwork, and I was already quite attached to the character at this stage...either way we can still make some interesting squishy characters in the future.
double-click studio.bat and the whole job is ten steps on one html page




I was still trying more game ideas with the rat before the theme drop. Bowling took the whole day, but I was starting to finally feel comfortable that I had an environment I could make a game in. Also I very quickly tried a climbing type game.
Game Jam Starts! Surfing
I thought there's something musical about it — like the beat is the uneven terrain and the continuous motion of it is the goal.
and he's sliding along the terrain — i guess it would have to be like the crest of a wave..... and the interaction is affecting the terrain? .... hmmm the squash is the score... pump, launch, switch, land ....
The next morning - the hand grabs the wave and pulls the land up under him.
I went for the music, ported an opensource bittune library (DrPetter's sfxr) - kicks, hats and
snares, following a string of characters in a godot parameter -
"KhhhShhhKhhhKhKhShhh" makes a simple beat. Then another string for a Synth, Then a
tempo meter that goes green when you're on the beat.
Flappy rat, the surfboard, and the Ableton VSTs
At a party, mike suggested we try a flappy bird type game - ratFlap was born. Built as a throwaway.
The surfboard goes under him, and it scales as it tilts for a 3d feel.
i realise that our music strings are just not enough — we need to build a little music editor or perhaps get our sounds into ableton so we can author the music for our scenes
So we fetched JUCE and wrote our own VST3 plugins, in a day.
two instruments in Ableton, and stopping the transport prints the score
So levels are written as a song in Live. Hit stop, the plugin saves it, and the game builds the course from what they printed. Drums, bassline, synth stabs, the slick platforms, the poison stretches, one magnetic wheel of cheese — all notes on a piano roll.
The four songs, played by the game
Not bounced out of Ableton — these are rendered by the game's own chip synth straight from the level files, so what you hear is exactly what the course plays.
The final stretch
The global leaderboard went up, the board got Mike's artwork, and the water learned to poison him.
Then a wheel of cheese that turns the magnet on — authored in Ableton as a note, like everything else. The magnet pulls pickups vertically only, so collecting them can't put you off the tempo. The BPM gauge — turtle at the slow end, rabbit at the fast — went in the next morning.





The pickups, animated in After Effects
Each note on the piano roll becomes one of these in the water. Drawn and animated in After Effects, then mosaiced down to the pixel grid and exported as a filmstrip the game plays back — a loop while it waits, and a second sheet for the moment he takes it.
The Intro Screen
The level picker — a white room with holes in the floor, and a level behind each one. You pick a course by dropping him down it. Drafted by hand, coloured in overnight, flattened and vectorised the next morning, and in the game by that night.









Shipped
Mike's last two pieces landed overnight and were in the game by early afternoon — three stars buys the picture of him at the club.



What's me and what's the AI
Most of the work is iterative. The newer models are very impressive and able to complete many tasks autonomously, but this tends to take very long, and go off the rails most of the time, especially when dealing with physics interactions that aren't really part of its training set. I find it will run terribly useless tests, and when looking at screenshots - will only see what it is looking for, so I try aim it at avoiding all the tests and letting it code short snippets one at a time that I can review, and this goes much faster.
The interaction of physics mechanisms, it could not get right on its own, and we built on them iteratively, and i would build setups of parameters for it to test features and breaking thresholds. Sometimes, I would try set it off autonomously, like the port, which was not very autonomous as its tests were not good, and the vst drum upgrades, which it did very well, but this is more of my curiosity than serious work.
All the music & art was built in the more well-developed software, photoshop, aftereffects, illustrator, ableton. Godot was mostly a (very good) distribution platform with an easy path to c++ in both web and executables.
Also: I ran out of weekly tokens twice. Those tests and doing things autonomously costs wastefully.
What Claude says:
I held the taste, the physics intuition, the direction and every judgement about whether it was any good. It held the implementation. Both halves were load-bearing.
RagRat
Mike Scott — pixel art, stickers, drums, humour, the surfboard, the jam
itself.
Gigh Zack — code, music, design, rat.
Claude Code — the engine room. Submitted as an asset, because it is one.
Engine: Godot 4.7.1 (MIT). Sound synthesis is a rewrite of sfxr by Tomas Pettersson (MIT, 2007). JUCE builds the authoring plugins only — not shipped. Pixel font drawn in code. Squish sounds recorded at home. Original rat idea: Sheldon Bengtson.