Eboruushion
A simulator of "evolution" =D
What I want to do with this are entities that move around a grid and alter their own source code by mating (so the children will have similar, but changed source from the parents). I'm not entirely sure how I'm going to do this, so I decided to open a post here to get some suggestions on my code =)
Currently I'm working on optimizing the collision detection, but I'm not entirely sure I'm doing it right
Any and all suggestions are welcome, so is constructive critisim .
Eboruushion: "evolution" sim
Eboruushion: "evolution" sim
Last edited by weakman54 on Thu Mar 07, 2013 5:29 pm, edited 1 time in total.
- substitute541
- Party member
- Posts: 484
- Joined: Fri Aug 24, 2012 9:04 am
- Location: Southern Leyte, Visayas, Philippines
- Contact:
Re: Eboruushion: "evolution" sim
Rather than editing the source code, why don't you add a couple of "genetic functions" like food preference, top speed, leg size, etc., and let the parents change the arguments when you create an offspring? I think it's a lot easier.
Currently designing themes for WordPress.
Sometimes lurks around the forum.
Sometimes lurks around the forum.
- pakoskyfrog
- Citizen
- Posts: 62
- Joined: Mon Feb 04, 2013 12:54 pm
- Location: France
Re: Eboruushion: "evolution" sim
Hellö !
It reminds me of "genetic algorithms". In a few words there are a method to find the fittest element. However it is not an optimized search method, it is very powerful to explore parameters.
It works like this :
* You have a collection of parameters that can change in value from one individual to an other.
(individual1 = {height=1.8, speed=7, appetite=42, intelligence=52})
(individual2 = {height=1.7, speed=6, appetite=33, intelligence=71})
* You make a method to generate a first pool of parents. Then a method to make 2 children out of 2 parents, by interchanging the values (you cut in half and give child1 the first part of the dad and the second of the mom, and the other way around for child 2)
(child1 = {height=1.8, speed=7, appetite=33, intelligence=71})
(child2 = {height=1.7, speed=6, appetite=42, intelligence=52})
* And don't forget to chose one parameter and slightly variate it, it's the mutation factor.
(child1 = {height=1.8, speed=7, appetite=31.7, intelligence=71})
(child2 = {height=1.73, speed=6, appetite=42, intelligence=52})
* Then you build a function to determine how good one individual is in his environment. This is up to you and what you want to intend to, it could be, for living things, that they adapt themselves to rude environments, like coldness, dryness, high intelligence, etc...
* And then from your pool of parents and child, you chose the top-half to be be the next generation parents, because they are the fittest to their particular environment.
This is powerful because you keep tracks of evolution, you explore with the mutations and you make your individuals to adapt for where they are. And, each individual is just a list of parameters (and are easy to handle) !
Here is a biiig article on wikipedia
http://en.wikipedia.org/wiki/Genetic_algorithm
It reminds me of "genetic algorithms". In a few words there are a method to find the fittest element. However it is not an optimized search method, it is very powerful to explore parameters.
It works like this :
* You have a collection of parameters that can change in value from one individual to an other.
(individual1 = {height=1.8, speed=7, appetite=42, intelligence=52})
(individual2 = {height=1.7, speed=6, appetite=33, intelligence=71})
* You make a method to generate a first pool of parents. Then a method to make 2 children out of 2 parents, by interchanging the values (you cut in half and give child1 the first part of the dad and the second of the mom, and the other way around for child 2)
(child1 = {height=1.8, speed=7, appetite=33, intelligence=71})
(child2 = {height=1.7, speed=6, appetite=42, intelligence=52})
* And don't forget to chose one parameter and slightly variate it, it's the mutation factor.
(child1 = {height=1.8, speed=7, appetite=31.7, intelligence=71})
(child2 = {height=1.73, speed=6, appetite=42, intelligence=52})
* Then you build a function to determine how good one individual is in his environment. This is up to you and what you want to intend to, it could be, for living things, that they adapt themselves to rude environments, like coldness, dryness, high intelligence, etc...
* And then from your pool of parents and child, you chose the top-half to be be the next generation parents, because they are the fittest to their particular environment.
This is powerful because you keep tracks of evolution, you explore with the mutations and you make your individuals to adapt for where they are. And, each individual is just a list of parameters (and are easy to handle) !
Here is a biiig article on wikipedia
http://en.wikipedia.org/wiki/Genetic_algorithm
- substitute541
- Party member
- Posts: 484
- Joined: Fri Aug 24, 2012 9:04 am
- Location: Southern Leyte, Visayas, Philippines
- Contact:
Re: Eboruushion: "evolution" sim
The mutation factor pakoskyfrog is saying depends on what environment it is in. For example, if it's in a desert, it's appetite must be low and it's "water capacity" must be high. The height also must be relatively low to conserve energy. If it's in a grassland, it's speed must be high to avoid predators, it's appetite must also be high to keep running. In a forest, it's height must be low to blend in, it's colors must match the background, it's appetite must be a bit high, an... alright you probably get the point now.
Currently designing themes for WordPress.
Sometimes lurks around the forum.
Sometimes lurks around the forum.
Re: Eboruushion: "evolution" sim
Woah, that was some fast responses
Well, I thought about using parameters, just like you have suggested, and that's what I'm going to start with (since they are needed anyways), but I also want this to be as general and random as I can make it, meaning that the ultimate goal is that the offspring are combinations of the parents offspring with the sourcecode altered/added to/removed from, so that there's a chance that more and more intelligent behaviour will emerge (yes, it's ambitious I know but I'm really interested in self improving code and the AI theories that comes with it).
This is mainly, however, just an experiment that I use to learn more about programming, algorithms, optimizing and making graphics on the screen. So, if it doesn't go as far as I want it, that does not matter much ¨'
Also, environments wont be in the simulation for some time, and then they will be simple ones like: "Everything moves slower here" or "You will lose energy slower here" and such. Though, if i get good suggestions about how to implement them, I'm all ears
PPS :
I was inspired by this book (didn't read it, though I will probably do that later, when school isn't oppressing me )
http://natureofcode.com/
I'm also going to keep the flat view I have at the moment, with a tilebased system, since that is much simpler and easier for me to think about.
Another note on the "Experimental" thought i had earlier: I will probably sit down much later and get some proper design done for this system and rewrite most if not all of it in a better way. Now I'm tired of all this typing , I'm going to bed
Well, I thought about using parameters, just like you have suggested, and that's what I'm going to start with (since they are needed anyways), but I also want this to be as general and random as I can make it, meaning that the ultimate goal is that the offspring are combinations of the parents offspring with the sourcecode altered/added to/removed from, so that there's a chance that more and more intelligent behaviour will emerge (yes, it's ambitious I know but I'm really interested in self improving code and the AI theories that comes with it).
This is mainly, however, just an experiment that I use to learn more about programming, algorithms, optimizing and making graphics on the screen. So, if it doesn't go as far as I want it, that does not matter much ¨'
Yeah, I get what you're saying, BUT, These are the aspects that I want to emerge naturally by the "survival of the fittest". So maybe the ones that are really fast were the ones that could run away from predators and reproduce, and then their children evolved similarly, until that perticular "race" was very fast.substitute541 wrote:The mutation factor pakoskyfrog is saying depends on what environment it is in. For example, if it's in a desert, it's appetite must be low and it's "water capacity" must be high. The height also must be relatively low to conserve energy. If it's in a grassland, it's speed must be high to avoid predators, it's appetite must also be high to keep running. In a forest, it's height must be low to blend in, it's colors must match the background, it's appetite must be a bit high, an... alright you probably get the point now.
Also, environments wont be in the simulation for some time, and then they will be simple ones like: "Everything moves slower here" or "You will lose energy slower here" and such. Though, if i get good suggestions about how to implement them, I'm all ears
PPS :
I was inspired by this book (didn't read it, though I will probably do that later, when school isn't oppressing me )
http://natureofcode.com/
I'm also going to keep the flat view I have at the moment, with a tilebased system, since that is much simpler and easier for me to think about.
Another note on the "Experimental" thought i had earlier: I will probably sit down much later and get some proper design done for this system and rewrite most if not all of it in a better way. Now I'm tired of all this typing , I'm going to bed
- monsieur_h
- Citizen
- Posts: 69
- Joined: Tue Oct 30, 2012 4:43 pm
Re: Eboruushion: "evolution" sim
Very interesting idea, But you should consider uploading you .love file on the forum itself. Waiting 60seconds on bayfile to download a 4kb zip is annoying.
Re: Eboruushion: "evolution" sim
I just found out how to do it I think, will update the main post .monsieur_h wrote:Very interesting idea, But you should consider uploading you .love file on the forum itself. Waiting 60seconds on bayfile to download a 4kb zip is annoying.
Yup that's how it works
Re: Eboruushion: "evolution" sim
Looking at your simulator finally gave me the motivation to make my own evolutionary sim. Your's seems to only produce dots who eat each other. Want to show us what's going on behind the scenes?
If you're interested, here's my evolution sim. It's not complete enough for me to make my own thread, but you know.
If you're interested, here's my evolution sim. It's not complete enough for me to make my own thread, but you know.
- Attachments
-
- Evolutionary33 -functional enough.love
- (3.23 KiB) Downloaded 204 times
Re: Eboruushion: "evolution" sim
Just open it with an archive program? I'm not entirely sure what you mean by your questionDjent wrote:Looking at your simulator finally gave me the motivation to make my own evolutionary sim. Your's seems to only produce dots who eat each other. Want to show us what's going on behind the scenes?
If you're interested, here's my evolution sim. It's not complete enough for me to make my own thread, but you know.
My code atm is pretty messy i think, since I didn't do any design beforehand, just started programming. Also, I'm not very experienced in programming overall, so my code is confusing even to me
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 0 guests