General > Bot Challenges

Evolved Neural Network

<< < (4/6) > >>

jknilinux:
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.

Good luck!

abyaly:
Moonfisher-
-1 shots bypass shell entirely and only hit the poison.

Moonfisher:
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.

Moonfisher:
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.

Moonfisher:
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  '''''''''''''''''''''''

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version