Darwinbots Forum

General => Leagues => Bot Challenges => Topic started by: Moonfisher on November 09, 2008, 07:50:58 AM

Title: Evolved Neural Network
Post by: Moonfisher on November 09, 2008, 07:50:58 AM
Ok, so I was working on that Neural Net challenge a while ago, and experimented with building them in a redundant way that was more mutation friendly.
And guess what, it worked, pretty well even.
And was planning on expanding the code with a larger blank network, but had tech issues with integrating the mutated code in the other network.
And then I finaly managed to focus on that thesis. So never got much further with the evo sim at that point. I also played around with other mutations settups for the bots I extracted from the first sim.
Anyway, I'm using my computer for stuff lately so I'm no longer running the sim, might start it again at some point if I have an extra computer I can put somewhere I can't hear it.

So figured I should post what I got so far in case someone wants to run it or study the results.

Now obviously most of the functional mutations have arised by changing weight in the network, but the point is to create an evo base that isn't "hand made".
The mutated network is close to how I would immagine a very redundant mutated bot would start to evolve further by creating these structures as part of it's code.

Now I only used point mutations while running the sim, but it should be possible to enable all mutations, problem is it doesn't work mid sim, so I've been drawing out the best bots after a period with no mutations, this way they can all be entered again with new mutation settings.

Just remember that it's a big bot and it's evolved in a large environment (size 13) with very litle food (no more than 25 vegs max), so mutations rates need to be very low... I've included a good setting file to work from if you want to start your own sim with these.
Costs are close to F1 with no code execution costs and low movement cost.

To start a new sim with this bot you need to fidle around with a few things, wich is also why I included a sim with only one of the bots so you can see the evolved bot in action without having to fidle with all this or load the last sim before I locked mutations.

So to limit spam I'll try to break it down :

Files :
This was all done with DB 2.43.1k, but I think it should work in newer versions aswell.
I was planning on describing all the files in detail, but it's been months since I last looked at this, so I can't remember which is what. So I'll describe what I can.
- starterNN.sim
This is a sim where I inserted one of the good bots that I extracted from the original sim, so you don't need to load a sim with 2000 bots to view the behavior.
- NNNewBase
These are the original sim files, the last one I had as a rar file was _28_76.rar, so I suspect it's one of the last sims before I locked mutations to extract the best bots.
The others are later saves and I'm not sure what I was doing to those.
- Extracted bots.
These where all the subspecies extracted from the sim after having locked mutations for a day or 2. Some of them seem to cover most of the field with some holes here and there and others seem to focus on filling out those blanks.
There where some edge scrapers for a while, but not sure if there where any left in the end. (It was a big advantage at one point because the soccer bots used to loose track of their alge around borders)
- AllInOne is just all the files in one rar, so you don't need to download them individualy. The individual files are for people who for some reason still use a modem.

