FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Topics & Contributions
   Simulation, Artificial Life
(Moderator: REAS)
   my current a-life project...
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: my current a-life project...  (Read 4366 times)
mflux

fluxhavoc WWW
my current a-life project...
« on: Mar 3rd, 2005, 10:49am »

Hey guys. I just wanted to show you the current state of my a-life project. I'd love to get some feedback. I've only got about 2 weeks left to work on it.. and I really really need to hurry my butt up o__o...
 
I'm doing this with Casey being my advisor. He's been plentiful help, especially with kicking my ass about being on schedule.
 
Anyways, he suggested that I go and do some reading before I got started. I picked up the John Holland book to his recommendation (Emergence: From Chaos to Order). I also picked up a few others "Evolutionary Wars: A Three Billion Year Arms Race", and Complexity by Mitchell Waldrop.
 
The project is detailed here, but the page is very outdated:
 
http://users.design.ucla.edu/~mflux/posted/199/
 
The gist of it... I'm trying to make Karl Sim's Evolving Virtual Creatures at a cellular level, with influences from Soda (soda race, soda play, etc).
 
Here are some current sketches that I've been working on...
 
This is my spring engine. It's using a Euler integration method and blows up after the springs get too dense. If I had more time I would actually try and implement Runge-Kutta as suggested by v3ga and Quasimondo and others... The math is simply beyond me though.
 
http://users.design.ucla.edu/~mflux/p5/springbody/applet/
 
 
This is my genome data-structrure. For morphology it only contains information about which angle to divid a cell (in relation to the embryo and subsequent cells) as well as how many times to replicate itself with its children.
 
http://users.design.ucla.edu/~mflux/p5/genomechart/applet/
 
 
 
Here is my spring engine married with the genome data-structure, plus a parser to construct the phenome. Interesting forms arrive from relatively simple instructions. Reptitions occur on a micro level but don't occur on a macro level. Yet...
 
http://users.design.ucla.edu/~mflux/p5/phenome/applet/
 
Note that these creature morphologies are automatically mirrored. I'm taking a few shortcuts here... (although this could be disabled with one press of a button).
 
 
 
 
Moving on... I'm building a model of a neural network. Here are some demonstrations, based directly off of John Holland's description of a neural net that has XOR capabilities:
 
http://users.design.ucla.edu/~mflux/p5/xornetwork/applet/
 
and also the capability to record "indefinite memory":
 
http://users.design.ucla.edu/~mflux/p5/indefinitememory/applet/
 
 
 
The plan is to have each cell act as a neuron, but each cell is only connected to cells with a physical connection to it (springs).  
 
The next step is to make my genome data include instructions on how to build a neural network as well. I still need to figure out how, so if anyone has any ideas I'm all ears.
 
At the same time I need to build a prototype for a muscle-type spring, so that certain neurons can activate them and cause contraction. Meanwhile, a prototype for sensor-type neurons need to be written (collision and sight, which is not too different really).
 
After that, I need to write an output for the data of the genome (a string, a text file, a jpeg, whatever).
 
After that, I'm going to integrate the neural network's data structure into the morphology and cross my fingers.
 
Finally, I'm ready to get what I want: evolving virtual creatures!  
 
My first and primary goal I'm shooting for is to evolve for creatures that have swift swimming speeds. The second is for creatures to have creatures that can change directions rapidly. Then hopefully combine the two...
 
 
Please provide insight if you can. I'm terribly overwhelmed by all of this... @_@
« Last Edit: Mar 3rd, 2005, 10:52am by mflux »  
Quasimondo

WWW Email
Re: my current a-life project...
« Reply #1 on: Mar 3rd, 2005, 2:29pm »

Impressing stuff - I'm looking forward to see how far you will be able to take this.
 
Do you know framsticks: http://www.frams.alife.pl ?
 

Mario Klingemann | Quasimondo | Incubator | côdeazur
Fish-face

