Author |
Topic: Artificial Life (Read 1349 times) |
|
David Williams
Developer
member is offline

meh

Gender: 
Posts: 452
|
 |
Artificial Life
« Thread started on: Mar 28th, 2010, 12:32am » |
|
This is going to be of limited interest.
I've had a go at simulating artificial, asexually-reproducing lifeforms (artificial bugs).
These bugs exist in a world where only other bugs and food (leaves) exist.
The bugs are not aware of each other's existence, and nor do they interact (boring !), however they can "see" leaves that are not too far away. If a bug "sees" a leaf then it will head towards it, and if it's able to grab it before another bug does, it changes direction and carries on looking for more leaves. It must eat a sufficient number of leaves in order to be able to reproduce (asexually).
When a bug multiplies, it passes its 'genes' on to its offspring, but each gene suffers a tiny - often insignificant - mutation that may prove either advantageous or disadvantageous for the offspring.
Newly produced bugs may be able to see a little bit further than their parent, so may have a better chance of finding food. Or it may not be able to see as far as its parent which may prove disastrous. It will move slightly faster or slower than its parent, and will consume energy slightly faster or slower than its parent.
Rarely, and this may take dozens of generations for it to happen, a major mutation in one of the genes will occur which either proves advantageous or otherwise. The mutation may, for example, allow the bug to travel significantly faster than its parent, and so its progeny may eventually totally out-compete all the other bugs. Or the mutation may prove disastrous and the bug may not get the chance to multiply even once.
The simulation begins with just one bug. It can "see" up to a distance of precisely 4.0 units, and moves with a velocity of precisely 2.0 units. It begins with 7.0 energy units, and needs 15.0 energy units to multiply. It's metabolism is 100% (so it gets 100% of the fixed energy available from a leaf). It receives 0.5 energy units for each leaf that it eats. Each time the bug is 'updated' (i.e. moves), it loses 0.001 energy units. The bug dies if its energy falls to 0. The bug has a lifespan of 10.0 units, and loses 0.001 "life units" per update. It will eventually die no matter how much energy it has amassed. When a bug multiplies, it's energy is slashed by two-thirds.
When a major mutation occurs (these are rare), the mutant mugs are assigned a different colour and usually a different shape. There's nothing significant about the shape, and all bugs should be considered dimensionless. A high pitched sound is emitted when one of these major mutations takes place. When a bug multiplies, there's currently a 1 in 125 chance of a major mutation in one its offspring's genes.
While the simulation is running, press the 'S' key to change the number of frames to skip (otherwise you'll wait until eternity for a few dozen generations to pass). The program begins with zero frames skipped so that you can see how the bugs behave. It may takes a few minutes before you witness the first initial bug multiply (assuming it gets the chance to).
After a little while, skip 50 frames and watch the behaviour, and then skip 1000 or 10000 or whatever you want all the way up to a million.
Each bug is displayed with a number indicating its generation.
Every so often the bugs will experience a famine, and only the hardiest bugs may survive (if any at all).
Similarly, every so often the bugs will experience a time of plenty, and the population will rise rapidly.
You can't currently select a bug to examine its genes, but I may offer that functionality in a subsequent version of the program. After several hundred generations, a bug randomly 'plucked' from the population should, I would've thought (although I haven't yet tested it), easily out-compete the offspring of Bug Zero (the one simulation begins with), and will probably wipe-out Bug Zero's progeny.
http://www.bb4w-games.com/temp/artificialbugs.zip
Reminder: Press 'S' during the simulation to change the number of frames to skip.
Regards,
David.
|
|
|
|
David Marples
Guest
|
 |
Re: Artificial Life
« Reply #1 on: Mar 29th, 2010, 09:12am » |
|
Limited in number of people perhaps, although it might make a good screensaver!
Thanks, David, that is very interesting. I have played with things of that kind before, and will again. Could we know the "genetics" in a bit more detail?
The brief summary you provided suggest that bugs will evolve to be faster, with better vision, etc, which is pretty intuitive. Would it be more interesting if there was a balance between, and/or a cost of, such improvements? For example, if faster movement cost more energy, or if you could have a constant total number of "skills points", so an increase in speed trades off against poorer vision?
Looking further ahead, you could create localised environments (but with access between them), for example by putting some incomplete walls in. Localised famines might lead to particular specialised forms in one area, which might then be able to "invade" a nearby area if that underwent a famine, for example.
D
|
|
Logged
|
|
|
|
David Williams
Developer
member is offline

meh

Gender: 
Posts: 452
|
 |
Re: Artificial Life
« Reply #2 on: Mar 30th, 2010, 02:48am » |
|
on Mar 29th, 2010, 09:12am, Guest-David Marples wrote:Could we know the "genetics" in a bit more detail? |
|
I've been a little bit cheeky in referring to "genes" as they are really just parameters! For example, each bug has a "velocity gene" (which sounds bizarre, admittedly), which for Bug Zero, the magnitude of the velocity is set to 2.0 (random direction). Then its 'child' inherits:
childBug.vel = parentBug.vel + FNrndsgn * 0.002 * RND(1)
where FNrndsgn (random sign) returns either -1 or +1.
on Mar 29th, 2010, 09:12am, Guest-David Marples wrote:The brief summary you provided suggest that bugs will evolve to be faster, with better vision, etc, which is pretty intuitive. |
|
Yes, in the recent (and better) version of the program, you can 'pluck' one of the "highly evolved" bugs (usually a mutant) and throw it into a population of early generation bugs and watch its progeny decimate that population within a few generations! (Because, obviously, they can see futher and/or move faster).
on Mar 29th, 2010, 09:12am, Guest-David Marples wrote:Would it be more interesting if there was a balance between, and/or a cost of, such improvements? For example, if faster movement cost more energy, or if you could have a constant total number of "skills points", so an increase in speed trades off against poorer vision? |
|
I think it would be interesting to find out. As things currently stand, faster movement doesn't require more energy (although I guess it should, really).
on Mar 29th, 2010, 09:12am, Guest-David Marples wrote:Looking further ahead, you could create localised environments (but with access between them), for example by putting some incomplete walls in. Localised famines might lead to particular specialised forms in one area, which might then be able to "invade" a nearby area if that underwent a famine, for example. |
|
The possibilities really are endless.
And perhaps have them menaced by a few bug-eating predators.
I'm beginning to toy with the idea of having 3D creatures inhabiting a slowly evolving/changing 3D environment (subject to the occasional 'natural' catastrophe - tsunami, cometary impact, volcano, disease, etc.). But maybe that's a little bit too ambitious for me. 
It's vital that such a simulation runs super-fast, because I for one wouldn't be willing to wait weeks for a few generations to pass.
Thanks for your feedback, David.
I'll upload an improved (and much faster) version soon.
Regards,
David.
|
|
|
|
JonR
New Member
member is offline


Posts: 24
|
 |
Re: Artificial Life
« Reply #4 on: Jun 6th, 2010, 2:48pm » |
|
Have you read Artificial Life by Steven Levy a fascinating and informative look at the field of artificial life?
This looks like an interesting project but the download link you provided no longer works. Where is this available from now?
Jon
|
« Last Edit: Jun 6th, 2010, 2:49pm by JonR » |
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Artificial Life
« Reply #5 on: Jun 6th, 2010, 3:40pm » |
|
on Jun 6th, 2010, 2:48pm, JonR wrote:This looks like an interesting project but the download link you provided no longer works. |
|
The whole of www.bb4w-games.com seems to be offline at the moment; I can't even get a DNS resolution of the name.
I know David had a problem once before with the site disappearing, and for a while there was some concern about the hosting company (Powersoft Hosting). As a backup he registered www.bb4wgames.com (no hyphen) as well; that's still up but appears to be redirected to the dead URL!
According to this, Powersoft Hosting have been offline since sometime in May:
http://www.webhostingstuff.com/uptime/PowersoftHosting.html
I do hope this gets fixed soon. BB4W-games contains (or contained) the most amazing collection of programs and I often refer people to it for examples of just what can be achieved.
Richard.
|
|
Logged
|
|
|
|
David Williams
Developer
member is offline

meh

Gender: 
Posts: 452
|
 |
Re: Artificial Life
« Reply #6 on: Jun 11th, 2010, 12:08am » |
|
on Jun 6th, 2010, 2:48pm, JonR wrote:
No, I'm afraid I haven't.
I don't remember even reading a Wikipedia article on the subject!
on Jun 6th, 2010, 2:48pm, JonR wrote:This looks like an interesting project but the download link you provided no longer works. Where is this available from now? |
|
http://www.bezu.co.uk/filesdump/temp/progs/artificialbugs.zip
Unfortunately, what with the excessively simple behaviour of the bugs, the small gene set, and the overall non-tweakability of the program, the experience this simulation offers is rather akin to watching paint dry.
David Marples produced a simulation (which I don't think he's publicly released) which simulates more complex behaviour (giving his artificial creatures a better food-finding strategy).
I was planning to embark on something much more ambitious (although possibly not feasible): giving the lifeforms more complex gene sets and complex behaviours; sexual reproduction, simulation of stereoscopic vision, olfaction and hearing, slowly evolving 3D environments (with the occasional random catastrophe/natural disaster), enclosures, predators, cannibalism, etc. Then, I seem to have lost interest! Probably because I knew that implementing such a computationally-intensive project would involve either writing a lot of assembly language, or having to learn C.
Regards, David.
|
|
Logged
|
|
|
|
David Williams
Developer
member is offline

meh

Gender: 
Posts: 452
|
 |
Re: Artificial Life
« Reply #7 on: Jun 11th, 2010, 12:25am » |
|
on Jun 6th, 2010, 3:40pm, Richard Russell wrote:The whole of www.bb4w-games.com seems to be offline at the moment; I can't even get a DNS resolution of the name. |
|
The 'new-look' website is currently under construction:
http://www.bb4wgames.com
I hope to include most games that have been created with BB4W, including such gems as Citaquexyle and Quirk (but only after receiving the express permission of the authors, of course!).
Regards,
David.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Artificial Life
« Reply #8 on: Jun 11th, 2010, 08:28am » |
|
on Jun 11th, 2010, 12:25am, David Williams wrote: I've updated the link on the BB4W site and its mirrors, e.g.:
http://www.bb4w.com/links.html
Quote:Then, I seem to have lost interest! Probably because I knew that implementing such a computationally-intensive project would involve either writing a lot of assembly language, or having to learn C. |
|
If you really want to go out on a limb you could code parts of it in Forth using FORTHLIB! Or maybe OWL Basic will actually work, in which case you could eventually use compiled BBC BASIC!
Richard.
|
|
Logged
|
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: Artificial Life
« Reply #9 on: Jun 11th, 2010, 09:08am » |
|
Greetings all,
It's not a secret - I have posted a copy as DDRM bugs_framed in the temp folder of the yahoo site, if you are interested, but it is still at a fairly early stage. I too have had little chance to play with it recently - too much marking!
As David says, I have given a slightly more complex gene set to control movement: bugs can have different speeds when just searching and when "homing", and can do a little dance in one area and then set off for distant lands if they don't find food locally.
I am more interested in the evolutionary trade-offs between speed and special senses and energy requirements, so my bugs have to "pay" energetically for a longer visual range and faster movement.
They can also adapt in terms of how much energy they need to accumulate before they divide, and how much they pass to their offspring. Thus they can either adapt to produce lots of small offspring, which will die if they don't find food soon, or produce few, more robust offspring. Changing conditions may alter what is the best compromise!
My objectives are more modest than David's, and perhaps more achievable in BB4W! My next steps will be to try to implement different regions with limited connectivity (so there can be local famines and extinctions, and different evolutionary driving forces in different regions, and to have different food pools, with the option to specialise in one food source or (less efficiently) to be a generalist. I would also like to introduce a carnivore population, but my past attempts at this kind of thing suggest this is very difficult to keep balanced - so the regions need to come first!
Best wishes,
D
|
|
Logged
|
|
|
|
|