Skip to main content

We're evolving our tin-can robot into a humanoid, one gene at a time

Twenty generations of artificial selection, starting from the one character that worked.

Updated 4 min readMarkdown
We're evolving our tin-can robot into a humanoid, one gene at a time

So far, Materia has exactly one character that feels right: the bobbin, a little tin-can machine with one goggle eye, stub arms and a leather strap that swings behind its head. It's modelled in three.js code, then baked into a sprite sheet with our own line art.

We also need humanoids. We tried the obvious routes: image-to-3D rigs from Tripo, VRoid avatars, VRChat models. They rendered fine, but none of them felt like they belonged next to the bobbin. They were high-resolution characters squeezed down into our style.

So we're going the other way. Instead of shrinking a human down, we start from the bobbin and grow it up toward a human, a gene or two at a time. We call the result a Materoid.

The line of descent, from the bobbin (0) to generation 20

The genome

The bobbin's model code now reads its proportions from a genome of ten sizes: barrel height and girth, head size, neck, legs, arms, shoulder width, one goggle or two, antenna length and foot size. Every gene starts where the bobbin is. With the defaults, the model rebuilds the bobbin exactly, so its sprite sheets bake byte for byte the same as before.

Breeding

Each generation has twelve children. A child takes one parent, or a cross of two picked parents, and nudges one or two genes by a small step. Every child is baked into a quarter-view still in about a second. A page lines them all up at the same scale and on the same ground line, and we click the ones that go on. Nothing is scored automatically: the only fitness function is someone looking at the screen and saying "that one".

New bones

Making things longer only goes so far. A longer leg is still one strut. The interesting part is when a new bone appears.

Alongside the sizes there are organs: knees, elbows, a waist and hands. An organ appears by duplicating a segment. A leg's single strut splits into a thigh and a shin with a knee between them. This is the same trick evolution uses with body segments. The new joint is born straight, so the child looks just like its parent and the lineage doesn't jump. After that, its sizes drift like any other gene.

We can't hand-animate joints that might show up in any generation, so each kind of joint moves by a simple rule:

  • Knee: the leg reaches for wherever the gait puts the foot, so the knee bends on its own as the foot lifts.
  • Elbow: the forearm bends a little behind the arm's swing.
  • Waist: the chest twists against the stride, over a pelvis that stays put.

Knees showed up in generation 6, hands in 7, elbows in 8. After that, the waist split the barrel into a ribcage and a pelvis.

The bobbin, the first knees, generation 12 and generation 20, walking

Eight directions

Heroes in Materia face eight directions, not the four diagonals our monsters use, so the bake now renders all eight rows. The current Materoid walks in every one of them at 12 fps, with the same ink and shading as the bobbin.

Generation 20 walking in eight directions

What's next

It still reads as a bobbin on stilts, and we're happy with that for now. We're deliberately going slowly: small steps, a few picks per generation, and the eyes and waist are settled. Next we want the torso to stop being two cans. It should become one organic, parametric shape, closer to a peanut than a barrel, that can pinch at the waist and swell at the chest as it evolves.

No comments yet. Be the first to comment.