Given the computational complexity of these tasks, a solver program is usually designed for just finding any solution. If a solution is to be optimized, an optimizer program can be used. (See Optimizers.)
The statistics shows the results for the leading Sokoban solvers for various level collections. Please note that the grand totals are simple summations. The number of solved unique levels may differ slightly due to duplicate levels in the level packs.
I have used spoilers from the very start (the wiki played a large part of getting me interested after reading the saga of Ellora the elven archer), and consequently made use of the sokoban solutions provided by the wiki. By now I can do it mostly by heart, but it just dawned on me that the inevitable BoH/AoR reward is quite essential, and I wonder how well I would fare I would skip it - since I could never be bothered to work out the neccessary steps myself. I'm no puzzler - while I can often see what I need to do to find the solution to a given problem, going through the actual motions is something I'd probably never do for a game... For example, I can remember how to brute-force the castle tune, but given the wand of striking/levitation workaround, I would never try to work it out for myself if I was aware of the alternative. Never.
So, how do you view this issue? How bad would missing out on the soko reward influence your game? Do you already play this way, and if so, what is your experience? Are you a puzzler? How would you approach the sokoban branch if you had no external sources of information?
Levels are surrounded by walls and have an equal number of boxes and goals. Here's a small level that can be solved in three key presses. The player @ needs to travel two positions right, and then push the box $ onto the goal.
The above level has a solution of rrR (two moves right, and then a push right). We can track if the level is complete by checking that there are zero box characters $ (they should all be the box-on-goal character *).
To move the player around the level, direction coordinates are passed to the game object in XY notation e.g. right is [0, 1]. If the move is legal (only one box can be pushed at a time), it's applied to the internal level state. During a move, there's some thorny logic to place the correct characters because players and boxes have two states, on goal and off goal.
Like chess engines, Sokoban solvers must be smart or they will never finish running within our lifetimes. Solvers must overcome a large branching factor (potentially 3-4x greater than chess) and a deep search tree (the hardest human-solveable levels require thousands of moves). In Sokoban: Improving the Search with Relevance Cuts, Junghanns and Schaffer state that:
By generating legal moves, we can explore different branches until all the boxes (in this case, a single box) are on all of the goals. There is a single legal move to begin r. Traveling down our first branch, we have a new level state:
Perhaps you noticed the flaw here. We're repeating work by checking the same level state twice when we end up backtracking to a place we've been before. We can store the already-seen level states in a transposition table and avoid creating branches that perform duplicate work.
You need some tools to develop Sokoban puzzles.
Some people use a pencil and a piece of paper.
Some people just use an autogenerator.
I use the tools in YASC. You get a level designer, a solver and an optimizer. Alle of which I use a lot. Making development much easier.
Case completed.You probably have noticed I use the solver and optimizer a lot. These tools considerably speed up the development time since you can test whether a design have a solution or not in no time. And the optimization often shows a design is solvable in a much easier way than intended and you have to redesign your puzzle to make it interesting.
Sokoban (warehouse keeper in Japanese) is a branch of the dungeon modeled on and named after a game where a character is navigated through a series of levels. The object is to move objects to cover goal squares. In the traditional game, the character must move only in the cardinal directions (north, south, east, and west) and push the objects from behind to move them. A player fails by getting objects stuck or boxing himself/herself in, as objects cannot be pulled, created, or destroyed.
In the case of NetHack, the objects are boulders and the goal squares are pits or holes, which block the way forward. There are four levels in each game and two versions of each, for a total of 8 different levels. Diagonal moves of the boulders are not allowed, although the player may move diagonally if there is space to do so, and may attack, fire or cast spells diagonally. At the end of the Sokoban dungeon branch is a Treasure Zoo guarding a bag of holding or amulet of reflection, depending on which version of level 4 you are given. The levels are ascending in dungeon depth, i.e., the 2nd level is above the 1st etc.
All walls in Sokoban are undiggable and unphasable. The floor is undiggable only on the first level. All levels are no-teleport, and it is impossible (for the player only) to level-teleport between Sokoban levels.
It is possible to solve every Sokoban level just by moving boulders around in the normal fashion. However, there are some actions that are legal in Nethack but cheat the Sokoban mini-game in some way. Whenever you perform such an action, your Luck is penalized. The following actions incur penalties of -1 when done in Sokoban:
Note that teleporting a boulder does not incur a luck penalty, but may move the boulder somewhere odd. Falling down a level onto a boulder, or bringing in a boulder as a poly-selfed giant, do not entail a penalty, either.
nhss is a tool that sets up a nethack-like environment (basic movement and boulder pushing only) that can be used to figure a level out before actually playing it, thus reducing the chances of rendering a level unsolvable. It can also record sessions and play them back step by step.
Unaffiliated but related to nhss, Nethack's Sokoban levels for various Sokoban implementations (XSok, Sokoban++, YSokoban, Universal Sokoban format and Games 4 Brains Sokoban format) which you can use to practice the levels in other Sokoban games.
If you would like to distribute your own levels here or know of additional levels that areavailable, send me e-mail.You can make or view user comments about the levels ordownload or view levels in 5 formats:Mac formatReady to download and play with my Sokoban on a Macintosh.Or you can download all the collections at once.TextPlain text. Hint: If you have the "Sokoban" font (for Mac),this will look even better.GraphicsPictures of the first several levels of the collection.Select a level and view itInteractive Javascript application lets you select a level and see it graphically.Unfortunately, this may be a bit slow in some web browsers.Read and share opinionsTell the world how much you love or hate these levels,or see whether other players liked the levels.Sasquatch V LevelsAdded July 17, 2002
David Skinner released this fifth level set in his Sasquatch series in December, 2001.This set includes several levels that are so large they can only be played in Sokoban forthe Mac version 2.5 (which you can download from the home page).I haven't played these levels yet, so that's all I can say for now.Author: David Skinner, sasq...@bentonrea.com
Original level website: sasquatch/sokoban/Download in Mac formatView as textView as graphicsSelect a level and view itRead and share opinions about this collectionPicokosmos LevelsAdded July 17, 2002
Picokosmos Levels, copyright 2002 by Aymeric du Pelouxand included here with his permission.
Here's another set of levels from Aymeric. After I have a chance to playthem, I'll write samething.
Author: Aymeric du Peloux, aymeric....@smile.fr
Original level website: in Mac formatView as textView as graphicsSelect a level and view itRead and share opinions about this collectionMinicosmos LevelsAdded Nov 13, 2001
Minicosmos Levels, created by Aymeric du Peloux.
Aymeric has created another level set in the tradition of Microcosmos.He says this set is for beginners because the levels have only 2 or 3 stones.But I still found them interesting, even though I'm an experienced player.
Many of the levels come in pairs: a relatively easy level with 2 stones, followedby a more challenging level with the same layout and an extra stone. This isa nice way of providing hints.
Author: Aymeric du Peloux, aymeric....@smile.fr
Original level website: in Mac formatView as textView as graphicsSelect a level and view itRead and share opinions about this collectionSasquatch IV LevelsAdded July 15, 2001
Prolific level author David Skinner released this set in March, 2001.He says this set ranges in difficulty from medium to very hard, like his Sasquatch III set.David has included a wide variety of puzzle types, from small to large, with a few decorative(but still challenging) levels.Author: David Skinner, sasq...@bentonrea.com
Original level website: sasquatch/sokoban/Download in Mac formatView as textView as graphicsSelect a level and view itRead and share opinions about this collectionNabokosmos LevelsAdded July 15, 2001
Nabokosmos Levels, copyright 2001 by Aymeric du Pelouxand included here with his permission.
Aymeric, author of the Microcosmos levels, has created another setof small, tricky levels. Many of these levels have only 4 or 5 stones, yetare quite challenging. Sure to please all Sokoban fans.
Author: Aymeric du Peloux, aymeric....@smile.fr
Original level website: in Mac formatView as textView as graphicsSelect a level and view itRead and share opinions about this collectionDavid Holland's dh1Added June 19, 2001
David Holland has created a set of ten challenging levels. I've only solved four of them so far.David describes the puzzles this way:
"Some of the small puzzles had starting stone positions and solution generated bythe computer program sokgen, but maze and goal positions designed by DavidHolland, the author of sokgen. These puzzles are generally pretty hard (DavidHolland has trouble solving them :-) and the non-computer-generated puzzlesshould be light relief. The puzzles are arranged in roughly ascending order ofdifficulty."For more about these puzzles, visit David's web page.Author: David Holland, da...@noether.freeserve.co.uk
Original level website: in Mac formatView as textView as graphicsSelect a level and view itRead and share opinions about this collectionDavid Holland's dh2Added June 19, 2001
This is David Holland's second set of 10 levels.He describes them like this
"There are no computer-generated levels as I am trying to evolve a puzzle-making style, and so experimenting with as many different forms as possible. Some of the puzzles are very, or slightly, symmetrical as a stylistic device(in this I am influenced by David W. Skinner's excellent sasquatch puzzle sets).Others are completely unsymmetrical and the style is in the variations alone.The puzzles are arranged in roughly ascending order of difficulty."For more about these puzzles, visit David's web page.Author: David Holland, da...@noether.freeserve.co.uk
Original level website: in Mac formatView as textView as graphicsSelect a level and view itRead and share opinions about this collectionSasquatch III LevelsAdded Dec 30, 2000
David Skinner has created yet another wonderful set of sokoban levels.He describes them this way:This set ranges in difficulty from medium to very hard.Thirty one of these levels explore some form of design symmetry. It isinteresting (to me at least) to solve levels in which sections are reversed or rotated.Each transformation often suggests different approaches to the solution. However,sometimes the confusion created requires that each section be solved from scratch.Sometimes, I find levels in my earlier sets which I would do differently today.Included here are improved versions of two previous levels.
Sasquatch III (48) = Sasquatch (49)
Sasquatch III (41) = Mas Sasquatch (46)Author: David Skinner, sasq...@bentonrea.com
Original level website: sasquatch/sokoban/Download in Mac formatView as textView as graphicsSelect a level and view itRead and share opinions about this collectionMicrocosmos LevelsAdded Dec 6, 2000
Microcosmos Levels, created by Aymeric du Peloux.
It's amazing how much difficulty Amyeric packs into such small levels.At first glance, the levels look very easy. Then you try one, and it seemsimpossible. Eventually you figure out the trick and solve the level.