308232952308232952thedemonsheep WWW Email
Re: my current a-life project...
« Reply #2 on: Mar 4th, 2005, 5:03pm »

Yeah, we've discussed framsticks and sodaplay, before. The morphology is very good, mflux - much better than the one I came up with.
I'd quite like to see it moving, too.
 
Are you planning on taking the neural net any further? I had one in processing, but it refused to learn anything... The reward stimulus was probably buggered.
 

--

The C@ S@ on the M@
=Fish-Face=
~#Chris#~
mflux

fluxhavoc WWW
Re: my current a-life project...
« Reply #3 on: Mar 5th, 2005, 2:14pm »

Hi guys~~
Thanks for your feedback.
Yes I checked out framsticks. I'm aware that I'm doing many of the same things they are (except a more primitive genetic code structure and... missing one dimension). I don't think I'm as ambitious as that though, my approach is more visual than what framsticks is trying to do. In the end, I think I just want something that looks and feels cool  
 
I'm just jealous at some of you guys and the people working on framsticks as well as Soda for their math. I'm regretting not having taken any math past trignometry. :| It's the reason I'm slow to pick up a lot of core conceps because the people who have been doing this stuff are computer scientists and mathemticians. I'm just a guy who likes to animate...
 
Anyways, here's an update!
 
http://users.design.ucla.edu/~mflux/p5/creature/applet/
 
I've coded the neural net directly into the creature morphology. Now every cell acts like a neuron cell, except that only about 50% of the cells are capable of sending output signals.
 
I'm not so sure this is such a great idea. I think my implementation is greatly flawed. I was excepting MANY signal loops due to the haphazard way the morphology was made, but instead I spent about an hour generating random creatures to see which one would make a signal loop. None showed up...
 
 
I think the problem is my implementation. Right now, the cells have NO idea which cell they're going to be connected to before it's built. All my construction algorithm does is take the distance between any given cell. If the cell is within a certain distance (20 right now I believe), hook them up with a spring at the distance they're at.
 
Thus lies the problem. The neuron connections are directly dependent on which springs the cell is hooked up to. I'm forced to cause the neuron cell to simply connect to convert ALL springs (connected to others) into neuron connections as well.
 
This lack of control worries me. I'm thinking something crucial like a neural net should not be left up to the physical spring parser to determine.
 
I'm curious whether XOR networks and loops are just EXTREMELY rare phenomenon, or my implementation is borked somewhere. I think the latter is more likely.
 
Any ideas..?
 
Thanks!
 
Fish-face

308232952308232952thedemonsheep WWW Email
Re: my current a-life project...
« Reply #4 on: Mar 5th, 2005, 7:28pm »

I'm not exactly sure what you're trying to do with the neural net? Is it for learning or moving? And also, I'm not sure what you mean by loops, or even whether they're desirable or not!
 

--

The C@ S@ on the M@
=Fish-Face=
~#Chris#~
mflux

fluxhavoc WWW
Re: my current a-life project...
« Reply #5 on: Mar 5th, 2005, 11:51pm »

Hi Fish-face~~
 
Here is an example of a neural network loop:
 
http://users.design.ucla.edu/~mflux/p5/indefinitememory/applet/
 
As John Holland describes it, it causes indefinite memory. The network has "seen" a signal, and retains this information for the future. This signal can also be "cleared from memory" by being hit by another signal from the input at exactly the right time (modulo two).
 
 
I'm not using neural networks here so much for learning, as I am for the creature's nervous system. My goal is for signals to transfer from an input sensor of the creature to propogate, hitting the correct set of muscles. The efficiency at which this occurs is evolved, eventaully.
 
I'll add in adaptive weights and hebb's rule to the neural network so that it can actually "learn". For now, it is a simple system in which I hope to allow for an effective nervous system.
 
Is that a bit clearer?
 
*edit*
 
Ironed out all the bugs and now it works like it should. Check it out!
 
http://users.design.ucla.edu/~mflux/p5/creature/applet/
 
