Difference between revisions of "WhiteFang/WolfBreath"

From Robowiki
Jump to navigation Jump to search
(Better explanation and fixed grammatical errors)
 
Line 20: Line 20:
 
;getFiringAngleAndPower
 
;getFiringAngleAndPower
 
# For every possible bullet float time
 
# For every possible bullet float time
## Calculate enemy bullet segment center
+
## Calculate the enemy bullet segment's center
## Calculate the bullet power I need to intersect the bullets from the center
+
## Calculate the bullet power I need to intersect the bullets' center
 
## If my bullet power is valid then:
 
## If my bullet power is valid then:
 
### If my bullet power is lower then enemy's then:
 
### If my bullet power is lower then enemy's then:
Line 29: Line 29:
  
 
==What's Next?==
 
==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.
+
: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.
 
:Use virtual bullets to detect different type of aiming systems.
  
 
==Credits==
 
==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.
+
: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==
 
==Additionally==
:If you see any grammar or logic mistakes please fix it. =)
+
:If you see any grammatical or logical mistakes please fix it. =)

Latest revision as of 19:05, 2 July 2018

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 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. =)