Author Topic: Thermite a 1G bot non conditional  (Read 2936 times)

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Thermite a 1G bot non conditional
« on: November 05, 2008, 10:10:32 PM »
'by PeterB
' A simple bot capeable of aiming at a target (just a bit, but thats enough)
' Able to reproduce for a regular stable growing population
' Builds up a shell and using slime and removes any tie's
' It does do good between algey, or simple enemies, as its a simple enemy itself
' It was a study for simple bot eyes with not to complex math.



cond



start

' dont get distracted to much if we have something in sight
' by limiting som eyes to not react if eye5 has visual contact.
'z = (eyex-eyex div)
'
'Z - eye5    sgn    -1  sgn  +1
'0 -   0        0     -1    -1     0
'1 -   0        1      0     0      1
'1 - 30       -1     -2    -1     0
'0 - 30       -1     -2    -1     0

*.eye1 *.eye1 div *.eye5 sub sgn 1 sub sgn 1 add 9 mult .aimsx store
*.eye2 *.eye2 div *.eye5 sub sgn 1 sub sgn 1 add 9 mult .aimsx store
*.eye3 *.eye3 div 54 mult .aimsx store
*.eye4 *.eye4 div 54 mult .aimsx store
*.eye6 *.eye6 div 54 mult .aimdx store
*.eye7 *.eye7 div 54 mult .aimdx store
*.eye8 *.eye8 div *.eye5 sub sgn 1 sub sgn 1 add 9 mult .aimdx store
*.eye9 *.eye9 div *.eye5 sub sgn 1 sub sgn 1 add 9 mult .aimdx store


*.eye5 -8 div 10 add .up store

*.eye3 *.eye3 div 1 mult .dx store
*.eye4 *.eye4 div 1 mult .dx store

'brakes when something is insight
*.eye5 *.eye5 div 10 mult .dn store

'shoot (it does shoot a bit early, oh well it still survives..)
*.eye5 *.eye5 div -1 mult .shoot store
*.eye5 *.eye5 div -6 mult .shoot store


*.robage sgn 1 sub sgn -30 sum .dn store
*.robage sgn 1 sub sgn -30 sum .aimsx store

*.nrg 25000 sub sgn 1 add sgn 85 mult .repro store
*.nrg 25000 sub sgn 1 add sgn 385 mult .aimsx store

*.nrg 100 mod sgn 1 sub sgn -2 mult .mkshell store
*.nrg 100 mod sgn 1 sub sgn -5 mult .mkslime store
*.nrg 200 mod sgn 1 sub sgn -50 mult .strbody store

*.numties .deltie store

stop

Offline d-EVO

  • Bot Destroyer
  • ***
  • Posts: 125
    • View Profile
Thermite a 1G bot non conditional
« Reply #1 on: November 17, 2008, 11:29:01 AM »
were you wrote *.eyex *.eyex div, you could just write *.eyex sgn
so Z = *.eyex sgn  
will make you bot shorter /more subseptable to evo if changed
« Last Edit: November 17, 2008, 11:30:33 AM by d-EVO »
1:      2 is true
2:      1 is false

Offline peterb

  • Bot Destroyer
  • ***
  • Posts: 148
    • View Profile
Thermite a 1G bot non conditional
« Reply #2 on: November 17, 2008, 02:16:51 PM »
Quote from: d-EVO
were you wrote *.eyex *.eyex div, you could just write *.eyex sgn
so Z = *.eyex sgn  
will make you bot shorter /more subseptable to evo if changed

your right is was my first 1 gene bot currrently I'm trying to create more advanced behaviour.
And manged to convert lots of function into non COND math for a bot, let me show for those intrested

The nice thing about this bot it finds algey good, and can be a little activist or a big berta, it does do well under low algey conditions
I'm still optimizing it   ....


