SokoVen

Monday, April 23, 2012

SokoVen

SokoVen is a clone of the classic Sokoban game.

The motivation to write this game was the interest I have in the Artificial Intelligence field. Sokovan has real challenges in terms of AI, making it the perfect scenario to put some knowledge in practice (while having fun programming and playing this wonderful game).

SokoVen was made in C# (and Windows Forms .NET for the presentation layer).

You can grab the source (MIT license) or download the game from GitHub:
https://github.com/protron/SokoVen

Sokoban

A Sokoban puzzle.
Sokoban 倉庫番 (warehouse keeper) is a type of transport puzzle, in which the player pushes boxes or crates around in a warehouse, trying to get them to storage locations. The puzzle is usually implemented as a video game.
Sokoban was created in 1981 by Hiroyuki Imabayashi, and published in 1982 by Thinking Rabbit, a software house based in Takarazuka, Japan.

Rules

  • Only one box can be pushed at a time.
  • A box cannot be pulled.
  • The player cannot walk through boxes or walls.
  • The puzzle is solved when all boxes are located at storage locations.

Implementations of Sokoban

Implementations of Sokoban have been written for numerous computer platforms, including almost all home computer and personal computer systems. Versions also exist for several hand held and video game consoles, mobile phones, graphic calculators, and Canon PowerShot digital cameras.

Scientific research on Sokoban

Sokoban can be studied using the theory of computational complexity. The problem of solving Sokoban puzzles has been proven to be NP-hard. This is also interesting for artificial intelligence researchers, because solving Sokoban can be compared to designing a robot which moves boxes in a warehouse. Further work has shown that solving Sokoban problems is also PSPACE-complete.
Sokoban is difficult not only due to its branching factor (which is comparable to chess), but also its enormous search tree depth; some levels require more than 1000 "pushes". Skilled human players rely mostly on heuristics; they are usually able to quickly discard futile or redundant lines of play, and recognize patterns and subgoals, drastically cutting down on the amount of search.
Some Sokoban puzzles can be solved automatically by using a single-agent search algorithm, such as IDA*, enhanced by several techniques which make use of domain-specific knowledge. This is the method used by Rolling Stone, a Sokoban solver developed by the University of Alberta GAMES Group. The more complex Sokoban levels are, however, out of reach even for the best automated solvers.