A Strategy for Cube Crasher

Cube crasher screenshot

Cube crasher screen shot

Recently I have been playing cube crasher on facebook which is an intuitive yet pretty difficult game to play. Like many games this one in particular has the following features that make it an ideal toy example to solve on the computer:

  • It is deterministic. All moves are performed in discrete time steps and their side effects can be evaluated.
  • There is no time limit, or at least none that I have found yet.
  • The game is simple to understand with few rules.

The aim of the game is to clear the board by clicking on a minimum number of blocks and progressing through the levels. Blocks can be cleared if they form chains of 3 or more of the same colour. In the screen shot above 126 blocks are required to complete level 1. A higher score is achieved by progressing through the levels and clearing larger chains of blocks.

So why is this game interesting? Well having played it through for more then a day and getting through several levels I decided this could be an interesting problem if solved with a computer. I can create grids, move blocks and run algorithms, what else could be required?

Before playing simulated games on my computer I had to get comfortable with the basics of the game by playing it. The first few games I played were quite random, they taught me about the basics such as how to win/lose and how to gain more points/level. After about a day of playing I started to formulate a strategy. The strategy is simple: chose one colour on the board and clear this, then play as normal. When clearing out the inital blocks a few clusters start to emerge out of the other colours. After clearing the clusters the game is left with a significantly smaller and easier set of blocks to clear.

The first few attempts at playing the game left me with what I would call a random strategy. Just getting to know the game involved clicking about without thinking in too much detail as to how this would affect the game several steps ahead. This random strategy left me with an average score (after several games) of between 30 – 40k points. Using the strategy just mentioned I now manage to achieve scores between 50 and 60k points which I would consider a significant improvement.

What’s next? I’m currently finishing off a simulated version of the game which may contain a limited amount of features like the real game. The lack of features is mostly due to not having completed the whole game yet. I am using the A* search algorithm to find a good path through the solution space, I will blog about this in a post soon.

Posted in games | View Comments

Penang February 2010 Holiday Snaps

A small selection of images from my Malaysia trip during this February. All images were taken on my phone. The evening images weren’t great due to the lack of a flash.

Posted in images, travel | View Comments

Welcome

Hi there, welcome to my word press powered website! I work with computers and technology and now in my spare time I shall be reaching out and blogging on as much as I can. This site will document thoughts, ideas and other interesting stuff that I have found.

Posted in general | View Comments