It would be wanderful if you make a 3d version ov it
I made this list of ideas
I'm not sure if this has already been brought up but there is a simple hack that can get a creature to each 100% in every category easily. Simply create two creatures I just used 2 upside down V shapes and didn't connect them with bones but rather with muscles only. What this did was that the simulator after a few generations would simply lob half of it's body to some part of the screen. This got it to get 100% in running, 100% jumping, and 100% in climbing. (I didn't try obstacle jumping). I realize it's a simulator and not a game, but I'm not sure if you have intentions of trying to dissuade this method or not.
So, there's a couple concerns I have involving the evolution process, which might be significantly hindering creatures' ability to improve their fitness.
First, there doesn't seem to be any bias nodes in the neural network. Usually, one bias node is added to the input layer and to each hidden layer, and is simply set to always output 1. This is then multiplied by genetic coefficients (just like with any other node) to make nodes in the next layer have a constant offset; making certain nodes easier or harder to set very low or very high. It's a small, but extremely useful, addition to nearly any neural network. (I suspect this is the case because you list six inputs in the help screen: distance from ground, horizontal velocity, vertical velocity, rotational velocity, number of points touching ground, body rotation. Also, when looking at saved generations, it says there are six input layer nodes.)
Second, I'm concerned that the "sexual" (for lack of a better term) reproduction method is inefficient. You mention that new children are created by selecting two random parents (weighted by fitness), splitting their neural network data at a random location, and splicing opposite parents' pairs back together. This seems likely to sometimes kill off a highly-fit creature by breeding it with another creature whose strategy is completely incompatible, resulting in two children that both use two incomplete halves of two strategies that only work when whole.
I'd like an option to use an "asexual" method (again, for lack of a better term). It goes like this: You simulate a generation and give them fitness scores. Then you kill off half of them. The most fit creature is guaranteed to survive, and the least fit is guaranteed to die. All other creatures are then randomly selected for death, with the lower-fitness creatures getting higher chances of dying. The surviving creatures then generate two offspring each; both of them exact copies of the original, but one of them with a random amount of mutations. This method is guaranteed never to kill off the most fit creature unless another creature comes along that outperforms it. In otherwords, you never lose progress; every generation is at least as good as the one before it.
You can enable the "Keep best creatures" option already, which guarantees to carry the best two creatures to the next generation without any change to their genes whatsoever (no recombination or mutation). You might still see slight fitness drops and variations though, as explained here: http://keiwando.com/evolution/faq/fitness-drop/
Would be nice to be able to select multiple pieces together and move them as a unit. Perhaps a rectangular drag-to-select type arrangement, such that assembled "parts" could be moved around in relation to other parts. Moving things around one joint at a time is pretty tedious and at certain levels of complexity it can be almost impossible to move something you've already made.
An 'undo' button that reverses the last change would be a big help as well. I've completely ruined a creature by deleting the wrong bundle of bones & muscle.
Hello! Just got my copy, and I've actually been doing some coding with neural networks of my own.
I noticed that there are only 6 inputs for a creature. Seems like this would ultimately limit what a creature could ever "learn" resulting in (theoretically) a lot of "stalls" (ie, creature moves until it gets to a certain position, then simply can't any more).
What are the odds that we could have a mode where each "joint" is in fact an input, or even a series of inputs (ie: the joint's current Y position, and orientation, for example.) Also, the "state" of each muscle could be an additional input.
This would allow for VERY intelligent and complex actions to be learned over time. For instance, creatures may even be able to learn how to stand back up once they fall down.
If people are concerned about the additional overhead of the math, it could be a toggleable series of options, maybe?
Love the tool!
Oh, and another nice feature would be the ability to "hide" or "dim" bones/joints/muscles. So when editing a complex creature, we can click on "onion skin" or something, and then click those things we want to make less visible, and they'd be dimmed out. While dimmed, they wouldn't be collidable (ie: you wouldn't be able to attach muscles to them). For more complex creatures, this could be super helpful!
A big thing for me would be a mute button. The music is very nice, but to mute it, I have to mute all things chrome/chromium. That said, this is exactly the thing I have been hoping to see for a long time. I really hope you expand on this idea even further. I really enjoy it a lot. I'd also love to see generations displayed in parallel in tiled windows, so I could watch a lot of them at the same without them being overlayed on top of each other. But the priority for me would be an option to disable audio. I suspect this will see a lot of run time!
I think a good idea would be to add tabs, as in be able to create and evolve multiple creatures at a time, because some creatures slowly evolve and then you could work on another one. I do realise that this might make it really laggy if you have lots running at the same time but i think it is worth it if you just use batches and dont do to many at a time :)
Thanks, it would be really great if you could add this
Is there a log output file, cause if not i would like to know why my significantly powerful pc was completely frozen when I got home from a 9 hour shift. Not only that but it was only on stage 302. Given the time frame it was supposed to be on stage 2163. I'd like to know the method of movement that gave my computer a brain aneurysm. So if there is a output file can you point me in a direction if not then it wouldn't be a bad idea to have one.
the best creature in the current gen can be on the screen next to the best creature in the last gen. You should also make it so you can control how the simulation determines the best creatures each gen in the settings. Example: u could put fitness proportional so the best creature is determined by its fitness & other options.
Some simple requests:
1. Timer. It makes it more fun to watch, almost like a race. In the last few seconds, the current generation might do better!
2. Current Fittest Highlight. Highlight the creature in the current generation that is currently the fittest (e.g. furthest along track). This makes it more fun and clearer to compare the current generation with the previous best, again a bit like a race.
3. Continue Simulation. Once we click "Back" the only way to get back into the simulation and carry on where you left off is to load it. Can we not please just click Evolve again, if the creature has not been changed?
4. Improvement Indicator. Clearly notify us if a newly evolved creature has outdone the existing best, and if so by how much, e.g. 1% improvement in fitness.
More complex requests:
5. Simulation Speed Dial. Please let us turn up the speed of simulation so we can quickly discover if creatures are evolving in the right direction, or need to be fundamentally changed.
6. Custom Optimisation Goals. Let us control/add the parameters to create new challenges. I would love to combine switches for: Maximise/Minimise Horizontal/Vertical Distance; Keep Selected Joint Above/Below/Front/Back.
7. Manual Centre of Gravity. Let us manually position this point (i.e. the point where the flag marker is placed) by selecting a number of joints (the marker is placed at the mean position of selected joints). This means e.g. I can force the marker to be between my creature's two feet (if I want it to walk) and it won't always think it's being fitter by finishing its attempt with falling forward.
Much more complex requests:
8. Give Creatures Hints. Let us pause the simulation and select a muscle, causing it to toggle its contract/expand state. This change would be backpropagated to create a manual mutation ("the hand of god"!) and is like the player saying "try this" rather than waiting and hoping for a random mutution to cause it. This instantly creates a new generation with a new offspring containing the manual mutation.
9. Hardware Utilisation. When I dial up the parameters the simulation slows down a lot. I'm running a Core i9 9900K at 4.7GHz on 8 cores, with an RTX graphics card. While the simulation slows down, I can see that Evolution is not using more than 20-30% of my CPU/GPU. Can you make more use of multiple threads, and the tensor cores in RTX cards which are designed for ML?
Thanks -- what a fantastic game.
I would really like if the brain could recognize if his shape is a circle that can roll. The current brain seems to keep wanting a "UP" and "DOWN" part of the body, and tries to "keep its balance", compared to a round shape that have to think relative to its position inside a rotation to keep rotating/accelerating.
Maybe adding some clickable option to enable it if it's the case.
An option to set a part of your body to deduce fitness if it touches the ground during the simulation. Really wanted to experiment with bipeds where the legs are actually in line with each other but the AI seems to find it more efficient to just fall forward far before it ever gets a chance to actually learn how to balance.
I have no idea whether you're still working on this or not, but I'll add this anyway. I'm not exactly sure how complicated this would be to do, considering I don't know how to code games and it could require revamping to code as a whole or something... but is there anyway to run the game with more cores than it's already running on? Because the game extremely laggy but it's only using 20% of my cpu and I want to run some large simulations!
Seeing what appears to be an evolution inefficiency when reviewing best creatures of generations, especially for climbing when all creatures are at 0% fitness (initialization) and when all creatures are at 100% fitness (yet with more untapped potential in the body that creatures which do tap into it seem to go unrewarded for tapping into it), I'd like to suggest an alternative fitness measurement to address this; ((self)-(worst))/((best)-(worst))=x% [within generation].
That is, for either climbing or running; the creature within the generation that moves the most to the right (or falls the least to the left) will always be marked as 100%, and the creature that moves the least to the right (or falls the most to the left) will always be marked as 0%. For creatures between, their fitness is the % of the best that they reach after subtracting the worst from both itself and the best; so if the best climber falls -2m to the left and the worst climber falls -8m to the left, a creature that gets -5m will have a fitness of ((-5)-(-8))/((-2)-(-8))=3/6=1/2=50%. The best gets ((-2)-(-8))/((-2)-(-8))=100%, while the worst gets ((-8)-(-8))/((-2)-(-8))=0%; thus mechanically serving as the clamps for their generation.
I believe this would help optimize evolution efficiency most notably in climbing initiation, where with the current method if all creatures get 0% it doesn't (seem to, as far as I can tell,) matter if one fell -5m left and another fell -15m left. Having fitness effectively 'unclamped' while being mechanically bound between 0 and 1 by the nature of the formula itself anyway, I believe would also incentivize constant improvement at the task; currently, if fitness does reach 100% at any task then no further improvement seems to be expressly selected even if the body still has more potential that several creatures go effectively unrewarded for tapping into.
As many already have asked for, a "head."
Evolution tends to favor those that don't die, but in the simulator there is no death or risk, causing many "species" to move using methods that should kill any.
This could also give the obstacle jump a boost in evolution, forcing creatures to learn to jump earlier/faster.
Hi Keiwan, just getting back into the game after a little break. It would be nice to see the current speed of the creature being viewed. I have a creature that starts slow and then goes really fast, so I would like to know the max speed that the creature reaches. In fact, maybe there could be a max speed achieved and current speed added into the game? Thanks
Another suggestion:
When stopping a simulation at the nth generation, it would be cool to be able to move some joints while keeping the neurones weights and so resume the simulation from this nth generation. In other words, neurones weights are erased in case joints, bones or muscles are deleted or added, but not in case of just moving the joints around.
I would like to grow my creature using different "learning rates", and by that I mean mutation rate. For that it would be very useful to have a dashboard, similar to tensorflow dashboard. I'm sure you know exactly what I'm referring to.
Keeping track of the settings and fitness would be very helpful in growing a successful creature.
Support for adaptive learning rate mutation rate based on the fitness would be too much to ask, but would be amazing.
Thank you!
Great "game" !
Some features that would interest me :
- non mobile joints (to make fixed angles with bones)
- to be able to edit (add or delete or move joints, bones, or muscles) after several steps (generations). This could be useful to first learn "basic" behavior (like walking) to a quite simple but secured pile of bones, joints and muscles (secured in the sense they cannot fall easily), and then remove or add components so they are more efficient.
- to record data in a csv file, data like the best scores over time, or all scores over time ...
- and would it be possible to have a look to the configuration of the "neural net" of best creatures (as a list of parameters for example)
Simple dark mode that just toggles a final `1-x` line in an existing shader for minimal impact.
Network input for if any joint within a group is touching the ground, rather than simply how many are. I imagine it's useful to know which foot is touching the ground rather than only how many are. For backwards compatibility all unspecified joints are in the same group.
Activation functions for the networks. I tried to find if there's already some form of nonlinearity in the network but I can't parse Unity code and didn't see any in the brain code. Simple choices include ReLU for just clamping the minimum value to zero; Leaky ReLU which is just ReLU but lerp the original value in a little; Sine; GeLU as approximated with `0.5 * x * (1 + tanh(sqrt(2 / pi) * (x + 0.044715 * x^3)))` which allows for some negative values but fades to zero as it becomes more negative. The final outputs shouldn't have these on them.
Biases to go along with weights in the network s. Simple values to add to the output of each fully connected layer (before activation function if added).
There are more complicated things that might be interesting, like gated units where the output of one layer is put through an activation function and then multiplied with the output of another layer in order to block off an output in certain situations, but at a certain point a line has to be drawn for simplicity.
This "game" is awesome, Two requests here please:
01- the possibility to use multiples cpu and cpu threads.
When simulation in BATCHES is active you can run more simulations BATCHES per cpu core or using cpu mult threads to improve speed of simulation. my cpu has 16 threads and the current version is using only one.
the next one I don't know if is possible:
02- global online simulation, maybe this one is a little to much and it needs be a paid service
we can use a online server or another way to allow multiples computers or cell phones to improve and simulate the same creature, for example, I create a monster, upload this monster online or active a button "global online simulation" and any one can make a online simulation and continue the same evolution, not start another simulation but improve the same creature and the best fitness version will be selected, imagine 10000 simulations at once running in the world, could be a very nice addition, very complex I know...
BYE I love this "game"!!!
Surely duplicates, but I'll list just in case anything's not covered:
Really, the first two would be enough to make a huge improvement, I think.
It's of course unofficial, but upon seeing this; I went ahead and just made one: https://discord.gg/zG4zXCmFa9
I don't know if you are still performing updates or if you will see this, but one idea I have would be to be able to change the neural network of an evolution.
With this, it would be possible to teach the basics of body movement with a simple neural structure and further on leaving the neural network more complex and taking advantage of the previous knowledge used
When performing an evolution with many entities, the time per generation is wrong because of the slowdown due to the amount of entities. And to solve this problem it is necessary to optimize or separate the tasks to be carried out, which can be done with the cpu cores. Instead of a single core having to perform the calculations for 100 entities, let the task be divided equally among the other available cores. My computer contains 14 cores, each core could be performing the calculations of approximately 7 entities instead of 100. When performing the evolution with the quoted amount, the game only uses:
CPU - 10%-15% -- 65% available
GPU - 4%-8% -- 86% available
MEM - 2%-3% -- 93% available
it is visible when you have around 100 entities and quote 5 seconds per generation, which in the end takes 12 seconds to switch to the next generation.
I would recommend relying on the computer's internal time for the time to work properly.
if (startTime - currentTime >= GenerationTime) nextGeneration()