WhiteFang/WolfBreath

From RoboWiki
Jump to: navigation, search

WolfBreath is WhiteFang's Bullet Shielding. It is a very simple and an original way of shielding bullets. It requires simple trigonometry and it is a mini bot with a margin by itself. With some strategy added, you can take some top bots down easily. If you want real world example, just look at WhiteFang's score against Hydra.

Contents

Steps

Scanned RobotEvent
  1. If enemy has fired then:
    1. For each of the 50 points which have been distributed equally over a range of -0.25 to 0.25 from the robot not including zero
      1. Calculate position to fire
      2. Call getFireAngleAndPower
    2. Find the FiringSolution with the lowest fire power
    3. Turn the gun
    4. Move!
    5. Wait one tick
    6. Fire
    7. Return to the old position
  2. If not then:
    1. Turn perpendicular to the enemy to have the maximum angular move.


getFiringAngleAndPower
  1. For every possible bullet float time
    1. Calculate the enemy bullet segment's center
    2. Calculate the bullet power I need to intersect the bullets' center
    3. If my bullet power is valid then:
      1. If my bullet power is lower then enemy's then:
        1. Return fireAngle and firePower
      2. Else then:
        1. Return fireAngle and enemyFirePower

What's Next?

Use the time to turn the gun. I am pretty sure that it always fires at the correct spot since it fires nearly head-on but it is better to be absolutely sure.
Use virtual bullets to detect different type of aiming systems.

Credits

The code is completely mine but I want to thank Skotty's XanderCat and Spitfire , Rsalesc's Roborio, Skilgannon's EnergyDome and DrussGT, Xor's ShieldBot, Rsim's BulletCatcher and uCatcher, Synapse and Rsim's GeomancyBS since I couldn't even think of Bullet Shielding without them.

Additionally

If you see any grammatical or logical mistakes please fix it. =)
Personal tools