Skip to content

Instantly share code, notes, and snippets.

@DavidGinzberg
Created February 14, 2017 16:40
Show Gist options
  • Save DavidGinzberg/021b93e8e430d6f9651d0ccffbe956b2 to your computer and use it in GitHub Desktop.
Save DavidGinzberg/021b93e8e430d6f9651d0ccffbe956b2 to your computer and use it in GitHub Desktop.
A collection of challenges for developing clever little bots in Robocode.

#Challenges to make robocode more interesting

Formations

Pack:
Build team bots that stay in formation around a common target, eg: If a squad of three bots acquires a target, they should surround it and hold in an equilateral triangle with the target in the center. Extra challenge: account for walls if that makes a formation impossible and adjust accordingly (tighten formation or pin/corner the target)

Swarm:
Bots must move in an infinite loop pattern, avoiding collisions with each other, and adjusting slightly to avoid incoming fire while continuing to maintain the formation/avoiding disrupting other bots. Examples include figure 8, circular helix, and other complex geometric patterns. more examples can be found in this video

Follow the Leader:
With one bot designated as the leader, any moves it performs should be imitated by follower bots (between 1 and 5 follow bots). This is not just moving toward the leader constantly, which results in cutting corners, but precisely matching behavior. follow bots should avoid incoming fire and move back into formation when it is safe.

Geometric: A swarm of bots should be able to form any shape, evenly spacing out the bots within the body of the shape. Create a swarm that moves through several basic geometric shapes such as squares, circles, vertical and horizontal rectangles, triangles and wedges. Transformation from one shape to another should be smooth and bots should maintain distancing where possible.

Combat

Radar Check:
While fighting one bot, keep track of one other "far away" bot with radar, predicting how far in any direction that bot may have moved since the last check and evading/changing target if it gets too close (closer than the current target). Do not allow 2 bots to corner you.

Cover fire:
Two or more bots should coordinate to focus on and attack a single target. While the target is engaged at least one bot should sweep the battlefield for other combatants and send low-power volleys at aggressors to keep them away/busy until the squad can eliminate its target and select a new one.

VIP:
A squad of 3 or more bots should designate a VIP, and non-VIP bots should move to intercept incoming fire and protect the VIP at all costs, including attacking and ramming incoming threats. Non-VIP bots should disengage from a threat if it moves far enough away from the VIP that pursuit would be detrimental to protecting the VIP

Bullet hell:
Go watch these videos (more to come). Do that. Use as many bots as you need.

Rodeo Clown:
Select a bot that is under attack. Run between that bot and one of its attackers ("the bull") to try and draw the attacker's attention. Do this multiple times and flag the bull with radar or near-misses if you have to (but only after multiple failed run-by attempts).

Movement

Single Bot movement drills

Serpentine:
Approach and retreat from a single point (and eventually a target) in a serpentine fashion. Speed and path width should vary during the approach/retreat to make your bot harder to target accurately. Adjust to avoid incoming fire.

Strafe:
Pick a target and move in circles around it. When it approaches move in a perpendicular direction to its path to maintain distance/avoid incoming fire. When it retreats keep pace at a diagonal from it's path (30-60º).

Cover:
Select a target and identify cover (a friendly bot, an enemy bot with no ammo, an obstacle --if present) and get behind it. Keep your cover between your bot and the target.

Precision

Parking:
Get as close as you can to an enemy bot without ramming it. Follow at that distance.

Knife throwing:
Identify all friendly and enemy bots on the field. Fire a shot to either side of each bot without hitting any of them. Be aware of shots that will miss the target but hit another bot behind it. Get your shot grouping as tight as you can. Now do this with moving targets.

Headshot:
Pick a target that is moving in a straight line. Hit it. With one shot. While moving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment