keiwando / evolution

A sandbox game/simulator that demonstrates machine learning with evolutionary algorithms.
https://keiwan.itch.io/evolution
372 stars 59 forks source link

Best creatures are not being kept. #18

Open FailSafeNow opened 1 year ago

FailSafeNow commented 1 year ago

As I understand it, the option to keep the best creatures is supposed to make sure the two creatures that make it the furthest in each run automatically go on to the next run. And unless I really misunderstand how the game works, that is not happening. I may have a run where a number of creatures make it past the 9 unit mark on the climbing course. So when I do the next run, I should see at least two creatures passing that mark. Instead, I often see none.

The system is supposed to keep the best creatures, and select the rest according to their proportional rank. Why isn't it doing that?

keiwando commented 1 year ago

Yes, the best two creatures are carried over to the next generation without any kinds of modifications when that setting is enabled. I have checked this multiple times in the past as well, so I'm pretty confident in saying that this is definitely happening.

Why they are then not always behaving exactly the same as before is tricky to say. My first guess would be to blame it on Unity's physics simulation not always being 100% deterministic, despite all of the steps I've taken to make it as deterministic as possible with the options that they provide. I could imagine especially the climbing course being a lot more sensitive to slight changes in behavior.

Do you happen to have a saved simulation file (.evol) with such a simulation where the best creatures of the previous generation don't always match their previous fitness score on the next run?