Now looping is possible. Sometimes the whole creature will go into an "elipeptic seizure" if all cells are constantly firing signals. This effect is both orderly and chaotic, something that evolution will hopefully optimize later.
« Last Edit: Mar 6th, 2005, 3:25am by mflux »  
mflux

fluxhavoc WWW
Re: my current a-life project...
« Reply #6 on: Mar 10th, 2005, 7:41am »

Here is an update.
 
http://users.design.ucla.edu/~mflux/p5/creaturepack/applet/
 
There's also another applet that actually does evolving creatures, however it's not smoothed out yet.
 
This applet above shows the nervous system, the spring engine, and muscles working in unison to create moving creatures.  
 
Each muscle cell will contract with other muscle cells when hit by a signal from an incoming neuron. There are also sensor cells that ray-trace to a light source (far in the distance north of the creature). Press "c" to create new creatures. Press "n" to mutate the genome of the current creature and see the changes.
 
Let me know what you think!  
 
My next step is ironing out all my bugs and building a robust competition environment for effective swimmers to emerge. The first test will be for creatures that can swim really fast, the second test is for creatures that can change their directions and retain maximal speeds.
 
note: press "h" to disable the UI for better framerates.
« Last Edit: Mar 10th, 2005, 7:43am by mflux »  
Fish-face

308232952308232952thedemonsheep WWW Email
Re: my current a-life project...
« Reply #7 on: Mar 10th, 2005, 5:48pm »

Wow, nice! The best creature I got (through 'c') was able to get a 0.07px consistent speed, and looked good too.
 
I shall play around with the mutating stuff as well, perhaps have a peek at the code; I think that may be beyond me, however.
 
Overall, fantastic job! I'd be very interested to know exactly how you generate the phenome.
 

--

The C@ S@ on the M@
=Fish-Face=
~#Chris#~
rgovostes

rgovostes
Re: my current a-life project...
« Reply #8 on: Mar 11th, 2005, 3:07am »

This is pretty amazing...
 
I've got one right now which reminds me very much of a slug - it's moving about 2 px/frame, with two little protrusions from its "head" and contracts itself to move like an inch-worm.
 
It'd be cool if you could get some representation of your creature that you could enter again to restore one that you had before.
 
mflux

fluxhavoc WWW
Re: my current a-life project...
« Reply #9 on: Mar 11th, 2005, 10:39am »

Thanks guys!
 
Here's an update:
http://users.design.ucla.edu/~mflux/p5/evolveswimming2/applet/
 
I've changed and added a few things based on Casey's comments. The grid is now a series of points instead. I've added an indicator to where the lightsource is. You can also see the lightsource itself if the creature is smart/strong enough to approach it.
 
I've made creatures bigger in size so everything is now much more visible. I've added a longer refractory period for neurons so creatures don't always end up in epileptic siezures. I've also given neurons a new property: whether or not it's a one-way connection or two-way connection.
 
Finally, the genes now also define the distance the child cell will be created.
 
 
 
 
Right now I'm storing the creatures as a series of numbers (basic information you see from the genome UI up top). They're going to be stored in a txt table and given fitness values.
 
I'm not sure how I could make this online and interactive so you can save load creatures with processing. If anyone has any php<->p5 skills or have any ideas how I might approach that I would gladly lend an ear.
 
The current step I'm doing is cleaning up the code, visuals, ironing out a TON of kinks (result of writing code too quickly) and general debugging.
 
The next step is making an evolution lab, where you can tinker with options and generate thousands of creatures at a time so that effective swimmers will emerge. You can then store these creatures and later load them up to compete with other breeds as well to get more and more sophisticated designs.
 
At least that's the goal...
 
 
 
Let's see... the fastest creature I've evolved using a crude evolution scheme was 5.2px/frm. The standards are constantly changing though, so comparisons don't really mean anything. I'm still tinkering with muscle strengths, neuron firing rates, sensor sensitivity, springs, friction.... literally everything.
 
 
To answer your question fish-face, the phenome is generated off of the genome. The embryo uses gene number 1, then produces a child cell at a certain angle (and now, a certain distance). It also can repeat itself, thus making multiples of itself plus its own children. The children cells also have child cells, so on and so forth, but never ending up in a looped sequence.
 