[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']'by PeterB
'
' so far a nice bot improved reproduction scheme
'  -will not stop eating to give birth unless nrg is enough for multiple births
'  -while not eating if nrg mod 200 repro
' Improved eyes
' improved turn away from friend.
'
'
' basic commands added for more complex math in 1 gene :



def e5x 50
def e5o 51
def efox 52
def efxo 53
def ekill 54
def eage 55
def emove 56
def epowerfull 57
def epoor 58
def escan 59
def edefend 60
def etarget 61
def ebrot 62
def epowerX 63
def epowerO 64
def etemp 65
def eunlikely 66
cond

start

' math                       val               explain
'
'*.eye5 0 =               >> 1  (for multiply) e5o
'*.eye5 0 >               >> 1  (for multiply) e5x
'*.myeye *.refeye =       >> 0/1 (for multiply) efox  0 for friends 1 for enemies.
'                         >> 1/0 (for multiply) efxo  1 for friends 0 for enemies
'*.eye5 40 >              >> 1  (for multiply) ekill
'*.eye5 70 <              >> 1        ,,       emove
'*.refage *.myage =>      >> 1                 eage
'*.nrg 1500 mod 1480 >    >> 1                 epowerfull
'*.nrg 20 <               >> 0                 epoor  0 poor 1 lot of energy
'  when poor rot 20       >>                   escan 30 poor 0 lot of energy
' shell+poison+mass <2000 >> 1                 edefend
'               ebrot                          eBrot   for rotation calculation
'        energy  60 >        1                 epowerX
'        energy <60          30                epowerO  'could be used for rotations.
' 20 rnd > 18                1/0               eunlikely is 1 when a random number > 18


'basic defenses
2 .delgene store
.fixpos *.fixed mult dec
*.tiepres sgn .tieval .tieloc store
50 .tieval store
*.numties .deltie store


*.eye5 sgn 1 .e5x store
*.eye5 sgn 1 sub abs .e5o store
*.refeye *.myeye sub abs sgn .efox store
*.efox 1 sub abs .efxo store
*.eye5 40 sub sgn 1 sub sgn 1 add .ekill store
*.eye5 70 sub sgn 1 sub sgn abs .emove store
*.nrg 20 sub sgn 1 sub sgn abs .poor store
*.nrg 1500 mod 1480 sub sgn 1 add sgn .epowerfull store
*.nrg 15 sub sgn 1 sub sgn 1 add .epoor store
1 *.epoor sub 20 .escan store
*.shell *.poison add *.mass add 2000 sub sgn -sub abs sgn .edefend store
*.refxpos *.refypos angle *.setaim *.aim sub .etarget store
*.nrg 10 sub sgn 1 sub sgn 1 add .epowerX store
*.nrg 10 sub sgn 1 sub sgn -30 mult .epowerO store

100 rnd 98 sub sgn 1 sub sgn 1 add .eunlikely store
'   15    -3   -1   -2  -1     0
'   18     0    0   -1  -1     0
'   19     1    1    0   0     1

'random turn move (change of it to hapen 1/20) when seeing famliy
2 rnd *.efxo mult 314 mult *.eunlikely mult .aimdx store
'4 rnd *.efxo mult 314 mult .aimdx store
'5 rnd *.efxo mult 251 mult .aimdx store
'3 rnd *.efxo mult 418 mult *.eage mult .aimdx store

'eunlikely = 1   at 1/20 else its zero
*.eunlikely -5 mult .etemp store


*.ekill *.efox mult *.etarget mult *.aim add .aim store
*.ekill *.efox mult -1 mult *.etemp add .shoot store
'*.ekill *.efox mult -6 mult .shoot store


*.epowerX *.emove mult 50 mult .up store
*.epowerX *.e5x mult *.efox mult *.refvelup mult *.up add .up store


'*.nrg 37 mod sgn 1 sub sgn -13 mult *.epowerX mult .strbody store
*.nrg 47 mod sgn 1 sub sgn -120 mult *.shell sub sgn 1 add 17 mult *.epowerX mult .mkshell store
*.nrg 31 mod sgn 1 sub sgn -200 mult *.poison sub sgn 1 add 13 mult *.epowerX mult .strpoison store


'*.nrg 61 mod sgn 1 sub sgn -11 mult *.slime sub sgn 1 add 13 mult *.epowerX mult .mkslime store
'*.nrg 29 mod sgn 1 sub sgn -50 mult *.slime sub sgn 1 add 13 mult *.epowerX mult .mkslime store
'                     less then 50                   add 10
'                           -50 mult *.body sub sgn 1 add 10 mult
'                        
' 12      1  1   0      0      0    40  -40   -1   0    0
'                                   80  -80   -1   0    0
'     11  0  0  -1     -1     50    40   10    0   1   10
'                                   80  -30   -1   0    0


'*.waste 1 add 10 mod sgn 1 sub sgn -4 mult .shoot store
'*.waste 1 add 20 mod sgn 1 sub sgn *.waste mult .shootval store



*.epowerfull 5 mult .repro store
*.nrg 200 1 add mod sgn 1 sub sgn *.e5o mult -80 mult *.epowerX mult .repro store



'-10 .eye1dir store
'*.eye1dir -1 mult .eye9dir store
'-34    .eye1width store
'-34    .eye9width store


10 .eye2dir store
*.eye2dir -1 mult .eye8dir store
-20    .eye2width store
-20    .eye8width store


*.ekill *.efox mult 1 sub abs .etemp store
0 .ebrot store
*.eye9 *.eye8 add *.eye7 floor 2 mult *.eye6 floor .ebrot store
*.eye1 *.eye2 add *.eye3 floor 2 mult *.eye4 floor *.ebrot sub *.etemp mult .aimsx store


*.efox  1 sub abs *.erot .aimdx store
' o 0  -1      1
' x 1   0      0

'rotate when low on energy
'*.escan *.aimdx add .aimdx store


'*.efxo -70 mult *.up add .up store
'*.efxo -*.eage mult *.aimdx add .aimdx store

'*.e5o *.efxo mult 100 mult *.aimdx add .aimdx store

4 rnd *.efxo mult 314 mult .aimdx store

stop