Author Topic: What do you make of this one?  (Read 4350 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
What do you make of this one?
« on: October 07, 2006, 05:43:22 PM »
The DNA is from the smallest veggie on the picture. Looks like they slowly has started to reproduce in a row. I think written DNA is difficult enough but evolved DNA is totally greek for me. I wonder if this one might show potential. It's evolved from a DNA with only 13 0's.

 inc
 *.shootval cond
 dec
 and
 ~ dec
 start
 >
 <
 store
 *.timer inc
 inc
 *.shoot store
 -12 *.dx !%=
 and
 and
 add sub 1 2 %=
 cond
 dec
 store
 << dec
 add start
 <
 and
 *.shootval cond
 dec
 and
 ~ dec
 start
 >
 <
 store
 *.timer store
 inc
 *.dx store
 -12 *.dx !%=
 and
 and
 inc
 sub 1 2 <
 add add
The internet is corrupt and controlled by criminally minded people.

Offline Sprotiel

  • Bot Destroyer
  • ***
  • Posts: 135
    • View Profile
What do you make of this one?
« Reply #1 on: October 26, 2006, 01:59:22 AM »
I suppose you don't really care about this anymore, but since 2.42 evolved DNA is quite hard to decipher, it might be useful to show how it can be done. There are several layers of obfuscation which should probably be removed sequentially. First, you need to descramble 2.42's free form into its equivalent 2.37-like form. Adding a bit of markup to the code, you get this :
 inc *.shootval
cond
  and ~
start
  store *.timer inc inc *.shoot store -12 *.dx add sub 1 2
cond
  << add
start
  *.shootval
cond
  and ~
start
  store *.timer store inc *.dx store -12 *.dx inc sub 1 2 add add

First, you should find the flow commands. Everything before the first "cond" is ignored (white). Then "cond" puts you in "condition mode" (green), while "start" puts you in "body mode" (blue). You can now get rid of those commands which are inactivated when they appear under the wrong mode. They are the store commands in condition mode and the logic functions and comparison operators in body mode. So what's left would look like this in 2.37 :
Code: [Select]
cond
  and ~
start
  store *.timer inc inc *.shoot store -12 *.dx add sub 1 2
stop

cond
  << add
start
  *.shootval
stop

cond
  and ~
start
  store *.timer store inc *.dx store -12 *.dx inc sub 1 2  add add
stop

To be continued...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
What do you make of this one?
« Reply #2 on: October 26, 2006, 02:24:12 AM »
Written liek that, looks like it's another viral code.  The similarity of gene 1 and gene 3 is my first indication.  Given how different they are, though, I think the viral nature is rare and slow.

I think the operative line is *.timer inc.  Basically every once in a while (very once in a while) something useful (a 1) gets written to various sysvars.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
What do you make of this one?
« Reply #3 on: October 26, 2006, 03:48:50 AM »
Well, that explains it a little, though I don't know how you know what commands to discard. When I see a bot do something new I usually take a look at the dna just to see if there might be a command there that triggers it, but it's hard to decipher. Also that the program prefers to use numbers instead of words for some commands makes it more difficult to understand, and I'm too lazy to search for it in the help file.  

I have a better one here. This one I saved before they all died out. Then I started a new sim with 500 of this gene. It keeps up a stable population with slow reproducing veggies. Don't know if it whould survive if you put heterotrophs into the sim though, but it could be interesting to test.

0 0 0 *.up and
 angle rnd store
 inc
 dup <=
 sub *.up not
 store
 inc
 rnd and
 =
 dup -218 dist *.robage angle angle angle store
 angle ~ rnd <=
 start
 *-11 and
 angle dup inc
 *26 dup dist *.robage 0 angle mod <=
 start
 *.up and
 angle rnd inc
 sgn *.sx store
 sqr *.robage dist 0 rnd =
 *.up and
 0 0 ~ *.up *-589 and
 angle rnd store
 inc
 *-22 floor dup dist *.robage 0 rnd <=
 start
 *.up not
 <
 inc
 =
 -218 pow ^ *.robage angle angle angle angle 1 rnd ~ start
 *-11 else
 not
 angle dup sub *26 dup dist *.robage 0 rnd ^ <=
 start
 *.up and
 angle rnd inc
 sgn *.sx dup sqr *29 dist 0 add rnd =
 start
 angle xor
 *.up rnd 2 *.up dup dist >=
 1 rnd <=
 start
 *.up and
 angle 0 *.up angle ceil rnd store
 inc
 ceil dup dist *.robage 0 rnd <=
 start
 *.up not
 store
 rnd inc
 =
 dup -218 | angle store
 ~ -- pow dist inc
 pyth *.up ceil mult *-164 *.robage cond
 angle cond
 ~ -- pow dist cond
 add *.dx ~ -- pow dist *.up angle not
 ~ -- pow <=
 ~ mult inc
 2 add xor
 *.dx *.up - xor
 dist & cond
 angle not
 ^ pow sqr cond
 angle not
 ~ -- pow dist dist *-4 and
 & =
 cond
 cond
 ++ *.sx dec
 *.sx <
 and
 angle cond
 angle not
 cond
 & pow dist inc
 sqr *.up ceil mult *.robage cond
 angle not
 ~ -- pow dist cond
 angle not
 ~ -- pow dist cond
 angle not
 ~ -- pow dist <=
 cond
 mult inc
 2 add xor
 4 *.up - xor
 dist - cond
 angle not
 ~ -- pow cond
 angle not
 ~ -- pow dist dist *-4 and
 & =
 cond
 store
 >> 597 xor
 dec
 *.sx ~ and
 angle cond
 pow not
 ~ -- pow pyth inc
 sqr *.up ceil mult *-164 *.robage cond
 angle not
 ~ -- pow dist cond
 angle not
 ~ -- pow dist cond
 *.up and
 not
 ~ -- pow dist <=
 1 mult inc
 2 add xor
 4 *.up - xor
 dist *.dn cond
 angle not
 ~ -- pow cond
 angle not
 ~ -- pow dist dist and
 and
 & =
 cond
 store
 ^ xor
 dec
 *.sx <
 and
 angle cond
 angle not
 ~ & pow dist >
 sqr *.up ceil mult *.robage else
 angle cond
 ~ -- pow dist cond
 angle not
 xor
 ~ -- pow dist cond
 angle not
 ~ -- pow dist <=
 cond
 rnd inc
 2 add xor
 ~ store
 *.up - xor
 dist - cond
 add !=
 ~ -- pow cond
 angle not
 ~ *.aimleft pow dist dist *-4 and
 & =
 cond
 store
 ++ xor
 | *.sx >
 <
 and
 angle
The internet is corrupt and controlled by criminally minded people.

Offline Sprotiel

  • Bot Destroyer
  • ***
  • Posts: 135
    • View Profile
What do you make of this one?
« Reply #4 on: October 26, 2006, 10:11:35 AM »
Quote from: Testlund
I have a better one here. This one I saved before they all died out. Then I started a new sim with 500 of this gene. It keeps up a stable population with slow reproducing veggies. Don't know if it whould survive if you put heterotrophs into the sim though, but it could be interesting to test.

That's weird, it shouldn't do anything since it has no start after its first cond, and hence shouldn't execute any store command.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
What do you make of this one?
« Reply #5 on: October 26, 2006, 12:45:09 PM »
I'm guessing that putting a cond command before a start command is like a restrictive command; "don't do until the condition is met". Without that it's free to execute start commands at will, like reproducing at random.
The internet is corrupt and controlled by criminally minded people.

Offline Sprotiel

  • Bot Destroyer
  • ***
  • Posts: 135
    • View Profile
What do you make of this one?
« Reply #6 on: October 26, 2006, 01:23:43 PM »
Quote from: Testlund
I'm guessing that putting a cond command before a start command is like a restrictive command; "don't do until the condition is met". Without that it's free to execute start commands at will, like reproducing at random.
Actually, you're right. So the part of the code which accomplishes something is between the first "start" and the first "cond".

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
What do you make of this one?
« Reply #7 on: October 26, 2006, 11:12:15 PM »
To be honest the code you give is really convoluted (as you would expect from evolution), and would take alot of effort to decode.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
What do you make of this one?
« Reply #8 on: October 27, 2006, 09:39:24 PM »
FYI, for several reasons not the least of which because evolved DNA is so hard to decypher, I'm starting to add some features that should at least help make the actions of evolved bots easier to see.  Shot impact dots were the first of these, which makes it easy to see what kind of shots a bot is shooting.  The next is movemenet vectors, which makes it easy to see how a bot is using .up, .dn, .sx and .dx.   Will be in 2.42.8d or 2.42.9, whichever is first.
Many beers....