Once all the cells are in place, a routine checks the distances between all cells. If a cell is within a certain distance from another cell, they will be attached by a spring.
 
Finally, the genome also dictates what cell type it is, plus other specifications.  
 
Green cells are sensor cells that detect light. The light is ray-traced to its source. If anything blocks its way, the sensor recieves no signal.
 
Blue cells are neuron cells. All cells are also nerve cells (can recieve signal) but only these neuron cells can output signals. They simulate a neuron with threshold, refractory period, as well as weights. When outside signals arrive, it will sum up the weights. If it is more or less than zero, and the accumulated signals have surpased its threshold, it will fire. If the weights total to zero (+1, then -1), the neuron will not fire.
 
Red cells are muscle cells. They take the spring and contract the length of it, pulling both itself and the cell connected to it. Muscle cells contract when it reiceves enough signals to fire itself. They too have a refractory period, and cannot contract after a certain time.
 
The goal is however, not to specify detailed information about a creature within the genotype. The biggest thing I want to emphasize is how morphology alone changes the effectiveness of creatures, as well as their animation.
 
Sorry for the long rant... lol. Hope that answers... @_@ this has been a long project.
 
Fish-face

308232952308232952thedemonsheep WWW Email
Re: my current a-life project...
« Reply #10 on: Mar 11th, 2005, 6:03pm »

No need for an apology, it's very interesting. (I, personally am fascinated by A-life and AI, as well as neurology)
One thing I noticed is that the movement is often chaotic, whereas in nature movement is usually coordinate, expressing some form of symetry. Even when the creature is mirrored, I end up with one side behaving quite different to the other... I can only conclude that there's a minor irregularity in the calculation code. I'm not sure whether, if that's the case, it's the kind of bug that's really fixable, so hey.
One thing I noticed is that in some instances there are cells not attached to any other part of the creature, in others there are no signal emitters. It'd be useful to cut down on the number of creatures that do nothing!
 

--

The C@ S@ on the M@
=Fish-Face=
~#Chris#~
gll

WWW Email
Re: my current a-life project...
« Reply #11 on: Mar 13th, 2005, 1:45am »

Wow! A lot of work. Fascinating!
It looks 3d, Is it three dimensional?
 
It will be nice with many creatures at the same time. I'm just thinking about the Justin Bakse & Eric Williams CoreWar's like project "LifeVsLife". It would be nice to have online interaction with other users best a-pet, reproduce them, mutate them. Maybe not a battle, but some kind of collaborative goal.  
 
For PHP or .TXT, what's the datastructure of each creature? It could be similar to LifeVsLife for PHP.
« Last Edit: Mar 15th, 2005, 10:35pm by gll »  

guillaume LaBelle
rgovostes

rgovostes
Re: my current a-life project...
« Reply #12 on: Mar 21st, 2005, 5:05am »

Four, oh four.
 
Looks like your user directory is missing (eep)!
 
(Edit: Order has been restored. Nothing to see here, move along...)
« Last Edit: Mar 22nd, 2005, 1:05am by rgovostes »  
rgovostes

rgovostes
Re: my current a-life project...
« Reply #13 on: Mar 22nd, 2005, 1:08am »

The latest version looks like it evolves many creatures and display them, and "picks" the best, it seems. Runs awkwardly, pausing occasionally... What direction is this going in? Just a brute-force method of finding the best organism?
 
gll

WWW Email
Re: my current a-life project...
« Reply #14 on: Mar 22nd, 2005, 3:59pm »

I've found this for PHP and P5:
http://processing.org/discourse/yabb/board_Integrate_action_dis_play_num_1106908696.html
 

guillaume LaBelle
Pages: 1 

« Previous topic | Next topic »