CSci 3501 Algorithms and Computability - Lab 10.

November 11th. The robots are due Monday, Nov. 24th at 11:59pm for the first competition on Tuesday, November 25th.

What to submit and when:

The Robot Algorithm Competition

Work in pairs

The RoboGame was first designed by a student/TA, Seth Sweep, in Professor Rob Faux's CS3501. Since that time, Seth has made improvements to the game for our class use. The robot game was heavily refactored by Matt Justin in 2006. Further improvements were made and instructions written by Daniel Selifonov in 2007.

How to Play

The competition is based on a city located on a grid with buildings and streets. Your robot will roam the streets trying to encircle sets of buildings in breadcrumbs before any other robot can. If you are the first to encircle a building(s), you receive the points.

How to Install

Copy the file ~/elenam/3501_fall/RobotGame.tar.zip. Unpack it using tar xvf RobotGame.tar.zip. Create a new Eclipse project with this source code. Make sure to set the src and test directories as source directories, and include the JUnit library in the build path.

Your Robot Algorithm Class

Your Robot Algorithm Class:

How this Game Works

Robot InstructionsMove Enumeration
Do nothing Move.SKIP
Move ahead while laying breadcrumbs Move.AHEAD_WITH_CRUMBS
Move ahead without laying breadcrumbs Move.AHEAD_WITHOUT_CRUMBS
Turn left Move.TURN_LEFT
Turn right Move.TURN_RIGHT

Sensors

Sensors can see what is to the right, left or in front of the robot. Sensors are delivered as a SensorGroup instance. Sensors can be extracted from the SensorGroup. The Sensor class has several methods to access information about the sensed cell. The methods include: getCellType() to determine if a cell is a building, street, or outer wall; getOwner() to determine which robot owns a building; hasAdversary() to determine if another robot is on the sensor; hasAdversarysCrumbs() to determine if enemy breadcrumbs are on a street; hasMyCrumbs() to determine if the robot's breadcrumbs are on a street, and getPointValue() to determine the point worth of a building.

To move forward or to turn right or left takes one move. Illegal moves include trying to go into a building, trying to occupy a square your opponent is in, or moving off the edge of the city. You can return an illegal move from your robot's getMove() method, but the game will substitute a Move.SKIP if the move is illegal. Robots can only move forward.

Moving without breadcrumbs will destroy all of your robot's current breadcrumbs. Captures are performed by creating a loop of breadcrumbs. Once a loop is created in breadcrumbs, the game will analyze the enclosed space, then remove all of your breadcrumbs. If there are no buildings captured by the enemy robot within the loop-enclosed area, those buildings will be captured by your robot, and you will earn the points for those buildings. Note: The game considers backtracking as the creation of a zero-size loop -- you will lose your breadcrumbs if you backtrack.

Adding your Algorithm to the Environment:

Manually add an instance to your algorithm to the ExecuteGame.java class (main method) and recompile.


        Example:
	RobotAlgorithm [ ] algorithms = {
		new MyFirstRobot ();
		new MySecondRobot ();
	};

Game Levels

  1. A 51 by 51 grid with a road around the edges of the map, and buildings alternating with roads within the map. All buildings have equal point value.
  2. A 51 by 51 grid that follows the same design as Level 1. Additional buildings are randomly scattered within the building grid, but the outer edge road is always clear. All buildings have a random point value.
  3. A 61 by 81 grid that has a building/road alternating pattern, a road around the outside edge, and a dense distribution of random buildings within the building pattern.

Players

In a tournament player 1 is blue, 2 red, 3 purple, 4 orange. There may be no more than 4 robots on a map.

First try to beat PredictableTestRobot.

What to submit


CSci 3501 course web site.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.