Skip to content

Minimum Risk Movement ​

Origins

Minimum Risk Movement was pioneered by Aelryen and ABC as a more flexible alternative to Anti-Gravity Movement for melee combat, and refined by the RoboWiki community.

Anti-gravity sums a force from every enemy, wall, and teammate, then moves wherever that single vector points. The sum is cheap to compute, but it can only express ideas that behave like a force, so a bot's real goal, staying alive, gets bent into a shape it does not naturally fit. The sum can also settle into a spot that balances forces neatly without being genuinely safe, RoboWiki's "happy" local minimum.

Minimum Risk Movement skips the force sum. It proposes several real destinations, scores each one directly against whatever a good melee spot actually needs, then moves to the lowest-scoring point.

Two functions instead of one sum ​

The technique splits into a point-generating function, which proposes candidate destinations, and a risk function, which rates each one. RoboWiki calls the result more versatile than anti-gravity and less likely to converge on a local minimum, though some bot authors treat the two techniques as different framings of the same idea. Their implementations diverge enough in practice that the distinction is worth keeping.

Because a risk score is just a number a function returns, it can combine anything worth caring about, not only inverse-square forces. Point generators vary by bot: HawkOnFire tests angular offsets at random distances, Tron checks four cardinal points at a uniform distance, and FloodHT recursively subdivides the battlefield into rectangles and tests their centers.

A risk function scores several candidate destinations at once. The bot moves to the lowest-risk one.
A risk function scores several candidate destinations at once. The bot moves to the lowest-risk one.

What a risk score usually weighs ​

RoboWiki describes risk functions built from the same ingredients as an anti-gravity force, evaluated at a point instead of summed as a force: each enemy's energy and distance, how close the point sits to the nearest other bot, how close it sits to the battlefield center, and how far the bot must travel to reach it. Most also weigh the lateral angle to each enemy, since moving perpendicular to an enemy's gun is safer than closing in or backing straight away.

txt
candidates = pointGenerator(currentPosition)
bestPoint = null
bestRisk = infinity
for point in candidates:
    risk = 0
    for enemy in enemies:
        risk += enemyRisk(point, enemy)          // energy, distance, lateral angle
    risk += crowdingRisk(point, allBots)          // distance to the closest other bot
    risk += centerRisk(point, battlefieldCenter)  // central ground is exposed from every side
    risk += travelRisk(currentPosition, point)    // turns spent getting there are turns not spent evading
    if risk < bestRisk:
        bestRisk, bestPoint = risk, point
moveTo(bestPoint)

The exact weights are a tuning problem, not a fixed formula. RoboWiki does not publish a canonical set of coefficients, so treat this shape as a starting structure and test any weights against real opponents.

Name the cost ​

Anti-gravity's force sum costs one pass over every entity, however many candidates a bot considers. Minimum Risk Movement costs a risk evaluation for every candidate, so more candidates buy a better search of the surrounding space at a direct CPU price. A bot that only samples a handful of points each turn can also miss a genuinely good destination that none of those points happened to land near. The search is only as good as the points it generates.

Platform notes ​

The technique depends only on scan data, energy readings, and position math that classic Robocode and Tank Royale both provide. Convert bearings into one consistent internal angle convention before scoring candidates, since classic Robocode headings are compass-style while Tank Royale headings are mathematical.

Further Reading ​

Based on RoboWiki content (CC BY-SA 3.0) for classic Robocode and the official Robocode Tank Royale documentation.