Author Topic: My First Attempt at a Bot  (Read 3533 times)

Offline Azhtabak

  • Bot Neophyte
  • *
  • Posts: 4
    • View Profile
My First Attempt at a Bot
« on: February 23, 2008, 03:02:14 PM »
This is my first attempt at making a bot, a fairly basic shot-bot. It was helped massively by Purple Youko's tutorial, which I took a few of the genes from (mainly the turning reproduction and the tie-severing - I hope that was ok?), though I couldn't get his multi-bot to work, along with the tutorials from the site - particularly Elite's Bot Tutorial. I don't know if it's ready for league usage - it beat a few of the weaker F2 bots but that's it - but I thought I would post it anyway, to see what people thought of it.

Code: [Select]
' M-Bot 1
' My first bot - hopefully not too bad
' Shot-Bot - Helped _massively_ by Purple Youko's tutorial
##############################################################
cond
*.eye1 0 = and
*.eye2 0 = and
*.eye3 0 = and
*.eye4 0 = and
*.eye5 0 = and
*.eye6 0 = and
*.eye7 0 = and
*.eye8 0 = and
*.eye9 0 =
start
314 .aimdx store
stop

cond
*.eye1 0 != and
*.eye5 0 =
start
-140 .aimdx store
stop

cond
*.eye2 0 != and
*.eye5 0 =
start
-105 .aimdx store
stop

cond
*.eye3 0 != and
*.eye5 0 =
start
-70 .aimdx store
stop

cond
*.eye4 0 != and
*.eye5 0 =
start
-35 .aimdx store
stop

cond
*.eye6 0 != and
*.eye5 0=
start
35 .aimdx store
stop

cond
*.eye7 0 != and
*.eye5 0 =
start
70 .aimdx store
stop

cond
*.eye8 0 != and
*.eye5 0 =
start
105 .aimdx store
stop

cond
*.eye9 0 != and
*.eye5 0 =
start
140 .aimdx store
stop

cond
*.eye5 0 !=
*.refeye *.myeye !=
*.refshoot *.myshoot !=
start
40 *.vel sub 2 div .up store
stop

cond
*.eye5 0 !=
*.refeye *.myeye !=
*.refshoot *.myshoot !=
start
8 .shootval store
-1 .shoot store
stop

cond
*.aimdx 0 !=
*.aimdx 180 !=
start
*.aimdx 10 div .dx store
stop

cond
*.eye5 0 !=
*.refeye *.myeye =
start
628 .aimdx store
stop

cond
*50 0 >
start
628 .aimdx store
50 dec
stop

cond
*.nrg 10000 >
start
50 .repro store
628 .aimdx store
50 inc
stop

cond
*.waste 100 >
start
-4 .shoot store
*.waste .shootval store
stop

cond
*.robage 0 =
start
.tie inc
stop

cond
*.robage 0 !=
start
.deltie inc
stop

cond
*.shflav 0 !=
*.shflav -2 !=
start
1256 *.shang sub .aimshoot store
8 .shootval store
-1 .shoot store
0 .shflav store
stop

end
« Last Edit: May 02, 2014, 02:13:40 PM by Botsareus »

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
My First Attempt at a Bot
« Reply #1 on: February 25, 2008, 04:03:06 PM »
It'd not bad, although it has a lot of stores for aim controll, and the turn values need to be adjusted.
I think maybe you could start out with :

cond
*.eyef 0 =
*.refeye *.myeye =
or
start
*.robage 9 mod 4 sub .focuseye store
stop

cond
*.eyef 0 !=
*.refeye *.myeye !=
start
*.refypos *.refxpos angle .setaim store
0 .focuseye store
stop


This is less effective, and is of more use if you cange the eye(1-9)width and eye(1-9)dir values to cover a wider angle.
You can just "steal" something from the bestiary, I don't think anoyone would mind, either way you're welcome to use the eyes from Pacifist if you want.
You should add some shell and poison too, it's simple to add and does wonders.
And venom can be very usefull aswell. A good comon use is to lock peoples shoot value to -2 (Energy shots).
It's hard to measure your bot against league bots if it doesn't use shell, poison or venom.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
My First Attempt at a Bot
« Reply #2 on: February 25, 2008, 04:25:27 PM »
I almost forgot, I think the and's and or's use "reverse notation" or whatever it's called, so basicaly you would need to move them all down a row.
But you don't need to and anything together unless you need to or several and'ed conditions... what I'm trying to say is that all conditions get and'ed automaticaly.
Damn those sentences ended up making no sence...
Also I remembered, you can't use ties to feed, but you can use them for other things...
You should either start out with :

cond
*.numties 0 >
start
*.tiepres .deltie store
stop

To avoid ties altogether, or you could think of something that would mess people up, but then you also need to take defences into account (While you mess with them, they mess with you).
At some point you should also keep an eye out to see what kinds of venoms or memmory shots the other F2 bots are using to beat yours.
If you want it to compete in F1 you'll need to start worrying about viruses and stuff, I would sugest starting with F2.
And F2 bots can also come a long way in the F1 league, just add some slime.
Theres also lots of neat tricks if you look around the forum, like compensating for physics during turns with : *.velsx .dx store
You can adjust it to overcompensate a litle to stay on track. And using the enemy's *.refvelup to adjust your speed when chasing is also very usefull.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Moderator
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: My First Attempt at a Bot
« Reply #3 on: May 02, 2014, 12:33:52 PM »
Not a short bot because it has more the 6 genes, going into F1.