Darwinbots Forum

Bots and Simulations => Bestiary => F2 bots => Topic started by: Peksa on May 08, 2008, 05:48:46 PM

Title: This'n'That 1.01 (F2) (Peksa) - 12.05.08
Post by: Peksa on May 08, 2008, 05:48:46 PM
New news:
This changed so little that it doesn't deserve a new thread. I'm planning on updating this bot if need be, but I'll try to keep it a basic bot that's easy to read.

Old news:
This beats both old leagues and some of the newer bots. It uses default eye settings and uses no "tricks" to win. Just a well written basic bot.

I just realized, it's also my first submitted bot. Yay!

Code: [Select]
'This'n'That 1.01 (F2) (Peksa) 12.09.08
'By Peksa
'Designed for 2.43.1k
'This'n'That does little, but does it quite well. It's a very simple bot that has nothing fancy in it.
'Conspec recognition idea is from Aura by abyaly, otherwise DNA should be as original as a bot of this kind can be.
'A very slight modification, fares better against venom-using bots.


def friend 81
def shottype 82

start

'Cautions
 *.delgene 0 !=
 *.genes 1 = and
  0 .delgene store
 
 *.thisgene 1 !=
  *.thisgene 1 sub .delgene store
 *.thisgene *.genes !=
  *.thisgene 1 add .delgene store
 
 *.sexrepro 0 !=
 *.fertilized 0 != or
  0 .sexrepro store
  
 *.fixed 0 !=
  0 .fixpos store
  
 *.focuseye 0 !=
  0 .focuseye store
  
 *.backshot 0 !=
  0 .backshot store

'Ties
 *.robage 0 =
  .tie inc

 *.robage 1 =
  .deltie inc
  
 *.numties 0 >
  *.tiepres .deltie store
  
'Conspec recognition
 true
  *.dnalen *.robage *.dnalen mod sub dup .out7 store .tieval store
  
 *.in7 *.refage *.dnalen mod add *.dnalen sub abs 10 <
  1 .friend store

 not
 *.eye5 0 = or
  0 .friend store

'Waste
 *.waste 1000 >
 *.waste .shootval store
  -4 .shoot store
 
'Targeting and shooting
 true
  11 rnd .shottype store

 *.eye5 0 >
 *.friend 1 != and dupbool dupbool dupbool
  *.refxpos *.refypos angle .setaim store
  *.refxpos *.refypos dist 10 div 50 sub 50 ceil 0 floor .refvelup add .up store
  *.refveldx .dx store
  -16 .shootval store
 *.refpoison 0 >
 *.refshell 0 = or and
  -6 .shoot store dropbool
 *.refpoison 0 = and
 *.refshell 0 > and
  -1 .shoot store dropbool
 *.shottype 3 <= and
 *.refeye 0 > and
  *.venom .shootval store
  -3 .shoot store dropbool

 *.eye5 50 >
 *.friend 1 != and
  *.refvelup .up store
 *.shootval *.venom != and
  32 .shootval store
  
 *.eye5 0 =
 *.friend 1 = or
 *.shflav 0 =
 *.shflav -2 = or and
  *.aim 418 rnd add .setaim store
 4 rnd 1  = and
  *.maxvel .dn store
  
 *.eye5 0 =
 *.friend 1 = or
 *.shflav 0 != and
 *.shflav -2 != and
  *.aim *.shang sub .setaim store
  16 .shootval store
  -6 .shoot store
  0 .shflav store
  
 *.paralyzed 0 != or
  0 .shootval store

 *.eye1 *.eye9 !=
 *.eye5 0 = and
  140 *.eye1 *.eye9 sub sgn mult *.aim add .setaim store
  
 *.eye2 *.eye8 !=
 *.eye5 0 = and
  105 *.eye2 *.eye8 sub sgn mult *.aim add .setaim store
 
 *.eye3 *.eye7 !=
 *.eye5 0 = and
  75 *.eye3 *.eye7 sub sgn mult *.aim add .setaim store
  
 *.eye4 *.eye6 !=
 *.eye5 0 = and
  30 *.eye4 *.eye6 sub sgn mult *.aim add .setaim store
 
'Body/nrg management
 *.nrg *.body !%= dupbool
 *.nrg *.body > and
  *.nrg *.body sub 100 ceil .strbody store dropbool
 *.body *.nrg > and
  *.body *.nrg sub 100 ceil .fdbody store

'Repro
 *.body 1000 >
 *.nrg 1000 > and
 *.totalbots 2 div 15 floor 30 ceil *.totalmyspecies < and
 *.eye5 0 = and
  50 .repro store
  
 *.body 500 >
 *.nrg 500 > and
 *.totalbots 2 div 15 floor 30 ceil *.totalmyspecies >= and
 *.eye5 0 = and
  50 .repro store
  
'Defences
 *.ploc .shoot !=
  .shoot .ploc store
 
 *.vloc .shoot !=
  .shoot .vloc store
  
 *.venval -2 !=
  -2 .venval store
  
 *.nrg 150 > dupbool dupbool
 *.poison 1000 < and
  50 .strpoison store dropbool
  
 *.shell 500 < and
  75 .mkshell store dropbool
    
 *.venom 15 < and
  15 *.venom sub 0 floor .strvenom store

stop
end
Title: This'n'That 1.01 (F2) (Peksa) - 12.05.08
Post by: goffrie on May 08, 2008, 06:43:11 PM
You don't need the "cond" if you have no conditions (in newer versions of DB anyways.)

Also, instead of "1 1 =" you could use "true", or "clearbool". An empty boolean stack will always evaluate to "true".

You did use one trick - birth tie severing  

Code: [Select]
*.in7 *.refage *.dnalen mod add *.dnalen sub abs 10 < dupbool
    1 .friend store dropbool
  
   not
   *.eye5 0 = or
    0 .friend store
could be replaced with
Code: [Select]
*.in7 *.refage *.dnalen mod add *.dnalen sub abs 10 <
    1 .friend store
   not
   *.eye5 0 = or
    0 .friend store
Conditions aren't modified unless explicitly done so by "and", "or", "not", "dropbool" etc.

Anyways, nice bot
Title: This'n'That 1.01 (F2) (Peksa) - 12.05.08
Post by: bacillus on May 09, 2008, 02:24:32 AM
Once again, if you want to start a new set of conditions, you have to clear the boolean stack first with clearbool.
Title: This'n'That 1.01 (F2) (Peksa) - 12.05.08
Post by: Peksa on May 09, 2008, 03:24:22 AM
Quote from: goffrie
Anyways, nice bot
Thanks! I did notice the conspec DNA thing after posting, but it doesn't affect the performance of bot, so I didn't feel overwhelmed by it  Thanks for the other bits as well. They don't affect behaviour, but make DNA just a little bit nicer to read.

Quote from: bacillus
Once again, if you want to start a new set of conditions, you have to clear the boolean stack first with clearbool.

Actually you don't, as Numsigil explained in the other topic (http://www.darwinbots.com/Forum/index.php?s=&showtopic=2742&view=findpost&p=1376389).
Title: This'n'That 1.01 (F2) (Peksa) - 12.05.08
Post by: bacillus on May 09, 2008, 03:34:46 AM
Yea, I know. I remember posting this about ten seconds before reading his post, then forgot where I posted.
Title: This'n'That 1.01 (F2) (Peksa) - 12.05.08
Post by: Peksa on May 12, 2008, 04:39:00 PM
Bump!