This page has been adapted from the original blog post.
The default simulation parameters are based off of the original(ish) Scratch program. (This actually includes my implementation of the Mark II AI instead of the default, but the specifications are the same).
Many of these parameters can be easily modified. For example, the power cost of each action (other than sense) can be increased or decreased. The dimensions of the level can also be adjusted.
The surface of mars is represented by a 32x23 tile grid with 5 different terrain types:
- Impassable - the rover cannot move onto this tile.
- Smooth - easy to move on, and can be sampled
- Rough - difficult to move on, and can be sampled
- Smooth Sampled - easy to move on, but cannot be sampled.
- Rough Sampled - easy to move on, but cannot be sampled. (Functionally identical to Smooth Sampled)
The terrain is generated randomly. A border of impassible tiles is created first. Each inner tile has a 10% chance of being impassable, a 30% chance of being rough, and a 60% chance of being smooth. The center tile where the rover starts is always smooth.
The rover starts off with 500 power and 1000 moves. It can perform several different actions:
|Action||Power Cost||Moves Used||Description|
|Sense||0||0||Senses the type of terrain on an adjacent tile|
|Move (Smooth)||10||1||Moves the rover in a cardinal direction|
|Move (Rough)||50||1||Moves the rover in a cardinal direction|
|Collect Sample||10||1||Collects a sample from the tile the rover occupies and turns it into a sampled tile|
|Process Samples||30||1||Processes up to 3 collected samples in the hopper|
|Transmit Samples||50||1||Transmits all processed samples|
|Collect Power||0||1||Adds power to the rover equal to |
NoBacktrack counts the number of consecutive moves onto smooth terrain. This is reset whenever the rover collects light or moves onto a tile that is not smooth terrain. This number is cubed to determine the amount of power to add to the rover.
- Attempting to move the rover into an impassable tile has no effect and consumes no power or moves.
- The rover's hopper can only hold 10 samples at a time, after which they must be processed.
- Failing to collect a sample does consume power and moves.
An AI is allowed to use any of the above actions to control the rover, but nothing else (no cheating). The goal is to transmit the most amount of processed samples before the rover runs out of power or moves. I think getting an 'A' required transmitting at least 150 samples (or maybe it was 200).
A rover needs about 2.1 moves for each sample including processing every 3 samples (1 sample + 1 move + 1/3 process). A rover will need to collect power at least once and transmitt once, so that leaves 998 moves left. Therefore, in the perfect simulation, the rover will transmit 427 samples. Since on average there will be
(32 - 2) / (23 - 2) * .9 = 567 tiles that can be sampled on each map, it's impossible for a rover to collect samples from every tile on the map.