WhiteFang/WolfBreath
< WhiteFang
Jump to navigation
Jump to search
Revision as of 12: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...")
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
- If enemy has fired then:
- 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
- Calculate position to fire
- Call getFireAngleAndPower
- Find the FiringSolution with the lowest fire power
- Turn the gun
- Move!
- Wait one tick
- Fire
- Return to the old position
- 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
- If not then:
- Turn perpendicular to the enemy to have the maximum angular move.
- getFiringAngleAndPower
- For every possible bullet float time
- Calculate enemy bullet segment center
- Calculate the bullet power I need to intersect the bullets from the center
- If my bullet power is valid then:
- If my bullet power is lower then enemy's then:
- Return fireAngle and firePower
- Else then:
- Return fireAngle and enemyFirePower
- If my bullet power is lower then enemy's then:
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. =)