WhiteFang/WolfBreath
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.
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 the enemy bullet segment's center
- Calculate the bullet power I need to intersect the bullets' 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 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. =)