C0d1ng4fun

Color Lines Bot

2009-2010

An example of where the program has played a game close to the end.

After merely having done a few experiments with screen scraping for a couple of years I decided I needed a simpler project (than THAPS) to get back in business. Color lines is a game where colored balls are moved to line up on a square grid board. For every move a new ball is randomly spawned on the board. Once a group is complete it is removed from the board and points are rewarded. The game ends when the board is full. I chose this game because it is fairly easy to play decently well and is easy to scrape.

The system scrapes the screen to locate the board and then identify balls and their color. The model is then passed on to the game resolver.

A small rational agent with some simple heuristics is used to figure out the next move in the game. In most moves it makes what appear to be the right choice. However; it does not score quite as well as a human player mainly due to two reasons:

  • no plan ahead
  • no support for diagonal lines

Game actions are executed by generating mouse events.

The system especially but not exclusively target this implementation of Color Lines. Although changing just a few parameters of the scraper would be sufficient to adapt it to play most implementations of color lines.