Anti-Surfer Targeting
Origins
Anti-Surfer Targeting grew from the RoboWiki community's effort to improve guns against the wave-surfing movement pioneered by ABC.
A wave surfer does not merely repeat a movement pattern. After detecting a shot, it estimates where that bullet wave is dangerous and steers toward a safer place. A normal statistical gun can end up learning positions caused by its own earlier waves, then politely aiming at the route the surfer has already abandoned.
Anti-surfer targeting is a collection of responses to that feedback loop, not one universal gun. A top surfer remains a hard target, so the goal is a better tested estimate rather than a guaranteed counter.
Which observations deserve trust?
Many statistical guns create virtual waves every turn. Those non-firing waves are useful samples against ordinary movement, but they do not trigger the exact reaction a real energy drop triggers. Against a surfer, give the outcome of an actual shot more influence than an outcome from a virtual wave.
Recent results matter most because a surfer may revise its danger model after being hit. One simple age rule is , where is the base weight for a firing or virtual wave, is sample age in turns, and controls how quickly old evidence fades. Apply this weight when building the GuessFactor density, not by pretending the old result never happened.
A real bullet wave influences a surfer differently from a virtual wave that was never fired.
A practical selection loop
Start with a wave-based gun that records the firing situation and observed GuessFactor. Add the adjustments one at a time, so their effects remain measurable.
when a wave reaches the enemy:
sampleWeight = high if wave fired a bullet else low
record(stateAtFire, observedGuessFactor, sampleWeight, currentTurn)
when aiming:
candidates = recent, similar samples for the current state
score each GuessFactor with weighted density and age decay
aim at the highest-scoring legal angleUsing fewer, more recent nearest neighbors is one possible tuning choice. It reduces stale influence but increases noise. Multiple virtual guns are also useful: let a regular statistical gun, a recency-focused gun, and a pattern matcher compete on real bullet results instead of declaring one strategy the winner before the battle.
A different kind of prediction
Pattern matching does not choose an angle from the same wave statistics that a surfer expects. It replays a matching sequence of heading changes and velocities. That difference often makes it a valuable virtual gun against surfers, though it fails when the enemy deliberately breaks its movement sequence.
Avoid treating every miss as proof that the surfer chose a specific GuessFactor. Walls, overlapping waves, missed scans, and gun timing all change the path. Draw fired waves and selected angles while debugging, then compare guns over many rounds against more than one surfer.
Platform notes
The counterplay depends on shared movement and bullet rules, not on a special platform API. Classic Robocode and Tank Royale both require the gun to preserve the fire-time state and follow bullet travel. Convert bearings consistently at the API boundary, because their angle conventions differ.
Further Reading
- Anti-Surfer Targeting - RoboWiki (classic Robocode)
- Wave Surfing - RoboWiki (classic Robocode)
- Pattern Matching - RoboWiki (classic Robocode)
- Physics - Tank Royale documentation