Friday 7 November 2008

Sokobina

I wrote a game!

You can download it here. You'll need Java installed in order to play it. If you don't know if you have Java, visit Sun's Do I have Java? page, and install it if necessary.

There shouldn't be any bugs left, but leave me a comment if there are. Also, please get in touch if you've made any cool custom levels, and send them across. You can find the levels you've made in the 'customlevels' folder that appears when you extract the game. Make sure you extract everything from the zip file before trying to play :)

There's a prize for the first person to beat every level. And yes, I do have a way of checking. If any of you CompSci folks manage to circumvent that then I suppose you deserve a prize anyway.

Sokobina - a Sokoban Game, level 20
A screenshot from level 20

Before you get too excited, I should point out that Sokobina is just another version of Sokoban (also known in English speaking countries as BoxWorld). I wasn't aware this genre was quite so popular though, when I started up I only had vague memories of a really cool Amiga game (this particular one had cavemen pushing rocks into holes, I believe).

I wrote it up myself for three reasons - to relive the fun of the game; to give some challenges to some friends I know like to solve puzzles and to work on my AI skills.

Only later did I find out that Sokoban, as a genre, is NP-HARD, and comparable to chess in the depth of the search trees you need to solve it with AI. In fact, Sokoban solvers have already been the subject of quite a bit of research, and for some harder levels, there are still no solvers that can do a decent job. I even found someone who wrote a solver for his Final Year Project - why didn't I think of that?!

I'm still working on an AI, which can then be used to find out if levels made via the creator are feasible or not. For now, there's just very trivial checking, so I'd recommend you play through your custom levels yourself (you can start a new game while the level editor is still open) to see if they're solvable before you email them to me or your friends :)

Let me know if anyone fancies dipping into the code and lending a hand, it's not too messy :)

--

Thanks for Forx for lending a hand with the graphics :)

Leave a comment.

Recent Tweets