Author Topic: Handy Genes  (Read 4619 times)

Offline Light

  • Bot Destroyer
  • ***
  • Posts: 245
    • View Profile
Handy Genes
« Reply #15 on: April 17, 2005, 02:49:06 PM »
Quote
It works right but I ran into some problems with bots killing their babies; when they rotate during birthing. Anyone have any ideas let me know.
you could just use some sort of counter when the bot has just reproduced so it cant activate the gene for the next 10 cycles or so

does *.shang refresh each cycle?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7716
    • View Profile
Handy Genes
« Reply #16 on: April 17, 2005, 03:00:35 PM »
I could be wrong but I think it refreshes only when you're hit again.

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Handy Genes
« Reply #17 on: April 18, 2005, 02:54:32 AM »
Could we please fix shflav? It probably wouldn't be anything major just reset the next turn. The checker works but it's kind of annoying to have to use it.

I tried different counter methods, but the bots have trouble knowing when they are about to reproduce. Might be able to check if near repro level and then stop firing.

Endy B)
« Last Edit: April 18, 2005, 02:55:49 AM by Endy »

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Handy Genes
« Reply #18 on: August 24, 2005, 09:56:59 PM »
Alright here's my little counter, only about 99% accurate but much closer than any other method.

'g1
cond
start
971 inc
.delgene inc
stop

'g2
cond
start
971 *971 dup div mult inc
stop

This will in cy1 prime 971 to contine increasing. The bots apparantly can only receive a new number if the location is free of all other numbers. I've thought about adding a sort of hour hand to it for when the values get too high but haven't yet.

Been playing around with racial memory for randomizing basic values for a family line. Stuff like repro levels, turns, and speed are all I've done so far. Kind of hard on the first cy's bots, but after several lines die off, you have all one species of bot with multiple different basic behaviors.

I'd really like to use it for a true Stemcell bot, I think it'd be cool to see them seperate into different species.
« Last Edit: August 24, 2005, 09:59:31 PM by Endy »

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Handy Genes
« Reply #19 on: August 25, 2005, 12:46:31 AM »
Quote
Figured out, while waiting for sgn fix, that the square root function returns zero for anything less than 1.
*.eye1 *.eye2 sub sqr dup div
*.eye1 *.eye3 sub sqr dup div add
*.eye1 *.eye4 sub sqr dup div add
*.eye1 *.eye5 sub sqr dup div add
*.eye1 *.eye6 sub sqr dup div add
*.eye1 *.eye7 sub sqr dup div add
*.eye1 *.eye8 sub sqr dup div add
*.eye1 *.eye9 sub 1 add sqr dup div add 7 sub sqr -140 mult

*.eye2 *.eye1 sub 1 add sqr dup div
*.eye2 *.eye3 sub sqr dup div add
*.eye2 *.eye4 sub sqr dup div add
*.eye2 *.eye5 sub sqr dup div add
*.eye2 *.eye6 sub sqr dup div add
*.eye2 *.eye7 sub sqr dup div add
*.eye2 *.eye8 sub 1 add sqr dup div add
*.eye2 *.eye9 sub 1 add sqr dup div add 7 sub sqr -105 mult

*.eye3 *.eye1 sub 1 add sqr dup div
*.eye3 *.eye2 sub 1 add sqr dup div add
*.eye3 *.eye4 sub sqr dup div add
*.eye3 *.eye5 sub sqr dup div add
*.eye3 *.eye6 sub sqr dup div add
*.eye3 *.eye7 sub 1 add sqr dup div add
*.eye3 *.eye8 sub 1 add sqr dup div add
*.eye3 *.eye9 sub 1 add sqr dup div add 7 sub sqr -70 mult

*.eye4 *.eye1 sub 1 add sqr dup div
*.eye4 *.eye2 sub 1 add sqr dup div add
*.eye4 *.eye3 sub 1 add sqr dup div add
*.eye4 *.eye5 sub sqr dup div add
*.eye4 *.eye6 sub 1 add sqr dup div add
*.eye4 *.eye7 sub 1 add sqr dup div add
*.eye4 *.eye8 sub 1 add sqr dup div add
*.eye4 *.eye9 sub 1 add sqr dup div add 7 sub sqr -35 mult

*.eye5 *.eye1 sub 1 add sqr dup div
*.eye5 *.eye2 sub 1 add sqr dup div add
*.eye5 *.eye3 sub 1 add sqr dup div add
*.eye5 *.eye4 sub 1 add sqr dup div add
*.eye5 *.eye6 sub 1 add sqr dup div add
*.eye5 *.eye7 sub 1 add sqr dup div add
*.eye5 *.eye8 sub 1 add sqr dup div add
*.eye5 *.eye9 sub 1 add sqr dup div add 7 sub sqr -1 mult

