WhiteFang/WolfBreath

From Robowiki
< WhiteFang
Revision as of 13:42, 29 January 2018 by Dsekercioglu (talk | contribs) (Created page with "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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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.

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 enemy bullet segment center
    2. Calculate the bullet power I need to intersect the bullets from the 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 good to be absolutely sure.

Credits

No code but 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 inspired me to write some bullet shielding algorithm.

Additionally

If you see any grammar or logic mistakes please fix it. =)