Settings :
It's basicaly F1 settings with some reduced movement cost, and I think I also cut code execution costs.
Field should be size 13, they still work in other field size, but with size 13 they spread out very nicely all over the place.
Toroidal borders is a must, they are not ment for a sim with borders and I'm pretty sure it's too late to try and change that.
And thin liquids is also required, also rather important I would say, since their controlls are all evlved in that environment anything else would probably be rather confusing to them.
25 or less alge, you don't want more than that unless you're increasing costs to make up for it... I actualy recommend around 10 with the costs in the included sims.
Currently the sim only has point mutations, and only VERY few of them. You could use all mutation types in theory, just make sure they're VERY rare... it's a big sim, so mutating often will let bots mutate 100's of times before encountering an alge, meaning they'll devolve alge controll for sure (Maybe if you're very lucky a strong cannibot would evolve, but I seriously doubt it).
The code is very long so it will mutate often, and the structure means a lot of mutations will be functional, so if you want more mutations... I guess maybe a lot of non functional junk code might help.

Instructions (On starting your own sim):
You should use settings that are close to the ones from the included sim, then you can always change them gradualy into whatever it is you like. But drastic changes could end up killing off everything.
Also the size and energy of a bot affect it's controlls... it may seem silly but this is how they work and it actualy makes sence once you study their behavior and environment, size and nrg reserves affecting behavior is a good thing in the long run.
But this means that the default (and non changeable) body size a bot starts with will have a very negative effect on it's navigation. So you need to select the bot and force it to reproduce twice before it reaches a manageable size.
This is a litle tricky to accomplish, wich is why there's also an almost empty sim with some bots set up with the right size and right next to an alge. It will still take a while before the bots stabilize around their natural way of being, but they'll get there and start to play soccer with the alge eventualy.
You'll see them try to play soccer form the beginning, but it'll take a while before the alge and bots all have the size and nrg their used to and start to realy demonstrate fancy ball controll.

The included sim (starterNN.sim):
Now this sim holds one of the subspecies from the end of the 4-500 hour evo sim.
It's one that was successfull over the largest part of the field. t was at around 2000 bots when I locked mutations to extract the best bots, so the sim won't behave exactly as before while the population is this low.
Also mutations are enabled, so if you wan't to make sure you're seing the original bot start off by locking mutations. (The mutations aren't too frequent though, so it shouldn't hurt to have them enabled)
Since there's very few bots in the sim the veggies tend to get bigger than they normaly would in the old sim, so they're not at the optimal size for the bots to "play soccer" with them.
The bots will still controll the alge and avoid killing it, but the alge will be too big to move around much, and in the end the bot will be too big to controll the alge well from all the energy it gains.
So if you're not seing much action just look around for a small bot controlling a small/medium size alge. Sooner or later things will start to fit better as the sim gets going and you'll start to see bots figting over alge and a lot more "dribling".
(I tryed to record some of this stuff, but the resolution made it realy hard to see what was going on)
Theres also only 10 veggies in the sim to reduce population a litle. I also encourage playing around with costs and such, increase movement costs, slowly get to F1 default costs maybe, but take baby steps, slight changes in costs can have dramatic effects, they need time to evolve to adapt to changes, do it litle by litle.
(I forgot wich bot I used for this sim, but that should be easy to see if you just start the sim and look at the settings)

So what does it do ? What evolved so far ?

It was started off as a blank network with only a few hand set weights.
It could eat alge and reproduce basicaly, but not very well.

And after about 2000 mutations :
- Anti canni conspec: It had evolved a conspec based on movement, when 2 bots see eachother they shoot, but try to get around eachother and move on. This makes it very hard for canibots or even just carnivores to evolve, since if you attack they will fight back or use mass reproduction to escape.
- Repro defence: Using reproduction as a defence in 2 different ways. It seems to get triggered by massive damage or loosing track of an alge. If you're loosing a fight scramble and hope for the best, if you had an alge and a bot made you loose sight of it, then spread and hope to steal it back while the other bot is focused on the many offspring.
- Alge controll: Very good alge controll, and without using ties (because I did everything I could to prevent any ties form evolving, just slows down the sim too much). It basicaly plays soccer with the alge and never kills it, a bot with an alge will make a big offspring if it gets too big, to avoid risking to kill the alge as your shots grow too powerfull. But it's realy the core of the bots behavior, in a size 13 field with 25 alge you need to stick to your food source if you find one, so this is the behavior that has been refined the most from what I can see. It has very good "ball controll" by now, and some bots are also getting good at stealing the ball as a result. It looks like it's having problems killing the alge, but it's realy just trying to keep the alge to itself while avoiding to kill it comlpetely.
- Shell: It uses shell, usualy triggered by pain I think, building a certain amount, around 500... no poison, venom or any of that though...
- Non wastefull: It's not wastefull, only shoots when it sees something. It misses the alge a lot, but if it didn't it would kill it. (There has been bots that fired less shots when manipulating the alge, but they never had a breakthrough)
- Exploring: The bots are getting pretty good at covering the field while moving in patterns where they won't run into eachother too often. There are some subspecies who cover certain areas, if you start a sim with only one bot type you will notice "holes" once the field is covered. So it seems some subspecies are more dominant in different regions. There was also some "edge scrapers" for a while because the bots had a tendency to loose their alge around the borders.
- Redundancy: And ofcourse lots of redundant code, probably because I had mutations set too high, so breaking some large code sections helped it lower the amount of functional mutations.

And yes a lot of the behaviors have arised because of the NN structure, but the NN has also changed in structure and has even added hidden nodes and such. So it's not just adjusting weights in a NN it is evolving to use the network in different ways. At one point it also developped a "handicap" where one of it's movement sysvars was always 8 (This had been done outside the NN structure). This was an advantage as it stabilized the bots movement, and at a later time the handicap actualy disapeared again. Personaly I found this very interesting, not sure exactly what to make of it, but interesting non the less.


IMPORTANT :
I almost forgot the alge, none of the sims will work without this
It's just the alge I was usin, all it does is increase body size at times, but it's the alge the bots are used to and it's needed for the sims, so you probably won't get far without it.
It's called Alga_Silo.txt
It's is NOT included in the AllInOne.rar
Title: Evolved Neural Network
Post by: jknilinux on November 13, 2008, 10:45:06 PM
My PC's finally fixed, so now I can try this out!  

Great job with it, though. Can't wait to try it!
Title: Evolved Neural Network
Post by: Moonfisher on November 14, 2008, 07:49:00 PM
Just occured to me, I forgot to include the actual base without any mutations.
(You can't just throw this thing into the same kind of environment... I don't think it'll last long in the current sim.)
Looking at it I remember it started out having poison and venom (But didn't shoot venom).
It broke venom since it never used it, but it also broke poison... aparently it was more important to conserve energy at the time...
So it eventualy broke ploc... and now poison is back for some reaosn, but ploc is still set to 0 as far as I can see...
I guess the shell prevents poison from getting used so the 23 it makes don't need to get replenished and generaly has no use.
So the litle energy it spends on it probably isn't noticable enough to be important...

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'Another neural network test
'Just trying to figure out whats possible

'i1 : *.eye5
'i2 : *.refvelup
'i3 : *.refxpos *.refypos angle
'i4 : *.body
'-------
'o1 : .shoot (-6)
'o2 : .up
'o3 : .setaim
'o4 : .repro

'Extras (no initial weights no def)

'i5 : *.refveldx
'i6 : *.refshell
'i7 : *.refpoison
'i8 : *.robage 100 mod
'i9 : *.pain
'i10: *.shang
'i11: *.nrg
'i12: *.shell
'-------
'o5 : .dx
'o6 : .shoot (-1)
'o7 : .shoot (-3)
'o8 : .mkshell
'o9 : .strbody
'o10: .fdbody
'o11: .dn
'o12: .sx

def downscale 100
def downscaleout 100

def h1 51
def h2 52
def h3 53
def h4 54
def h5 55
def h6 56
def h7 57
def h8 58
def h9 59
def h10 60
def h11 61
def h12 62
def h13 63

start
0 .h1 store
100 .h2 store
1 .h3 store
1 .h4 store
-500 .h5 store
1 .h6 store
0 .h7 store
-1 .h8 store
0 .h9 store
75 .h10 store
0 .h11 store
-100 .h12 store
0 .h13 store
stop


'********** Inputs
'======= h1
start
*.eye5 25 15 sub 20 add 15 sub 25 add 20 sub 20 add 15 sub 20 add 20 sub mult *.refvelup 25 15 sub 20 add 15 sub 25 add 20 sub 20 add 15 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h1 add .h1 store
stop

'======= h2
start
*.eye5 19 21 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 30 10 sub 35 add 10 sub 30 add 15 sub 30 add 10 sub 30 add 10 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h2 add .h2 store
stop

'======= h3
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 30 10 sub 25 add 20 sub 20 add 15 sub 30 add 20 sub 30 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h3 add .h3 store
stop

'======= h4
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 30 10 sub 35 add 10 sub 30 add 15 sub 30 add 10 sub 30 add 10 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h4 add .h4 store
stop

'======= h5
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 25 15 sub 20 add 15 sub 25 add 20 sub 20 add 15 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h5 add .h5 store
stop

'======= h6
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h6 add .h6 store
stop

'======= h7
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h7 add .h7 store
stop

'======= h8
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h8 add .h8 store
stop

'======= h9
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h9 add .h9 store
stop

'======= h10
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h10 add .h10 store
stop

'======= h11
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h11 add .h11 store
stop

'======= h12
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h12 add .h12 store
stop

'======= h13
start
*.eye5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.refvelup 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refxpos *.refypos angle 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.body 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refveldx 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refshell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.refpoison 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.robage 100 mod 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.pain 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shang 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.nrg 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.shell 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscale div *.h13 add .h13 store
stop


'in
'-----------------------------------------------------------------
'out


'********** Outputs
'======= o1
start
-6 .shoot *.h1 30 10 sub 35 add 10 sub 30 add 15 sub 30 add 10 sub 30 add 10 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div sgn mult store
stop

'======= o2
start
*.h1 20 25 sub 10 add 20 sub 15 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 30 10 sub 25 add 20 sub 20 add 15 sub 30 add 20 sub 30 add 20 sub mult add *.h3 30 10 sub 35 add 10 sub 30 add 15 sub 30 add 10 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 25 sub 10 add 20 sub 15 add 20 sub 20 add 20 sub 10 add 30 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div .up store
stop

'======= o3
start
*.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 25 sub 10 add 20 sub 15 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 30 10 sub 35 add 10 sub 30 add 15 sub 30 add 10 sub 30 add 10 sub mult add *.h5 30 10 sub 25 add 20 sub 20 add 15 sub 30 add 20 sub 30 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div .setaim store
stop

'======= o4
start
*.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 45 5 sub 40 add 10 sub 55 add 15 sub 50 add 10 sub 55 add 5 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div .repro store
stop

'======= o5
start
*.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div .dx store
stop

'======= o6
start
-1 .shoot *.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div sgn mult store
stop

'======= o7
start
-3 .shoot *.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div sgn mult store
stop

'======= o8
start
*.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div .mkshell store
stop

'======= o9
start
*.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div .strbody store
stop

'======= o10
start
*.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div .fdbody store
stop

'======= o11
start
*.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div .dn store
stop

'======= o12
start
*.h1 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult *.h2 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h3 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h4 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h5 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h6 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h7 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h8 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h9 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h10 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h11 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h12 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add *.h13 20 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub 20 add 20 sub mult add .downscaleout div .sx store
stop



'----- some regular genes to help it along...

cond
*.robage 0 =
start
.shoot .vloc store
-2 .venval store
.shoot .ploc store
stop

cond
*.venom 10 <
*.nrg 100 >
*.eye5 0 >
start
10 .strvenom store
stop

cond
*.poison 10 <
*.nrg 100 >
*.eye5 0 >
start
10 .mkpoison store
stop

cond
*.robage 10 <
start
*.maxvel - .up store
*.maxvel .sx store
*.refxpos *.refypos angle .setaim store
.setaim .shoot store
*.aim .shootval store
stop

start
.deltie inc
.fixpos dec
800 .eye5width store
stop

cond
*.nrg *.body 10 mult >
start
'100 .strbody store
stop

cond
*.body 5 <
*.robage 0 >
start
-2 .shoot store
31000 .shootval store
stop

cond
*.totalmyspecies 2000 >
start
20 .shootval store
stop

end
Title: Evolved Neural Network
Post by: jknilinux on November 15, 2008, 06:13:34 PM
Alright, I'm running NNNewBase_28_81_1, with slightly modified settings:

I increased viscosity to 5, decreased movement efficiency to 50%, increased movement costs to .002 nrg/bang, 1 nrg/tie firing, and -0.001 nrg/body/turn... I'm trying to increase the possibility of tie formation and MBs by slowly increasing viscosity to "thick" and decreasing movement efficiency to 0.

After a few hours at 1 cycle/second, the bot population has decreased to 1200 and is still going down...

Moonfisher, I was wondering if you had any suggestions, since you're the one who made the sim. Should I change the settings more gradually? Should I just start from scratch with your original NNbot? Anyway, thanks for posting this!
Title: Evolved Neural Network
Post by: jknilinux on November 16, 2008, 01:03:48 PM
By the way, are you sure the bots don't use poison? Most of the bots in my sim have poison = 23 when I click on "view bot info". If it isn't poison, what does it mean?
Title: Evolved Neural Network
Post by: Moonfisher on November 16, 2008, 04:52:56 PM
Well they all create 23 poison if they have over 100 nrg from what I can see... but with ploc set to 0 the poison doesn't actualy do anything.
But it also doesn't matter because the mutated bots have around 500 shell, so the poison never gets triggered unless someone gets through the shell first. So it only spends a very litle amount of energy on the poison once, then probably never replenishes it, so even if the poison did do something it wouldn't matter, and because the cost is so small it's probably irelevant to natural selection. I just though it was funny that it started to create poison again after .ploc had been broken, since it no longer has any use, but even if ploc wasn't broken the poison probably wouldn't get triggered anyway.
Title: Evolved Neural Network
Post by: jknilinux on November 16, 2008, 06:04:19 PM
Also I'm not sure if this is a bug or not, but I unchecked "disable mutations" for alga silo and it's not showing up in the mutations graph...
Title: Evolved Neural Network
Post by: Moonfisher on November 17, 2008, 07:34:03 AM
One reason for this could be that you can't change mutation settings for a bot during a sim (Wich is too bad, since this would make ti a lot easier for me to try out different mutation settings without having to extract bots and restart the sim).

Another reason could be that mots mutations are cause by reproduction, and the veggy cap is lower than the repop cap, so no veggies ever get to reproduce. (Also I don't think alga silo had a repro gene).

BTW, I'm actualy starting to look at positbilities for creating a MOD that would change all mutation types to create NN structures instead... got plenty of dieas for how it should work, but never realy worked with VB before so I need a compiler and get aquainted with the syntax and all... but mostly gotta figure out how to build buddy drops and all that.
Either way if I get anywhere with it I'll upload the drop here. The idea is to "accelerate" evolution a litle... my theory is that encouragin more usefull mutations is only a way of accelerating evolution. More random mutations could give the same results, it would just take longer. And since I don't ahve milions of years to run my sim I want to speed up evolution a litle.
Title: Evolved Neural Network
Post by: jknilinux on November 17, 2008, 01:22:07 PM
Quote from: Moonfisher
One reason for this could be that you can't change mutation settings for a bot during a sim (Wich is too bad, since this would make ti a lot easier for me to try out different mutation settings without having to extract bots and restart the sim).

Another reason could be that mots mutations are cause by reproduction, and the veggy cap is lower than the repop cap, so no veggies ever get to reproduce. (Also I don't think alga silo had a repro gene).

BTW, I'm actualy starting to look at positbilities for creating a MOD that would change all mutation types to create NN structures instead... got plenty of dieas for how it should work, but never realy worked with VB before so I need a compiler and get aquainted with the syntax and all... but mostly gotta figure out how to build buddy drops and all that.
Either way if I get anywhere with it I'll upload the drop here. The idea is to "accelerate" evolution a litle... my theory is that encouragin more usefull mutations is only a way of accelerating evolution. More random mutations could give the same results, it would just take longer. And since I don't ahve milions of years to run my sim I want to speed up evolution a litle.

It's gotta be the first one... I enabled day/night cycles to keep the veg population in check, removed the pop cap, and their population did climb to 26...

And that idea sounds great! Especially since ericl is no longer with us, and the only other developer is working on DB3. It'll be nice for DB2 to still be improving while he's gone...
Title: Evolved Neural Network
Post by: Moonfisher on November 18, 2008, 12:22:09 PM
EricL is gone ?? I thought he was just on vacation or something, didn't realize...

Anyway I'm not connected to the repository, I just downloaded the source for DB 2.43.1h... I'll have to check what bug reports it had... think I remember there where some problems with poison and venom ad such, not sure if it got fixed for version h...

Anyway, 2.44 has some serious issues I don't want to mess with... was hoping to maily just mess with the mutation types, make a small hack to exchange the current mutation types with my own coustom ones, so I won't need to mess with GUI or anything... and maybe fix any serious issues from version h that I can't live with...
If I figure out how to make a buddy drop then I'll try to adjust the GUI to atleast give a hint as to what the mutation does, before uploading it... if I ever get that far.
Title: Evolved Neural Network
Post by: Peter on November 18, 2008, 01:20:07 PM
Quote from: jknilinux
And that idea sounds great! Especially since ericl is no longer with us, and the only other developer is working on DB3. It'll be nice for DB2 to still be improving while he's gone...
Eric didn't for a month or so. No reason to say he has gone.
Title: Evolved Neural Network
Post by: jknilinux on November 18, 2008, 04:27:47 PM
OH MY GOSH!    

I just read what I said, and it sounded like he died or something! I'm sorry, that is not what I meant.  

What I meant is I heard numsgil say somewhere that he's moved on to bigger things, but I don't mean I KNOW he's not coming back.

Title: Evolved Neural Network
Post by: Moonfisher on November 20, 2008, 01:24:11 PM
Well good to hear EricL is ok
But it looks like it'll be a while before I get anywhere with that mod.
It's my first time working with VB, and gotta say I'm not loving the syntax... there's no headers... like everything is global or something... maybe it's just because I'm a VB noob and I'm missing something. Anyway so far I'm having a hard time finding my way through the code and figuring out where everything is declared asf...
Appart from that all the abreviations are driving me crazy... took me ages to realize that rob() was an array with all the robots... and I'm not even sure that's correct. Seems pointless to abreviate a 5 letter word into a 3 letter word... but if this is the case then it should make it easier for me to figure out what everything else stands for... just assumed that when something was abreviated there was a reason for it.

Does anyone know if there's a class diagram available for DB... or maybe just a readme to explain the structure and abreviations ? (Only readme I could find was the one with the copyright info)
Title: Evolved Neural Network
Post by: jknilinux on November 20, 2008, 03:58:40 PM
Not saying it's eric's fault, but I've found that when a program is maintained by only one or two people, the code becomes less and less self-documentary, because that one developer knows it like the back of his hand anyway.
Perhaps making the DB source code more readable should be our first goal- it'll be pretty easy and will give us and any later beginning developers a running start.
Title: Evolved Neural Network
Post by: Moonfisher on November 22, 2008, 07:39:37 AM
Heh well I was initialy hoping to just change the NeoMutations class... but it looks like that was optimistic, since I don't need to mutate the code randomly, I need to form networks structures and expands the netwrok from those structures.
So last time I was looking at the source I was actualy considering rewriting a larger part of the code...
I read somewhere that the C++ port was put on hold... not sure how far it got though, so I was thinking of taking a look at it... or maybe the C# version if that's what people are working on... I'm a big fan of C so it should make it a lot easier for me to find my way (Also C uses headers, so even if there's no dokumentation or comments it should be a lot easier to navigate the code).
But if the C++ and C# version are too far from completion I'll just have to man up and find my way though the VB code...  
Just seems like I'll have to change a lot for what I have in mind... so it would be a lot easier for me if I was doing it in a laguage that I know well.
I was actualy considering building the application I need in C++ and build it as a library or DLL and then just call it from the VB code
Title: Evolved Neural Network
Post by: jknilinux on November 26, 2008, 04:03:14 AM
Well, I'd love to see a usable version of DB in C++!
I (and many other people) use *nix, so programs in VB are near-impossible and in C# need to be checked for compatibility.

There's a C++-ified version of 2.4 here. (http://www.darwinbots.com/WikiManual/index.php?title=Source_code_download)

Good luck!
Title: Evolved Neural Network
Post by: abyaly on December 08, 2008, 11:15:46 AM
Moonfisher-
-1 shots bypass shell entirely and only hit the poison.
Title: Evolved Neural Network
Post by: Moonfisher on December 23, 2008, 06:16:21 PM
I've been working on that NN mod for a while now whenever I have some spare time.
Haven't had much time to work on it, but I've gotten to a point where it would be descent enough for anyone else to try out.
It's nowhere near done... but it works.
Haven't run this one for a long time yet, so I guess it could have some bugs... also I used DB 2.43.1h... and it has some bugs... think ties mess up and stuff like that.
But the source for 2.43.1h was the closes I could find to 2.43.1l
And didn't want to have to connect to the repository and figure out how to revert to 2.43.1l

Anyway the button for activating the NN mutations is a itle silly... and I managed to break the disable vision button somehow
Never messed with VB before was trying to copy the checkbox and... well I have no idea what happened, but it's broken.
If you activate NNmutations and start a sim then you won't be able to see it active in the menu if you open it again.
If you need to turn off the NNMutations I think you'll need to check and then uncheck the box to actualy deactivate it... (The whole GUI part was a bit confusing to me and didn't bother spending much time on it)

Annyway, buggy button aside, it should work more or less as intended.
Theres no GUI for messing with mutation rates, so they're random for starters (Just start with 100 or more bots to get lots of different settings).
You can adjust global mutation rates though.

When you enable NNmutations they will overide regular mutations. Don't disable mutations unless you intend to disbale the NNMutations.
Mutations only happen during reproduction... so you need a bot that reproduces. (I've included the test bot I'm running atm)
Appart from that, it basicaly takes your base bot and adds some Neural Network like structures to it...

You can save the simulation and reload it.... but if you copy the code from a bot the mod can't just load the network information. (You also can't just save an organism, but I might work on that later on)
You can still run it with the mod but it'll start to form a new network instead of mutating the existing one.

Also theres some coustom inputs and outputs from loc 100 to 120, look at the test bot for details.
You can also have entire genes triggered by the 10 outputs if you like... or use the output value durectly in a sysvar or whatever you prefer.

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']def NNInput1 100
def NNInput2 101
def NNInput3 102
def NNInput4 103
def NNInput5 104
def NNInput6 105
def NNInput7 106
def NNInput8 107
def NNInput9 108
def NNInput10 109

def NNOutput1 110
def NNOutput2 111
def NNOutput3 112
def NNOutput4 113
def NNOutput5 114
def NNOutput6 115
def NNOutput7 116
def NNOutput8 117
def NNOutput9 118
def NNOutput10 119

cond
*.robage 0 =
start
.shoot .ploc store
.shoot .vloc store
-2 .venval store
stop

cond
*.dnalen 400 <
*.robage 1000 <
start
.up inc
stop

cond
*.dnalen 500 <
*.robage 1500 <
*.eye5 0 >
*.refage 500 >
*.refeye 0 =
*.refshoot 0 =
start
-6 .shoot store
stop

cond
*.eye5 0 =
*.body 3000 >
*.dnalen 600 <
*.robage 2000 <
start
75 .repro store
stop

cond
*.dnalen 600 <
*.robage 3000 >
start
-2 .shoot store
32000 .shootval store
stop

'Apply inputs
start
*.refxpos *.refypos angle .NNInput1 store
*.body 1000 sub .NNInput2 store
*.refeye *.myeye sub abs .NNInput3 store
*.refshoot *.myshoot sub abs .NNInput4 store
*.refdx *.mydx sub abs .NNInput5 store
*.nrg 1000 sub .NNInput6 store
*.shell 500 sub .NNInput7 store
*.poison 500 sub .NNInput8 store
*.venom 500 sub .NNInput9 store
*.shang - *.aim add .NNInput10 store
stop


'Apply outputs
start

*.NNOutput1 0 >
50 .repro store

*.NNOutput2 0 >
-1 .shoot store

*.NNOutput3 0 >
-6 .shoot store

*.NNOutput4 0 >
-3 .shoot store

*.NNOutput5 0 >
10 .strvenom store

*.NNOutput6 0 >
10 .strpoison store

*.NNOutput7 0 >
10 .mkshell store

*.NNOutput8 0 >
1 .tie store

*.NNOutput9 0 >
-1000 .tieval store

*.NNOutput10 0 >
-6 .tieloc store

clearbool
true
stop


Other than that just run the mod as a regular drop and check the Neural network checkbox on the main screen (It will enable the mod for all species, so if you wan't to prevent veggies from mutating then you need to prevent them from reproducing.)
Litle late and a bit tired so won't go into details about how the structures are formed and all that...
Also this is a pre alpha release or something... not realy done, and some features aren't implemented and mutation rates and such need tweeking or a menu of some sort. So still a long way to go, but the base is there, and it works...
It may not be like real mutations, but it definately evolves.... no idea how fast and how well yet...
And the testbot isn't ideal for testing the concept... it more usefull for testing than long evo sims.
But it shows the basic concept...


Anyway, I'm probably not making much sense, just try the mod if you're interested and ask if you have any questions.
Title: Evolved Neural Network
Post by: Moonfisher on December 26, 2008, 06:02:52 AM
A quick update, this version is a lot better, fixed some things too.
Also it now has 20 coustom input and output slots, and a better test bot to go with it.
You can't load old version sims with this new one though.
Ran a sim with the old version for a day or 2, and it did ok, except there was a bug so it only used the coustom values. So it progressed fast but had less potential in the long run.

Still not done with this thing, and there may still be bugs, but it should definately work a lot better now.
Title: Evolved Neural Network
Post by: Moonfisher on December 29, 2008, 01:03:13 PM
Ok heres v0.4
Still not done, menues are kind of messed up, they work but don't show the real figures in use (Will work on fixing that next, just never got around to it)
Again it's not version resiliant, and the global mutation rates aren't saved with the sim, so in the next version you probably won't be able to load old sims either...

But it work well enough now, and you can actualy play around with the mutation rates to force the bot to focus on your coustom inputs during the early stages then open up for more interesting mutations later on, and stuff like that.
Or you can disable global mutation rates and alow the bots to adjust their own mutation rates... just remember that this will tend to counter increases/decreases in the global mutation multiplier. If you turn mutations up they'll just turn theirs down. So I recomend keeping it locked till you've done all the adjusting you want to do. (You can still turn the global mutation rates back on (Again the checkbox is messed up and works like the one describel earlier), and the individual mutation rates should stay faily static while they're not in use)
To access the menu just click the mutation rate button on the main screen while you have the NNMod turned on.

And theres a new test bot ofcourse

Only been running this version 16 hours, about 100K cycles. With a strong focus on using the coustom inputs and outputs.
The bots seem to catch on pretty fast though, currently they're at 550-650 in dnalen, so 2 of the genes for the base have been disabled.
It's still strugling with the 600 mark, even though some have passed it there's still a lot of shorter bots around, so it's too early to tell if they're past this point.
And I suspect the 700 mark will be the toughest one to pass since cancerous reproduction is bound to happen often when trying to take over. (I did manage to get past this step with an earlier sim, but it takes some time)

Anyway once the bot is past 700 .dnalen then the only original gene left in use will be the robage = 0 gene for setting poison and such. Then I plan on turning down the coustom inputs and outputs to leave room for more interesting development. I just want the network to controll everything before opening up to interesting mutations.
The bots are also using shell, about 500 (All the sims I've run end up around that figure if using shell it seems), and they back up whenever they see an alge now (Since the base just kept moving forward at all times).

Not that anything realy interesting has surfaced yet, but the network is definately taking shape rather fast. (Ofcourse this is probably mainly because it's so focused on using the oucstom inputs and outputs, once eveything is opened up it'll have more potential but it'll probably progress a lot slower).

This is what it looks like so far. But it'll get more interesting once it gets past 700 in dnalength and is allowed to unfold. and ofcourse once it's actualy been running long enough for something interesting to happen.
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
''''''''''''''''''''''''  Gene:  1 Begins at position  1  '''''''''''''''''''''''
 cond
 *.robage 0 =
 start
 7 .ploc store
 7 .vloc store
 -2 .venval store
 stop
''''''''''''''''''''''''  Gene:  1 Ends at position  15  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  2 Begins at position  16  '''''''''''''''''''''''
 cond
 *.dnalen 400 <
 start
 *.robage 1500 <
 40 .up store
 stop
''''''''''''''''''''''''  Gene:  2 Ends at position  27  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  3 Begins at position  28  '''''''''''''''''''''''
 cond
 *.dnalen 500 <
 start
 *.robage 2000 <
 *.eye5 0 >
 and
 *.refage 500 >
 and
 *.refeye 0 =
 and
 *.refshoot 0 =
 and
 -6 .shoot store
 stop
''''''''''''''''''''''''  Gene:  3 Ends at position  55  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  4 Begins at position  56  '''''''''''''''''''''''
 cond
 *.dnalen 600 <
 start
 *.robage 0 =
 628 .aimleft store
 *.eye5 0 =
 *.body 1000 >
 and
 *.robage 2000 <
 and
 314 .aimleft store
 stop
''''''''''''''''''''''''  Gene:  4 Ends at position  81  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  5 Begins at position  82  '''''''''''''''''''''''
 cond
 *.dnalen 700 <
 start
 *.eye5 0 =
 *.body 1000 >
 and
 *.robage 2500 <
 and
 50 .repro store
 *.robage 4500 >
 -2 .shoot store
 32000 .shootval store
 stop
''''''''''''''''''''''''  Gene:  5 Ends at position  110  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  6 Begins at position  111  '''''''''''''''''''''''
 start
 true
 *.refxpos *.refypos angle 70 store
 *.body 1000 sub 71 store
 *.refeye *.myeye sub abs 72 store
 *.refshoot *.myshoot sub abs 73 store
 *.refdx *.mydx sub abs 74 store
 *.nrg 3000 sub 75 store
 *.shell 500 sub 76 store
 *.poison 500 sub 77 store
 *.venom 500 sub 78 store
 *.shang - *.aim add 79 store
 *.eyef 80 store
 *.aim 81 store
 *.refshell 82 store
 *.refvelup 83 store
 *.refvelsx 84 store
 *.refveldx 85 store
 *.refvelup 86 store
 *.eye9 87 store
 *.eye1 88 store
 *.pain 89 store
 stop
''''''''''''''''''''''''  Gene:  6 Ends at position  197  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  7 Begins at position  198  '''''''''''''''''''''''
 start
 *100 0 >
 50 .repro store
 *101 0 >
 -1 .shoot store
 *102 0 >
 -6 .shoot store
 *103 0 >
 -3 .shoot store
 *104 0 !=
 *104 .mkshell store
 *105 0 !=
 *105 .mkpoison store
 *106 0 !=
 *106 .strvenom store
 *107 0 !=
 *107 .strbody store
 *108 0 !=
 *108 .fdbody store
 *109 0 !=
 *109 .up store
 *110 0 !=
 *110 .dn store
 *111 0 !=
 *111 .dx store
 *112 0 !=
 *112 .sx store
 *113 0 !=
 *113 .setaim store
 *114 0 !=
 *114 .aimleft store
 *115 0 !=
 *115 .aimright store
 *116 0 !=
 *116 .aimshoot store
 *117 0 !=
 *117 .shootval store
 *118 0 !=
 *118 .focuseye store
 *119 0 !=
 *119 .eye5width store
 true
 stop
''''''''''''''''''''''''  Gene:  7 Ends at position  320  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  8 Begins at position  321  '''''''''''''''''''''''
 start
 0 110 store
 0 674 store
 0 102 store
 0 946 store
 0 107 store
 0 101 store
 0 101 store
 0 101 store
 0 101 store
 0 101 store
 0 108 store
 0 103 store
 0 662 store
 0 118 store
 0 103 store
 stop
''''''''''''''''''''''''  Gene:  8 Ends at position  367  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  9 Begins at position  368  '''''''''''''''''''''''
 start
 *110 *.refvelsx -40 mult add *102 -121 mult add *108 25 mult add 145 div 110 store
 *674 *74 19 mult add *77 -10 mult add 100 div 674 store
 *103 *102 -133 mult add *110 -53 mult add *946 -29 mult add 134 div 103 store
 *110 *80 106 mult add *674 -41 mult add *73 -25 mult add *88 4 mult add 35 div 110 store
 *102 *674 -21 mult add *78 6 mult add *110 -67 mult add 53 div 102 store
 *102 *110 -66 mult add 134 div 102 store
 *107 *75 44 mult add 127 div 107 store
 *946 *84 -19 mult add *101 -78 mult add *674 -28 mult add 100 div 946 store
 *107 *86 27 mult add 100 div 107 store
 *108 *78 -20 mult add 100 div 108 store
 *101 *74 -6 mult add *674 -20 mult add 52 div 101 store
 *101 *82 62 mult add 100 div 101 store
 *104 *946 42 mult add 103 div 104 store
 *101 *83 -18 mult add 100 div 101 store
 *101 *78 28 mult add 100 div 101 store
 *101 *101 -84 mult add 100 div 101 store
 *108 *107 -20 mult add 100 div 108 store
 *103 *74 -29 mult add *674 -20 mult add 52 div 103 store
 *662 *674 -59 mult add *87 0 mult add *662 87 mult add 100 div 662 store
 *118 *662 0 mult add 100 div 118 store
 *110 *80 106 mult add *674 -41 mult add *73 -25 mult add *88 4 mult add 35 div 110 store
 *103 *75 -25 mult add 100 div 103 store
 stop
''''''''''''''''''''''''  Gene:  9 Ends at position  643  '''''''''''''''''''''''
Title: Evolved Neural Network
Post by: jknilinux on November 21, 2009, 11:55:44 AM
Hey moonfisher! I've been wondering what has become of your NNmod of DB. Have you tried it? Have you evolved anything interesting?
Title: Evolved Neural Network
Post by: Moonfisher on November 22, 2009, 11:31:02 AM
Well ran a sim over a week or so, then next time I had to load it I realized I made an error either when saving or loading the newest NN data...
The last bot I can find that I saved looked like this :

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
''''''''''''''''''''''''  Gene:  1 Begins at position  1  '''''''''''''''''''''''
 cond
 *.robage 0 =
 start
 7 .ploc store
 7 .vloc store
 -2 .venval store
 stop
''''''''''''''''''''''''  Gene:  1 Ends at position  15  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  2 Begins at position  16  '''''''''''''''''''''''
 cond
 *.dnalen 400 <
 start
 *.robage 1500 <
 40 .up store
 stop
''''''''''''''''''''''''  Gene:  2 Ends at position  27  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  3 Begins at position  28  '''''''''''''''''''''''
 cond
 *.dnalen 500 <
 start
 *.robage 2000 <
 *.eye5 0 >
 and
 *.refage 500 >
 and
 *.refeye 0 =
 and
 *.refshoot 0 =
 and
 -6 .shoot store
 stop
''''''''''''''''''''''''  Gene:  3 Ends at position  55  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  4 Begins at position  56  '''''''''''''''''''''''
 cond
 *.dnalen 600 <
 start
 *.robage 0 =
 628 .aimleft store
 *.eye5 0 =
 *.body 1000 >
 and
 *.robage 2000 <
 and
 314 .aimleft store
 stop
''''''''''''''''''''''''  Gene:  4 Ends at position  81  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  5 Begins at position  82  '''''''''''''''''''''''
 cond
 *.dnalen 700 <
 start
 *.eye5 0 =
 *.body 1000 >
 and
 *.robage 2500 <
 and
 50 .repro store
 *.robage 4500 >
 -2 .shoot store
 32000 .shootval store
 stop
''''''''''''''''''''''''  Gene:  5 Ends at position  110  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  6 Begins at position  111  '''''''''''''''''''''''
 start
 true
 *.refxpos *.refypos angle 70 store
 *.body 1000 sub 71 store
 *.refeye *.myeye sub abs 72 store
 *.refshoot *.myshoot sub abs 73 store
 *.refdx *.mydx sub abs 74 store
 *.nrg 3000 sub 75 store
 *.shell 500 sub 76 store
 *.poison 500 sub 77 store
 *.venom 500 sub 78 store
 *.shang - *.aim add 79 store
 *.eyef 80 store
 *.aim 81 store
 *.refshell 82 store
 *.refvelup 83 store
 *.refvelsx 84 store
 *.refveldx 85 store
 *.refvelup 86 store
 *.eye9 87 store
 *.eye1 88 store
 *.pain 89 store
 stop
''''''''''''''''''''''''  Gene:  6 Ends at position  197  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  7 Begins at position  198  '''''''''''''''''''''''
 start
 *100 0 >
 50 .repro store
 *101 0 >
 -1 .shoot store
 *102 0 >
 -6 .shoot store
 *103 0 >
 -3 .shoot store
 *104 0 !=
 *104 .mkshell store
 *105 0 !=
 *105 .mkpoison store
 *106 0 !=
 *106 .strvenom store
 *107 0 !=
 *107 .strbody store
 *108 0 !=
 *108 .fdbody store
 *109 0 !=
 *109 .up store
 *110 0 !=
 *110 .dn store
 *111 0 !=
 *111 .dx store
 *112 0 !=
 *112 .sx store
 *113 0 !=
 *113 .setaim store
 *114 0 !=
 *114 .aimleft store
 *115 0 !=
 *115 .aimright store
 *116 0 !=
 *116 .aimshoot store
 *117 0 !=
 *117 .shootval store
 *118 0 !=
 *118 .focuseye store
 *119 0 !=
 *119 .eye5width store
 true
 stop
''''''''''''''''''''''''  Gene:  7 Ends at position  320  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  8 Begins at position  321  '''''''''''''''''''''''
 start
 0 674 store
 0 109 store
 0 909 store
 0 107 store
 0 .eye2dir store
 0 .readtie store
 0 .eye3dir store
 0 104 store
 0 110 store
 0 874 store
 0 106 store
 0 .sharewaste store
 0 175 store
 0 .sharewaste store
 0 100 store
 0 112 store
 0 109 store
 0 .stifftie store
 0 .backshot store
 0 109 store
 0 110 store
 0 .eye6width store
 0 106 store
 0 109 store
 0 .genes store
 0 108 store
 0 106 store
 0 .mkvirus store
 0 116 store
 0 105 store
 0 883 store
 0 .readtie store
 0 .eye3dir store
 0 108 store
 0 113 store
 0 182 store
 0 105 store
 0 .in8 store
 0 .eye2dir store
 0 .eye1dir store
 0 116 store
 0 .readtie store
 0 107 store
 0 .strvenom store
 0 .sharewaste store
 stop
''''''''''''''''''''''''  Gene:  8 Ends at position  457  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  9 Begins at position  458  '''''''''''''''''''''''
 start
 *674 *73 24 mult add *78 -31 mult add *109 -70 mult add 119 div 674 store
 *102 *82 -35 mult add *674 -66 mult add *100 18 mult add *.paralyzed 24 mult add 134 div 102 store
 *110 *80 137 mult add *674 -63 mult add *82 31 mult add *.shup 4 mult add *73 11 mult add 35 div 110 store
 *109 *.trefvelyourdn -68 mult add *.sharewaste -37 mult add 100 div 109 store
 *102 *102 -28 mult add 168 div 102 store
 *909 *.hitdx -9 mult add *75 42 mult add 100 div 909 store
 *107 *102 -35 mult add 148 div 107 store
 *101 *.eye3dir -57 mult add *115 -3 mult add 100 div 101 store
 *.eye2dir *85 -123 mult add *.myties 95 mult add 148 div .eye2dir store
 *.sharewaste *85 57 mult add *.slime 31 mult add 281 div .sharewaste store
 *.eye3width *.genes 59 mult add *82 141 mult add *.in3 -37 mult add 100 div .eye3width store
 *.eye3dir *109 25 mult add 113 div .eye3dir store
 *101 *81 73 mult add 73 div 101 store
 *.readtie *109 29 mult add *70 28 mult add *105 -7 mult add 131 div .readtie store
 *.eye3dir *108 -155 mult add *.eyef 27 mult add *.eye9 120 mult add 101 div .eye3dir store
 *104 *84 11 mult add *76 -43 mult add 126 div 104 store
 *110 *.readtie 1 mult add 94 div 110 store
 *874 *.shsx -47 mult add *.shup -20 mult add *74 -22 mult add 100 div 874 store
 *101 *106 8 mult add *71 45 mult add 91 div 101 store
 *100 *78 -10 mult add *.trefvelyourup 50 mult add *674 -62 mult add *101 185 mult add *79 73 mult add *76 -29 mult add 131 div 100 store
 *106 *102 42 mult add *.tieang 9 mult add *.in3 87 mult add 95 div 106 store
 *.sharewaste *.multi 102 mult add 87 div .sharewaste store
 *175 *.eye3dir 20 mult add *100 8 mult add 100 div 175 store
 *.sharewaste *101 31 mult add *.trefxpos -31 mult add *.trefbody -5 mult add 100 div .sharewaste store
 *100 *102 -67 mult add *83 -4 mult add 100 div 100 store
 *112 *.velsx 51 mult add 119 div 112 store
 *101 *.trefvelmydx -34 mult add *114 52 mult add 100 div 101 store
 *109 *110 -51 mult add *71 -38 mult add *.eye5 -68 mult add 100 div 109 store
 *.stifftie *84 -22 mult add 94 div .stifftie store
 *109 *.refvelscalar 33 mult add 100 div 109 store
 *.backshot *.trefvelyourdx 73 mult add 75 div .backshot store
 *109 *.fertilized -57 mult add *.eye3dir 52 mult add 156 div 109 store
 *110 *115 18 mult add *106 -156 mult add *.hitup -83 mult add 89 div 110 store
 *.eye6width *74 27 mult add *.refvelup -54 mult add 100 div .eye6width store
 *106 *.vel 63 mult add *87 -31 mult add *.in5 138 mult add 100 div 106 store
 *111 *85 160 mult add 100 div 111 store
 *109 *.out6 -100 mult add 144 div 109 store
 *109 *82 102 mult add 52 div 109 store
 *.genes *.out2 -65 mult add *.shdx 32 mult add 20 div .genes store
 *.fixlen *89 -25 mult add 100 div .fixlen store
 *108 *.tout2 -20 mult add 84 div 108 store
 *106 *109 -115 mult add *110 91 mult add 100 div 106 store
 *.in5 *.mysx -39 mult add *81 -16 mult add 101 div .in5 store
 *.mkvirus *.refveldx 52 mult add *112 -2 mult add *.shsx 1 mult add 100 div .mkvirus store
 *116 *109 -128 mult add 100 div 116 store
 *105 *.shup 41 mult add *.rdboy 78 mult add 101 div 105 store
 *883 *.refmulti -78 mult add *101 59 mult add 142 div 883 store
 *.readtie *.trefvelmysx 87 mult add *79 28 mult add 100 div .readtie store
 *.eye3dir *.poisoned 51 mult add 100 div .eye3dir store
 *106 *72 5 mult add 139 div 106 store
 *108 *107 -36 mult add *.eye1 7 mult add 84 div 108 store
 *113 *70 100 mult add 100 div 113 store
 *182 *.out9 0 mult add *.dnalen -23 mult add 100 div 182 store
 *105 *.eye1 -4 mult add 100 div 105 store
 *.in8 *.eye2dir 63 mult add 100 div .in8 store
 *.eye2dir *116 -145 mult add *85 -113 mult add 100 div .eye2dir store
 *.eye1dir *84 -56 mult add *.eye5 75 mult add 100 div .eye1dir store
 *116 *182 -23 mult add 100 div 116 store
 *.readtie *.trefvelmysx 87 mult add *71 28 mult add 100 div .readtie store
 *105 *874 18 mult add *.stifftie -33 mult add 101 div 105 store
 *101 *.eye3dir -57 mult add *115 -3 mult add 100 div 101 store
 *883 *.eye2dir -22 mult add *175 8 mult add 117 div 883 store
 *.in3 *892 -2 mult add 100 div .in3 store
 *.sharewaste *85 57 mult add *.slime 38 mult add 281 div .sharewaste store
 *107 *909 42 mult add *.refveldx 96 mult add 127 div 107 store
 *.strvenom *78 75 mult add 100 div .strvenom store
 *.sharewaste *101 31 mult add *.trefxpos -31 mult add *.trefbody -5 mult add 100 div .sharewaste store
 *.eye4width *.refaim -44 mult add 100 div .eye4width store
 *.in8 *84 23 mult add 100 div .in8 store
 stop
''''''''''''''''''''''''  Gene:  9 Ends at position  1336  '''''''''''''''''''''''



I generaly seemed that with a NN the bot was able to quickly finetune settings... but was less likely to evolve something new. So it was mainly good at adapting.
I don't think the way DB code works and a NN are all that different when it comes down to it. Most evolved code I've seen crossreferences data all over the place, much like I'd imagine a biological NN would do.
DB code can just take bigger steps, but is also less likely to achieve something usefull with a mutation.
But since I couldn't load that sim I was running up again I kinda put the whole thing on hold for a while.
I know one of the versions was able to save and load properly, but it was lacking other features. Also the long code generated for the NN makes the sim run slower
Overall the mod is not properly done and may be interesting, but not any better for running evo sims I think.
Title: Evolved Neural Network
Post by: Numsgil on November 22, 2009, 02:59:29 PM
Quote from: Moonfisher
I don't think the way DB code works and a NN are all that different when it comes down to it.

Came to the same conclusion when I was redoing DNA for DB3.  I was toying around with the idea of a neural net with programmable weights, but realized it was becoming regular old DNA anyway.
Title: Evolved Neural Network
Post by: peterb on April 26, 2010, 11:55:10 AM
Quote from: Numsgil
Quote from: Moonfisher
I don't think the way DB code works and a NN are all that different when it comes down to it.

Came to the same conclusion when I was redoing DNA for DB3.  I was toying around with the idea of a neural net with programmable weights, but realized it was becoming regular old DNA anyway.

... We try to make neural nets inside a single bot, thats the problem i think.
Another aprouch is to Design (outside of DB ?) a multibot in which each bot equals a single neuron.
Still it is complex (because of all connected ties (and getting them connect to the right other neuron).
But if you can do that .... maybe its possible.

I think this rather requires some kind of external multibot editor.
who can put it in a safe game format.
And in which each bot we can put specific DNA.. well let call it protains functions )

As to safe such multibot (like .repro) we would need a new repro command to put such advanced bleuprint trough..

.... thinking futher.. maybe all these DNA codemay exist then in each cell (just as our DNA) but only have the right ones active..
Still then we ned another way of repro (to build at once the same complex child with a repro)

..
hmmm.. then if you got it... how to train it ?  (is food enough to train it?)

Title: Evolved Neural Network
Post by: ashton15 on April 26, 2010, 04:24:59 PM
Quote
... We try to make neural nets inside a single bot, thats the problem i think.
Another aprouch is to Design (outside of DB ?) a multibot in which each bot equals a single neuron.
Still it is complex (because of all connected ties (and getting them connect to the right other neuron).
But if you can do that .... maybe its possible.
Would be more realistic but problem is for that kind of thing surely you would need loads of bots as in 100s and we know how much that can cripple performance, perhaps each but could contain a small neural net within a single cell and link to another bot which was like a small compartment of the brain.

Quote
I think this rather requires some kind of external multibot editor.
who can put it in a safe game format.
And in which each bot we can put specific DNA.. well let call it protains functions )
Me likey...  A lot, would help because take a person for example and take it apart and then expect the individual cells to re-assemble, just doesn't work when you start from scratch

Quote
As to safe such multibot (like .repro) we would need a new repro command to put such advanced bleuprint trough..
hmm... I'd agree that probably agree that the hardest thing about multibots is assembly... though a function like that just seems to plastic to me

Quote
.... thinking futher.. maybe all these DNA codemay exist then in each cell (just as our DNA) but only have the right ones active..
Still then we ned another way of repro (to build at once the same complex child with a repro)
Isn't this bieng worked on for DB3?

Quote
..
hmmm.. then if you got it... how to train it ?  (is food enough to train it?)

What about possesion (http://www.darwinbots.com/Forum/index.php?showtopic=111)? Also why train it? Surely partially it would be instinctive behaviours and then others it would learn from it's enviroment and parent natrually.
Title: Evolved Neural Network
Post by: Numsgil on April 26, 2010, 04:54:10 PM
Quote from: ashton15
Quote
.... thinking futher.. maybe all these DNA codemay exist then in each cell (just as our DNA) but only have the right ones active..
Still then we ned another way of repro (to build at once the same complex child with a repro)
Isn't this bieng worked on for DB3?

I'm thinking that after repro it ends up copying all the memory as well (or allowing a bot to specifically do this/not do this).  So if you have a neural net with dynamic weights and you repro all those weights get preserved.  But I'm not 100% about it either way.
Title: Evolved Neural Network
Post by: peterb on April 26, 2010, 06:07:35 PM
Quote from: Numsgil
Quote from: ashton15
Quote
.... thinking futher.. maybe all these DNA codemay exist then in each cell (just as our DNA) but only have the right ones active..
Still then we ned another way of repro (to build at once the same complex child with a repro)
Isn't this bieng worked on for DB3?

I'm thinking that after repro it ends up copying all the memory as well (or allowing a bot to specifically do this/not do this).  So if you have a neural net with dynamic weights and you repro all those weights get preserved.  But I'm not 100% about it either way.


Well having read somethings about it    

There are some interesting things about NN, for example if a single neuron dies... its not a problem (if the NN isnt to small), they as a group adapt.
On the other hand (DB shape = function) to suround such cells with some common cell with a lot of .shell (otherways creatures attacking brains get nasty killers.. ohwell its ok too..).
In reality if you drink some alcholic you wont die because some neurons got killed, after some drink you behave funny, but later you repair, your 'mind' isnt erased.
There are some neural nets (also in todays post at another topic here : http://ccsl.mae.cornell.edu/emergent_self_models (http://ccsl.mae.cornell.edu/emergent_self_models)  
That realy learn from no awernes to walking (i've seen a documentary about that bot, its kinda rocket science)

It means if the net is real good it might tweak and tune itself (starting from some randomization values)
I think for us here starters in this field / copying values within some margins of the parents value would be more likely.


You know also interesting is that most √≥fficial books (not all)  talk about 3 or more layered NN
But it is not realy required.... the brain isnt a layered structure in 3 or more layers.. its more complex.
I dont want to create such a complexity as the brain,  however it means if the right logic in a single neuron bot, then it isnt limited to a layer structure
In essence shape as MB shapes might become more functional, ..or even evolve by well some darwin rules, we allready now from DB.

Also the right code doesnt mean the sim would get slow, its only some tie communication we allready can do, but have not done in this perspective i think.
It woulod only mean a bit more tie communication.. oh well computers are known to be able to do NN beter then me using a calculator...


But this 'new' multibots need a way of beeing created, an external editor (and once created some kind of  DNA string or bleurprint ( ??? ideas on that ??, save ties positions ?? )) for .repro

(because it so different i have been thinking of cell differentiation earlier.. a rebro bot, not much command processing only smart at repro, while others are only good at other specific functions)

also interesting just notice the general things a NN can do from this article http://www.sciencedaily.com/releases/2010/...00425151146.htm (http://www.sciencedaily.com/releases/2010/04/100425151146.htm) (pretty hot stuff)


I'm not thinking DB would be the best NN simulator, but i think having it all combined a NN a genetic part, and shape (of a MB) to be a factor of function.. is pretty close to exciting biology emulation..



i think you get the idea


( oh and check this out, someone is doing something verry similair to DB in java with neural net "cells" http://tim.hibal.org/blog/ (http://tim.hibal.org/blog/)  (asbout halfway his blog..




Getting some NN inside DB is my reason to code again, but maybe my previous aprouch to learn opengl (intresting...) etc, wanst the right direction..