This story is part of a week-long series on reproduction, from prenatal testing to childfree Reddit.

Bacteria do it. Viruses do it. Worms, mammals, even bees do it. Every living thing on earth replicates, whether that be asexually (boring) or sexually (fun). Robots do not do it: The machines are steely and very uninterested in reproduction.

But perhaps they can learn. Scientists in a fascinating field known as evolutionary robotics are trying to get machines to adapt to the world, and eventually to reproduce on their own, just like biological organisms. As in, someday two robots that are particularly well-adapted to a certain environment could combine their genes (OK, code) to produce a 3D-printed baby robot combining the strengths of its two parents. If the approach works, it could lead to robots that design themselves, building beautifully adapted morphologies and behaviors that a human engineer could never dream up.

Weird Legs and Robot Babies

It sounds far-fetched and perhaps a bit alarming, but evolutionary roboticists are already churning out these fantastical designs. For instance, researchers in Australia last year evolved robot leg shapes by first randomly generating 20 shapes. In a simulation, they tested how well each would walk on various surfaces—that is, testing for “fitness,” in the survival-of-the-fittest sense. They then took the top performers and “mated” them to produce similar-looking legs, or children. The researchers did this over and over again, generation after generation, and wound up with legs that were marvelously adapted to walking on hard soil, on gravel, or in water. The designs are crazy—they look like tree-people doing Fortnite dances (good for hard soil) and misshapen elephant feet (good for water).

Matt Simon covers cannabis, robots, and climate science for WIRED.

Which is exactly the point. Traditionally, when engineers set out to design a robot, they tend to recycle ideas. Why do Mars rovers have six wheels? Because six-wheeled vehicles have worked well on Mars before. But perhaps designers are missing something. The beauty of evolution is that it stumbles upon bonkers ideas all the time. No one, for example, designed a fungus to invade ants’ bodies and mind-control them around the rain forest—that unusual strategy emerged thanks to generation upon generation of random mutations and natural selection.

As in nature, it’s mutations that will drive the evolution of robot species. The key is variation. When two organisms make a baby, their genes combine, but mutations also sneak in, which can lead to unique traits in the child, such as subtly different camouflage. That kind of mutation would thus make the offspring more or less adapted to a particular environment. If it’s an unfavorable mutation, the animal doesn’t reproduce as effectively (or at all), and those mutant genes don’t make it to the next generation.

Consider what computer scientist Gusz Eiben is doing at Vrije Universiteit Amsterdam. He takes two relatively simple robots made up of connected modules and mates them by combining their "genomes," which carry information about, say, coloration. He also adds noise to this marriage of data, which mimics a biological mutation by subtly changing the offspring so it isn’t just a pure blend of its parents. “One parent is fully green, and the other parent is fully blue,” Eiben says. “Then the child has some modules that are blue and some that are green, but the head is white. That’s not what we put in—it’s a mutation effect.”

And with this variation comes a new kind of creativity in robotic design. “It gives you a lot of diversity, and it gives you the power to explore areas of a design space that you wouldn't normally go into,” says research scientist David Howard, who developed the evolving leg system and recently published a framework for evolutionary robotics in Nature Machine Intelligence. “One of the things that makes natural evolution powerful is the idea that it can really specialize a creature to an environment.”