Creation of a puzzle game with levels generated by the computer

One of the things I love of (some) puzzle games is the capability of generating random possible levels.

When I mean “puzzle game” this time I am not thinking about Bejeweled or Minesweepes, which are just a bunch of random items in an array, but games with actual levels like Sokoban or, like in this post, Chain Reaction, a very old game made by a Greek developed now disappeared whose games are now hosted on JayIsGames.

Normally when we create a puzzle game level, we start from the end and step back until we have a complete set of moves (normally called walkthrough) required to solve the level.

Here’s an attempt to create random Chain Reaction levels with php:

If you run the script, you’ll generate something like that:

Which is a playable and solveable Chain Reaction level, the first number in the cell should be the shape and the second number is the color.

If you get some practice with the original game you should be able to play these randomly generated levels too.

I am going to create a little browser game out of it, so you will see the concept in a real world example.

  • Pretty cool as always, but, What about part 6 of Plants vs Zombies tut? At least you can show us how to put more than 1 plant, so then we can just change the firerate and recharge rate.

  • Or even a platform game tutorial as3 series

  • Nice idea, when the levels are generated on a server it would always be a new game each time you play the game. :)