Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics


Create creatures and let them evolve to see how they master various tasks. · By Keiwan

Advice on longer-term bots?

A topic by drbretto created 37 days ago Views: 134 Replies: 5
Viewing posts 1 to 5
(1 edit)

I watched the same 3 blue 1 brown series mentioned in the FAQ last year and have been obsessed ever since. Love this app, so simple and perfect for experimentation. Thanks for putting it together!

Been playing around with this for a few days now. I want to build something that doesn't just hop in the right direction. I can let the thing run for days if I have to, I just want to see a really satisfying late-generation emergence. I understand there's going to be some limitations with this kind of a sim, but I'm willing to sacrifice a fair bit of processing time in the name of science! Lol

My goal is to make one design that accels at all 4 challenges without being a couple of sticks connected with one muscle. And I'd prefer it to have as little intentional form as possible. I've settled down on a design I called a daddy longlegs. A small square core with 4 squiggly legs. Total 12 muscles. It's just strong enough it can bounce around but floppy enough to catch the stairs after letting it fall to it's death a few hundred times. It's basically the spider with 4 legs that are basically 2-muscle springs. 

I'm having some success, enough that it seems promising, but after a while, I'm really not sure if it's getting better or not. So...

1) have you ever seen something appear *almost* dormant for a while and eventually had a breakthrough, or does that generally mean it's done learning?

2) let's say it's done learning, what factors can potentially get past that? Even if I don't mind letting it run overnight for a week. 

So far, I've:

Increased population size to 1000, batches of 25.

Set initial period to 2 seconds until most bots were jumping in the right direction, then increased by a couple of seconds, etc. 

I've kept the best bots most of the time, but when one bit ends up totally separate from the pack, I "prune" it.

I saw a ton of progress up to generation 50, but left it overnight and basically saw no progress at all. Re-did it without keeping the best not and it maybe looks like it's standing on its feet more consistently, it's not getting more than a couple of hops and nothing hops past the initial time period at all (ie, no sustained movement, just better initial conditions)

Is it possible it will actually walk at some point? Would increasing brain size help at all? Currently it's 43 nodes: 11/10/10/13.  

I'm not too too worried about overfitting a little bit because I want to put them all in one video so you can see it evolve differently in each situation. So if I just means 10 times more computational time but has a chance to eventually converge, I'm down for it. 

Or is it just not gonna happen?

Maybe a better question I should ask is whether or not it's capable of gaining balance. Does it know if it's rotated or anything like that?


As long as the mutation rate is greater than zero, there is always the possibility that a creatures manages to mutate its way out of a local maximum. I haven't seen that happen myself, but to be fair, the majority of my time on this project was spent implementing it and not experimenting with long-running simulations.

What I would recommend is to try to play around with different selection, recombination and mutation algorithms and to increase the mutation rate when the fitness starts to stagnate. The settings that lead to the most randomized simulation behaviour (which can be exactly what you need if you're stuck in a local maximum) are
uniform selection
uniform recombination and 
global mutation
with a  mutation rate of 100%.

As far as the network size is concerned, I have seen some very interesting results with networks about the size that you have chosen. Sometimes with even more intermediate nodes (but not with more layers). I haven't seen too many successful simulation results with very deep networks. You might get lucky and immediately start off with one that works really well, but it's a lot more unlikely than with smaller networks.

The network inputs include the average rotation of all bones which can give the creature some sense of rotation. Additionally, the creatures cast rays into the world in order to learn about the distance from their surroundings. Some of these rays have a fixed direction (e.g. up and forward) but one of them is controlled by a neural network output of the creature itself. It could therefore also use the information it gets from these rays in order to determine its current orientation in space.

(1 edit)

Thanks, great reply!

I will start playing with those options. I hadn't even changed those at all yet. Especially mutation rate, I wasn't exactly sure how that worked. I'll start with that one and start introducing the others over time. 

I've cut the legs down a little bit and strengthened the core, too.  Cut it down to 8 muscles. It's climbing the stairs right now. Exactly like I was hoping I did get it to go from consistently falling down the stairs to hanging on the edge. It looks like it *wants* to start hopping up. But it's been about 900 generations and I've only seen it jump a couple of times. 

It's going to make a really cool video watching it grow in all 4 simulations at once. 

(1 edit) (+1)

This was WAY harder than I thought. My own rules making it so much harder on myself than I needed to be. I never saw any late-game emergence. I've left it on overnight with different bots and different setups and basically been simulating one thing or another for about 2 weeks straight and I never saw any later-game emergence. Not saying it can't happen, but generally after thousands of generations, I've just gotten stuck in a rut. 

The good news is, I didn't have to run these very long. I was able to get a nice satisfying video in 120 generations, or about 22 minutes. Not long term, but solved most of my criteria!



That's awesome! Thanks for sharing the video!