*.eye6 *.eye1 sub 1 add sqr dup div
*.eye6 *.eye2 sub 1 add sqr dup div add
*.eye6 *.eye3 sub 1 add sqr dup div add
*.eye6 *.eye4 sub sqr dup div add
*.eye6 *.eye5 sub sqr dup div add
*.eye6 *.eye7 sub 1 add sqr dup div add
*.eye6 *.eye8 sub 1 add sqr dup div add
*.eye6 *.eye9 sub 1 add sqr dup div add 7 sub sqr 35 mult

*.eye7 *.eye1 sub 1 add sqr dup div
*.eye7 *.eye2 sub 1 add sqr dup div add
*.eye7 *.eye3 sub sqr dup div add
*.eye7 *.eye4 sub sqr dup div add
*.eye7 *.eye5 sub sqr dup div add
*.eye7 *.eye6 sub sqr dup div add
*.eye7 *.eye8 sub 1 add sqr dup div add
*.eye7 *.eye9 sub 1 add sqr dup div add 7 sub sqr 70 mult

*.eye8 *.eye1 sub 1 add sqr dup div
*.eye8 *.eye2 sub sqr dup div add
*.eye8 *.eye3 sub sqr dup div add
*.eye8 *.eye4 sub sqr dup div add
*.eye8 *.eye5 sub sqr dup div add
*.eye8 *.eye6 sub sqr dup div add
*.eye8 *.eye7 sub sqr dup div add
*.eye8 *.eye9 sub 1 add sqr dup div add 7 sub sqr 105 mult

*.eye9 *.eye1 sub sqr dup div
*.eye9 *.eye2 sub sqr dup div add
*.eye9 *.eye3 sub sqr dup div add
*.eye9 *.eye4 sub sqr dup div add
*.eye9 *.eye5 sub sqr dup div add
*.eye9 *.eye6 sub sqr dup div add
*.eye9 *.eye7 sub sqr dup div add
*.eye9 *.eye8 sub sqr dup div add 7 sub sqr 140 mult

*.refeye *.myeye sub dup div 200 mult
add add add add add add add add dup
1 add dup div -2 mult 7 add store


yay, math...
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7716
    • View Profile
Handy Genes
« Reply #20 on: August 25, 2005, 08:58:06 AM »
Wow, what the heck is that? :lol:

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
Handy Genes
« Reply #21 on: August 25, 2005, 09:44:28 AM »
:blink:
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Handy Genes
« Reply #22 on: August 25, 2005, 10:58:46 AM »
Well, the refeye line is wrong. Added without thinking. I need to mult it with the eye5 value.


if ((eye1 > eye2) &&
   (eye1 > eye3) &&
   (eye1 > eye4) &&
   (eye1 > eye5) &&
   (eye1 > eye6) &&
   (eye1 > eye7) &&
   (eye1 > eye8) &&
   (eye1 >= eye9))
{
 -140 is put on the stack
}
if (similar thing for eye2..)
{
 the angle you want to turn to if eye2 has the largest value goes onto the stack
}
...[similar things for eyes 3, 4, 6, 7, 8, 9]...
Eye5 (if larger or equal to everything else) puts -1 on the stack instead of a larger number..

add add add add add add add add dup
'adds up all the numbers (8 of which should logically be zeroes. I assumed integer
'values for the eyes - this is wrong if they can be other things)
'and copies the top one

1 add dup div -2 mult 7 add
'this puts a 7 on the stack if the top number on the stack is -1
'and a 5 if it is something else

store
'so we get the result of the giant mess up there stored in either address 5 or address 7..


I never made any bots before.
I just thought the stack abuse was an interesting puzzle ^^
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7716
    • View Profile
Handy Genes
« Reply #23 on: August 25, 2005, 02:35:52 PM »
Write up a bot that tries to use that sometime.  I think it'd be fun.  Of course, I wouldn't want to try and decode it :P

Offline Endy

  • Bot Overlord
  • ****
  • Posts: 852
    • View Profile
Handy Genes
« Reply #24 on: August 25, 2005, 05:55:29 PM »
Wow :blink:

I'm impressed, I never imagined sqr would be used to such an extent.  :pray:

Man, it's going to be scarry out there when you start making bots :D

Agree with about DB's math being interesting, it can be fun(and useful) finding the nooks and crannies of the program.
« Last Edit: August 25, 2005, 11:03:35 PM by Endy »