Ok, the stack allows the use of values above 32000, which is going to make things a lot easyer
I tryed making a few hand tailored networks :
They're just for testing and don't represent exactly how this will work, it was mostly to see if the scaling of weights worked... Inputs for these are binary... made it easyer to set the weights manualy...
I'm thinking of keeping as much as possible in the stack for as long as possible in between genes.
They run propperly with thin liquids and no wrap... lots of veggies...
Also the outputs aren't transformed propperly, and generaly it's just a quick test to se of the general concept would work...
This one uses one hidden neuron.
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'i1 : *.eye5
'i2 : *.refshoot *.myshoot !=
'o1 : .shoot
'o2 : .up
'Normaly the inputs would have no definitions (For several reasons), this is just for testing
def i1 50
def i2 51
def h1 52
cond
*.robage 0 =
start
0 .shoot store
stop
cond
start
*.eye5 sgn .i1 store
stop
cond
*.refshoot *.myshoot !=
start
1 .i2 store
stop
cond
start
*.i1 100 mult -50 mult 100 div .h1 store
stop
cond
start
*.i2 100 mult -50 mult 100 div *.h1 add .h1 store
stop
cond
start
*.h1 100 mult 100 div 100 div .shoot store
stop
cond
start
*.h1 -300 mult 100 div 100 div .up store
stop
cond
start
0 .i2 store
stop
end
And this one uses 2... second one does virtualy nothing though, but the idea with this one is to set some random weights and see if something usefull can evolve. It doesn't reproduce, so I'm just throwing in lots of bots with frequent point mutation to see what happens...
If you use the current values it's more likely to devolve, since the best mutations are just some increase in speed once it gets big and slow...
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'i1 : *.eye5 sgn
'i2 : *.refshoot *.myshoot !=
'o1 : .shoot
'o2 : .up
'Normaly the inputs would have no definitions (For several reasons), this is just for testing
def i1 50
def i2 51
def h1 52
def h2 53
cond
*.robage 0 =
start
0 .shoot store
stop
cond
start
'*.eye5 100 ceil 100 mult 100 div .i1 store
*.eye5 sgn .i1 store
stop
cond
*.refshoot *.myshoot !=
start
1 .i2 store
stop
'Inputs
'h1
cond
start
*.i1 100 mult -50 mult 100 div .h1 store
stop
cond
start
*.i2 100 mult -50 mult 100 div *.h1 add .h1 store
stop
'h2
cond
start
*.i1 100 mult 50 mult 100 div .h2 store
stop
cond
start
*.i2 100 mult 50 mult 100 div *.h2 add .h2 store
stop
'Outputs
'o1
cond
start
*.h1 100 mult *.h2 0 mult add 100 div 100 div .shoot store
stop
'o2
cond
start
*.h1 -300 mult *.h2 100 mult add 100 div 100 div .up store
stop
cond
start
0 .i2 store
stop
end
So far I've only run a small quick test, funny enough 2 of the bots broke the conspec, but one had broken the gene generating the input, and the other one had broken the input gene for h1 making us see an enemy all the time... as far as weight tweeking goes nothing very interesting had time to happen, and I noticed the actual weights where rarely the ones to get mutated. This is also why I'll try to keep a lot in the stack, and have as litle code as possible that isn't related to the network and it's weights... also split everything up into more genes, both for sexrepro and to increase the odds that a broken gene will just act as a dead dendrit or neuron...
If I manage to evolve something interesting from the one with random values I'll post it... but the odds are low since it doesn't reproduce and I'm generaly impatient and don't have much faith in the potential of a bot that size... it's just too smal and fragile, it needs a big network so it can realy mess it up, and generaly so mos of the mutations would affect the actual network.
I'm thinking it might be a good ide to make the program able to clean up an evolved bot, restoring broken genes outside the network, and replacing broken dendrit genes with a fresh one with 0 as a weight. But I'm also thinking that may not be possible at all, since the mutations breaking certain genes can have too many different effects, I may have to fix it by hand, if that's even possible...
My concern is mostly that the changes should realy be focused around the weights, and mutations to other genes and killing dendrits would usualy have more radical effects and therfor become rather frequent... and dendrits and broken genes won't naturaly form (Or atleast it's very unlikely)... so it may end up locking the bot in a certain direction... I think if something evolves to be worth while I could try to fix it up a litle by hand... but best try not to have too much code ouside the network...
Also I ran one test on the random bot, one bot was alive when I got back, it had broken te output gene for shoot, just replaced store with dec... was shooting all the time and moved towards enemies... was lucky to have had a few alge in sight and survived a litle longer... but not quite what I was hoping for
Not sur why it was moving forward, I'm guessing the values in the stack from the first broken output gene affected the second output gene...
This does support the theory that keeping values in the stack and splitting everything into many genes may be benefitial... still trying to figure out if theres a realy clever way to do it... possibly one allowing for new dendrits to form or merge (Or atleast increase the odds).
I can see I definately need to test more ideas before I start on the C code... also I think using C may be a stupid way of doing it... but I don't know python and pearl and generaly never realy used those syntax based string manipulating fuction things.... but maybe learning it will be easyer than trying to build it in C
I think I'll just try to find a C library with those functions... if it looks like they would be very usefull...