# BulletDoubling

Robo Home | Changes | Preferences | AllPages

Showing revision 7

#### What is it?

BulletDoubling is a system by which multiple bullets are fired so that they will reach the distance of the enemy robot simultaneously, thereby hopefully increasing the chance to hit, adding to the damage done, or confusing the enemy's movement. -- Greywhind

#### Robots using it:

• An unnamed test bot by Greywhind.

#### How is it done?

As I was thinking about interesting ways to improve a robot, I wondered if I could fire two bullets that would arrive at the same time. After some solving of equations, I came up with:

```hitTime = distance / (20 - 3 * power) + currentTime
```
to estimate a bullet's hit time (in time since the beginning of the round), and:
```power = (20 - (distance / hitTime - currentTime)) / 3
```
to calculate the power required for any bullet to arrive at a certain point in time.

To use this in a robot, one must set up a system where each bullet fired is tested to see if it can catch up to the previous bullet by the time it would reach the enemy robot - then if it can, it should be fired at the correct power to do so, otherwise it should be fired as a power 3 bullet. My code is the following, where trackingFire is equal to either -1 or the round on which the previous bullet should hit:

```if (trackingFire != -1) {
if (getGunHeat() <= .1 && getEnergy() >= .1) {
// figure out power here.
double power = (20 - Math.abs(eDist) / (trackingFire - getTime())) / 3;
if (power < .1 || power > 3) {
trackingFire = -1;
} else {
setFireBullet(power);
}
}
}

if (getTime() > trackingFire) {
trackingFire = -1;
}

if (trackingFire == -1) {
if (getGunHeat() <= .1 && getEnergy() >= .1) {
double power = Math.min(3, eEnergy/4);
setFireBullet(power);
// figure out time until hit.
trackingFire = (int)(Math.abs(eDist) / (20 - 3 * power) + getTime());
}
}
```

This code requires a separate system of aiming the gun - it only fires bullets. It also needs a separate method to keep track of enemy's energy, distance, etc. and store them in the correct variables.

Also note that this firing will fire power 3 bullets exclusively (just as if this method didn't exist) when the enemy is too close to hit with two bullets at the same time. -- Greywhind

This method is currently in use in a bot of mine that doesn't move and only fires head on, similar to WSCBotA essentially. When I fought it against CassiusClay 1.9996bdTC and compared its score to WSCBotA, it got 567 bullet damage instead of 79. I'd say that's an improvement... probably even more so in an advanced targeting system using it to fire at the top two likely enemy locations simultaneously. -- Greywhind

An interesting idea, especially if you can get the second bullet 1 tick earlier in place. The more simpler WaveSurfers would then ignore the full power bullet. Wolverine has this behaviour only in its VictoryDance where it shoots three bullets that will hit a disabled target at the same time. My CT-gun does bulletpower adaption to try to intercept the enemy near walls. Just watch GrubbmGrb against Walls and you see the same behaviour although with another intention. It is certainly something to investigate. -- GrubbmGait

It has actually been done before, though I don't have a link for it handy. I see if I can find it (where you may get some more ideas). -- Martin Gah.. can't find the topic it was in. Maybe someone else rememebers.. -- Martin

This sounds a bit like ChaseBullets. -- PEZ

It is like ChaseBullets, I see - hadn't seen that page. But it could be a more useful technique combined with, say, GF targeting firing at two likely enemy locations... If you'd like, move this to that page. Too bad - I thought I had something a bit original for once. -- Greywhind

It is very hard to do something original that is also competitive. Sometimes you can pick up an already existing idea and refine it until it actually pays off. Most of the time you will be just busy with your own implementation of the mainstream ideas. But it is still fun! -- GrubbmGait

Robo Home | Changes | Preferences | AllPages
Edit revision 7 of this page | View other revisions | View current revision
Edited February 18, 2006 22:02 EST by GrubbmGait (diff)
Search: