What is Sokoban?
Sokoban is a classic pushing puzzle. You are a figure in a small room made of walls. Barrels stand on the floor, and some floor squares are marked. The whole task is to push each barrel onto a mark. The word comes from Japanese, where it means a warehouse keeper, which suits the picture: a worker moving crates around a storeroom. The rules fit into one sentence, and the puzzles built on them can still take a long time. In PsyGames the Sokoban puzzle is part of the Space hub. It is one of two games in the app taken from the “unfinished” folder of Simon Tatham’s puzzle collection; the other is Klotski.
Below are the rules, the controls, a worked example and the planning habits that keep barrels from getting stuck.
The goal and the rules
You walk on the floor squares of the room, one step at a time. The rules are these.
- You can walk to any free neighbouring square, but not through walls or barrels.
- If you walk into a barrel and the square beyond it is free, the barrel moves one square in the direction you walked, and you step into the square it left. That is a push.
- You can push only one barrel at a time. If there is a wall or another barrel behind the barrel you are pushing, nothing happens.
- You can never pull a barrel, and barrels do not move on their own.
- The level is solved when all the barrels are standing on the marks.
Everything else follows from these points. In particular, the number of moves is not limited by the rules; the real limit is that some pushes cannot be reversed.
How to play Sokoban in PsyGames
You walk with the arrows. The app puts it plainly: walk with the arrows and push barrels onto the marks, and a cornered barrel is stuck for good, and then you undo moves or restart the level. In classic Sokoban pushing is part of walking: a barrel moves when you walk into it; the app’s description does not detail this. Before you step towards a barrel, check the square on its far side, because that is where it will go.
A worked example
Start with the easiest case: a straight corridor. You stand at the left end, a barrel sits in the middle and the mark is at the right end. Walk right. You reach the barrel and push it, and you keep walking and pushing until the barrel stops on the mark. The level is solved.
Now a typical mistake. A barrel stands in the open floor, a few squares below the top wall, and the mark is in the middle of the room. If you push the barrel up against the top wall, it can from then on only slide left or right along that wall, because pushing it back down would mean standing inside the wall. Slide it far enough and it reaches the corner, and there it is stuck for good. The better idea is to push it along the open floor towards the middle row, away from the walls, and to put it on the mark from there.
This also shows why you must think about where you stand. To push a barrel upwards you have to be below it. To push it left you have to be to its right. Part of the planning is making sure that you can walk round to that square.
Solving tips and common mistakes
- Find the dead squares first. A corner that is not a mark is a trap for any barrel. A barrel can also be ruined against a wall: it can then only slide along the wall, so if no mark lies along that wall, it will never reach a mark.
- Never push two barrels together against a wall. Two neighbouring barrels along a wall block each other: neither can be pushed along the wall, because the other one is in the way, and the wall prevents pushing them off it. A square block of four barrels is stuck for the same reason.
- Think about which side you will stand on. For each barrel, work out the squares you must reach to push it where you want. If one of those squares is blocked by another barrel, deal with that barrel first.
- Leave yourself a way round. Do not push a barrel so that it seals a corridor you still need to walk through.
- Start with the barrel that is hardest to reach. Barrels in tight spots or near the far marks are the ones that become impossible later, so solve them while there is still room.
- Plan the end, too. When the last barrel is pushed, it should not block the way to another mark. Fill the marks that are deepest in the room first.
- If a barrel is stuck, accept it. The app says a cornered barrel is stuck for good, so the way out is to undo the moves that cornered it, or to restart the level and use what you learned.
How Sokoban differs from similar puzzles
In Klotski you move the blocks directly by dragging them into free space, and no figure walks around. In Sokoban, the figure is part of the puzzle, since reaching the right side of a barrel is half of the thinking. Inertia also puts one character on a grid, but there the character cannot stop where it likes, while in Sokoban every step is under your control and the difficulty is in the pushes that cannot be undone. Solitaire Pegs shares that sense of irreversible moves, though pegs jump and vanish instead of being pushed.
Sokoban in PsyGames
The app lists the Sokoban puzzle in its Space hub, next to Klotski and Galaxies. The rooms come in five sizes: 10×8, 12×10, 14×11, 16×12 and 20×16. You can browse the whole collection on the all games page.