Author Topic: 6 genes for improved hunting  (Read 3587 times)

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
6 genes for improved hunting
« on: January 25, 2008, 04:29:57 PM »
Here are a few simple solutions I've tried since the first versions of LF that helped hunting down tiny mobile bots like stickerbush and Shrinking Violet.

1. The paralizing venom shot

This strategy is so old that the sysvar to check if your bot has been hit by venom is '.paralized', but yet it's quite underrated. The idea is to paralize the veggie then feed from it. You need to paralize it when it runs away, so you shoot it with venom when it's at far range. You need the venom to last several cycles by storing an high value into .shootval. You shouldn't abuse shootval, tho, because it wastes energy.

Code: [Select]
*.refeye *.myeye !=
.eye5 10 > and
.eye5 50 < and
.fixpos .vloc store
1 .venval store
*.nrg 10 div 100 ceil .shootval store
-3 .shoot store

2. The confusion shot

Runaway bots are harder to get in range if they don't use wide eyes, since wide eyes have shorter range and they may not notice your bot even at shooting distance. So, since you are using venom anyway, you can force the bot to look away:

Code: [Select]
*.refaim *.aim sub abs 600 %=
*.refeye *.myeye != and
*.aim .venval store
.setaim .vloc store
*.nrg 10 div 100 ceil .shootval store
-3 .shoot store

3. The paralyzing tie

If you can tie the bot, which isn't so common in IM but anyway... you can paralyze it too through the tie. This isn't extremely accurate, but may work:

Code: [Select]
*.trefdn abs 20 >
*.refvel 20 > or
.fixpos .tieloc store
1 .tieval store

Place it where it overrides any tie feeding.

4. The path-cutting chaser

You'll find often that the classic x/y 'dumb' aiming is fooled by bots that turn as they flee. So you need to go not where the bot is, but where it will be:

Code: [Select]
*.refxpos *.refypos angle *.refveldx 2 mult sub .setaim store
I think this simple solution works quite well out of the box, but you may want to tweak the 2 mult constant, find a proper eye5 width and check that your bot isn't fooled by bots that can flee without looking thru eye5.

5. The leading shot

Same as above, but for your shots:

Code: [Select]
*.refveldx 3 mult .aimshoot store
But ask EricL if .aimshoot accepts negative numbers.  

6. The food spot recall

Bots tend to be generally dumb, we gotta face it. They like to wander away when they are still surrounded of yummy food, specially that of the peaceful and static kind. So making them recall where they feed the last time can help a lot. This is a bit more complex, but basically what I did is:

Code: [Select]
def xfood 51
def yfood 52
def recalls 53

*.pleas 500 >
*.xpos .xfood store
*.ypos .yfood store
-2 .recalls store

Note that you'll get positive .pleas when you are doing .fdbody, so to be sure the event was feeding and not body management you should use an higher value.

Then:

Code: [Select]
*.eye5 0 =
(add here periferic eyes check for clear if you want)
*.recalls abs 25 mult rnd 0 = and
*.xfood *.yfood angle .setaim store
*.recalls inc

You start with a negative value in recalls to avoid recalling when it's still feeding -you may use a counter instead. The bot will keep coming back to the feeding point, but slowly forgetting it so each time it wanders further away.
« Last Edit: January 25, 2008, 05:26:11 PM by MacadamiaNuts »
Sometimes you win, and sometimes you lose...

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
6 genes for improved hunting
« Reply #1 on: January 25, 2008, 06:58:10 PM »
Quote from: MacadamiaNuts
But ask EricL if .aimshoot accepts negative numbers.

It does.
Many beers....

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
6 genes for improved hunting
« Reply #2 on: January 28, 2008, 11:00:56 AM »
Meh. It turns out that the path crossing gene above wasn't too good. I'm using a rudimentary steering control instead mixing .veldx with the nine eyes turning.
Sometimes you win, and sometimes you lose...