Head-On Targeting

From RoboWiki
Revision as of 01:46, 29 October 2013 by BeastBots101 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Youtube
Youtube has a video of Head-On Targeting in action: click here to watch

The simple strategy of aiming where you last saw the enemy. Works surprisingly well against surprisingly many bots (Mainly against Oscillator Movement and sometimes random movement). It also works especially well in Melee battles. HawkOnFire and Shiz both use it.

Examples

In onScannedRobot, add:

double absoluteBearing = getHeadingRadians() + e.getBearingRadians();
setTurnGunRightRadians(
    robocode.util.Utils.normalRelativeAngle(absoluteBearing - 
        getGunHeadingRadians()));

A code like this was found in sample.Fire.

double turnGunAmt = (getHeadingRadians() + e.getBearingRadians()) - getGunHeadingRadians();
//You can make this setTurnGunRight(...) or setTurnGunRightRadians(...) with an AdvancedRobot
turnGunRight(turnGunAmt);

See also

v  d  e 

Targeting

Quick
Statistical
Log-Based
Heuristics
Hybrid
Firing Angle
Energy
Terms
Related
See Also: Category:Targeting
Personal tools