In brief: this is a 2d genetic algorithm / alife simulation that runs in a browser.
note: I have mostly tested it with Chrome and briefly with Firefox so there might be problems with other browsers although the code is plain javascript without anything too special.
The colored pixels/boxes are the "creatures" which are basically virtual CPUs that run code in a custom assembler-like programming language. I just did an improvement so now the code is a tree-like structure.
The code evolves with mutations, there are various different mutations that modify the structure.
The green dots are "food" that the creatures can and must eat to survive. The food is distributed in patterns that vary over time to make the landscape "interesting" and to facilitate improvement in the creatures.
Each food gives X amount of energy, when the energy runs out or the creature gets too old (currently at 2000 command executions) it dies.
Running in a browser opens a lot of possibilities - for example I'm planning to set up a server to connect the world on different computers. I think I'll set up a possibility to open portals between worlds or something similar - I don't have the details though in detail yet.
Instructions for the buttons:
Brush - this defines what mouse does. There are different modes
Inspect - shows the creature you click
Food - plots food
Create - creates new random creatures
Kill - kills creatures
Mutate - mutates creatures that brush touches
kill-and-create - first kills creatures under the brush, then generates random new creatures
Redraw every: After how many rounds is the screen redrawn. Faster redraw rate slows down the system. Good compromise is 100 but if you want to really see what's happening, you might want to use 5 or 10 rounds.
Now button redraws the screen immediately.
Mutation % - when the creature multiplies, at what % is the creature mutated
Mutation deletes command, creates command, switches command to new random command or mutates a parameter.
Food model selector:
Random areas - random areas that grow food at different intervals and formations.
Islands - 9 islands containing food spread across the screen. No food elsewhere
Full map - randomized fixed size areas of food.
Isolated grid - similar to islands, lots of non-connected boxes of food that grow on different rates.
Number after food model - how often is the food model changed. This randomizes food areas based on selected model.
Now button - randomizes the food areas when clicked
Buttons:
Pause - pauses the simulation
+ creates 100 creaturs
- kills approximately 10% of creatures in random
M mutates approximately 10% of creatures in random
Save - saves current world (locally to browser)
Load - loads the saved world (locally from browser)
Here is an example of a program from a live session:
I do have plans to publish the details of the (experimental) programming language and maybe let the users to create programs. I think that would be very interesting.
This is super interesting. Using a tiny programming language for the creature AI is a great idea. I've always wanted to make a simulation of ant-like creatures that take decisions using a simple signal->actions probability matrix that would evolve over time. This is even cooler. Is the code open source ?
Maybe find the most numerous program and display it on the side without the need to inspect it ? Also highlight it in the map view somehow ? I'm really curious of how you determine the color from a program, is it just a hash of its source ?
3 comments
[ 3.8 ms ] story [ 21.0 ms ] threadnote: I have mostly tested it with Chrome and briefly with Firefox so there might be problems with other browsers although the code is plain javascript without anything too special.
The colored pixels/boxes are the "creatures" which are basically virtual CPUs that run code in a custom assembler-like programming language. I just did an improvement so now the code is a tree-like structure.
The code evolves with mutations, there are various different mutations that modify the structure.
The green dots are "food" that the creatures can and must eat to survive. The food is distributed in patterns that vary over time to make the landscape "interesting" and to facilitate improvement in the creatures.
Each food gives X amount of energy, when the energy runs out or the creature gets too old (currently at 2000 command executions) it dies.
Running in a browser opens a lot of possibilities - for example I'm planning to set up a server to connect the world on different computers. I think I'll set up a possibility to open portals between worlds or something similar - I don't have the details though in detail yet.
Instructions for the buttons:
Here is an example of a program from a live session: I do have plans to publish the details of the (experimental) programming language and maybe let the users to create programs. I think that would be very interesting.