Pattern & Enemy Dodging Movement
Origins
Pattern Movement is a catch-all name documented by the RoboWiki community for bots that repeat a fixed trajectory. Enemy Dodging Movement, a reactive variant that steers by nearby enemies instead of a fixed shape, was documented by RoboWiki contributor jdev.
A bot that always drives the same square, circle, or oscillation is cheap to write and, against a gun that has never seen it before, surprisingly hard to hit. That cheapness has a short shelf life. Any gun that logs a few seconds of movement and looks for a repeat sees through it immediately.
A shape repeated is a shape guessed
RoboWiki groups several sample bots and nanobots under Pattern Movement because each one commits to a fixed trajectory and never deviates. Corners drives to a corner and stays there. Walls rides the battlefield edges in straight lines, while SpinBot just circles. MyFirstRobot oscillates back and forth, and Infinity and Crazy trace tuned squares and quarter-circle turns instead. Stop and Go and the Musashi Trick count too, since both commit to one repeating rhythm rather than reacting to the match in front of them.
The repetition buys two things. In melee, staying near a known position avoids wandering into a fresh cluster of enemies. Against Linear or Circular Targeting, a fixed shape defeats the assumption that velocity or turn rate stays constant, since both extrapolate from the bot's current motion rather than its history. Neither defense survives a gun that studies the history. Pattern Matching logs recent moves and searches for the same sequence before, then fires at whatever followed it last time, which is exactly the corner Corners always turns.
A bot that repeats the same square every lap gives a pattern matcher the one thing it needs: a repeat.
Enemy Dodging: react instead of repeat
Enemy Dodging Movement drops the fixed shape and scores real points around the bot instead, in the same spirit as Minimum Risk Movement but far simpler. jdev's version samples roughly 18 candidate points around the bot at a fixed radius (a "field of vision" of 50 units, spaced at intervals of radians), counts only enemies inside a 150-unit danger distance, and drops any candidate that falls within 20 units of a battlefield edge. For every surviving candidate it averages the distance to each nearby enemy, then drives to the point with the highest average, the one that sits furthest from danger right now.
candidates = pointsOnCircle(currentPosition, FIELD_OF_VISION, count = 18)
bestPoint = null
bestAvgDist = -infinity
for point in candidates:
if point is within ACTIVITY_MARGIN of a battlefield edge:
continue
nearby = [enemy for enemy in enemies if distance(point, enemy) < DANGER_DISTANCE]
if nearby is empty:
continue
avgDist = average(distance(point, enemy) for enemy in nearby)
if avgDist > bestAvgDist:
bestAvgDist, bestPoint = avgDist, point
moveTo(bestPoint)
Enemy Dodging Movement samples points on a small circle around the bot and drives to the one furthest from nearby enemies.
Name the cost
Pattern Movement's cost is the same repetition that makes it cheap: any gun that remembers more than a few seconds of history reads the pattern and fires at the next repeat. It is a technique for beating simple guns, not a lasting defense.
Enemy Dodging Movement gives up scope for that simplicity. RoboWiki calls it "a clear tactical method" on its own, since it only asks where the nearest enemies are right now, with no notion of battlefield center, ally crowding, or energy, the ingredients a Minimum Risk Movement risk function weighs alongside enemy distance. A bot using it alone can dodge its way into a corner, a wall, or a second enemy it never sampled for, which is why RoboWiki pairs it with a strategic technique rather than running it by itself.
Platform notes
Both techniques depend only on scan history and position math that classic Robocode and Tank Royale both expose. Convert bearings into one consistent angle convention before comparing candidate points or logged moves, since classic Robocode headings are compass-style while Tank Royale headings are mathematical.
Further Reading
- Pattern Movement - RoboWiki (classic Robocode)
- Enemy Dodging Movement - RoboWiki (classic Robocode)
- Minimum Risk Movement - RoboWiki (classic Robocode)
- Physics - Tank Royale documentation