Published: 2025 September 08
Reverse mode is a game mode in some unofficial Sokoban programs, where players play a puzzle backward. It can make finding a solution easier, or simply let players explore and better understand the puzzle. In those programs, the standard way of playing is called normal mode (or normal play).
Sokoban, by design, is played forward, since its creation in 1981. Around the year 2000, some players had the idea of using a different approach: playing backward — disarranging boxes by pulling instead of arranging them by pushing. But the core mechanics did not allow this, so a new game mode had to be introduced later in some fan-made Sokoban programs. This new mode was called reverse mode.
Normal mode.
The same level showing the starting position in reverse mode.
A good way to understand this is by comparing a Sokoban puzzle to a maze. Solving a maze forward means going from the entrance to the exit, while solving in reverse means starting at the exit (red square) and working back toward the entrance.
In a maze, from the exit, there may be several possible paths.
In the example, there are three paths. The orange path is quickly recognized as a dead end and discarded. That leaves the green and blue paths. Both need to be tested. If the blue path also ends in a dead end, it becomes clear that the green path is the only viable option — even though it may still have unknown branches.
Similarly, as with a maze — where the winning state is known (the player is at the exit) but the backward path is unknown — in reverse mode, the winning state is known (all boxes on storage locations), but for non-trivial puzzles, the player's first pulling position (which corresponds to the final pushing position in normal play) and the backward path are unknown. From the possible first pulling positions, some can be discarded through analysis, while others must be tested.
However, playing Sokoban in reverse is not as straightforward as solving a maze in reverse, where one simply walks from the exit to the entrance. Solving Sokoban in reverse requires thinking in the opposite direction. For example, before making any pull, the player should ask: Could the pusher, in forward mode, have pushed this box from here? Or, when choosing the first pulling position: Could the pusher have completed the puzzle ending at this position?
In reverse mode, the player pulls boxes instead of pushing them. First, the player chooses a pulling position, then continues pulling boxes until all backward goal positions are filled. This differs slightly from forward mode, where the level is solved when all boxes are on storage locations. In reverse mode, the player must return — or at least be able to return — to the original starting position. Some Sokoban programs automatically calculate and apply the returning path — even without animation — which can give the impression that simply pulling the boxes is enough. However, this is not the case because the last steps in reverse mode correspond to the first steps in forward mode.
Most programs display a special graphic at the original player position, such as a grid of squares or a symbol like ▦.
Try to solve this puzzle in reverse mode in Sokoban YASC. First, position the player on the right side using the 'jumping' option (available when you click on the player). To pull with the mouse, click a box and then select a target square. With the keyboard, pulling is automatic: if the player is next to a box and moves away from it, the box will be pulled. To avoid pulling, hold the Ctrl key while using the arrow keys.
######## #-@#---# #-.$---# ######## Title: Reverse mode tutorial Author: Matthias Meger + Carlos Montiers A.
Note: it is not enough to solve in reverse with a single pull. Why? Because the player must be able to return to the original player position.
Try to solve this puzzle in reverse mode.
-#########################################-- -#-----#---------#-------#---#-----------#-- -#####-#-#######-###-###-#-#-#####-###-#-#-- -#-----#---#---#-----#-----#-----#-#---#-#-- -#-#######-###-#################-#-#-###-#-- -#-------#---#---#-----------#---#-#---#-#-- -###-#-#####-###-#-###-###-#-#-#######-###-- -#-#-#-----#---#-#---#---#-#-#-#-----#---#-- ##-#######-###-#-###-###-###-#-#-###-#-#-#-- #@---#---#-----#-------#---#-#---#---#-#-#-- ####-#-#-#####-#######-###-#-#####-#####-### -#-#-#-#-----------#-----#-#-#---#-------$.# -#-#-#-###########-####-##-#-#-#-#######-### -#-#---#---------#---------#-#-#-------#-#-- -#-#####-###################-#-###-#####-#-- -#------------------#--------#---#-#---#-#-- -#-########-##################-#-#-#-#-#-#-- -#--------#--------------------#-#---#---#-- -#########################################-- Title: Reverse mode tutorial Author: Carlos Montiers A.
Players may encounter a reverse deadlock (different from a forward deadlock). A deadlock is a situation in which it is no longer possible to solve the puzzle, regardless of further moves.
A reverse deadlock occurs if you pull a box to a position from which it could not have been pushed in normal mode.
For example, in the shorter version of the first Sokoban puzzle (shown in the image), the position marked with an 'X' is a floor square that can hold a box by the rules, but it is impossible to push a box there in normal mode.
But in reverse mode, you can pull a box there, creating a reverse deadlock.
[Ming's rule of thumb] Do not pull a box in reverse mode to any position from which it could not be pushed in normal mode — it will always result in a deadlock.
[Carlos's note] Some Sokoban programs can help players avoid this. For example, Sokoban YASC prevents it if deadlock detection is enabled.
Programs that offer a reverse mode:
Each implements reverse mode with some differences.
Sokoban YASC
The first time reverse mode is activated for a puzzle, it swaps boxes and storage locations based on the original layout. The player starts positioned at the same original forward-mode position and can be repositioned by moving or "jumping". After pulling, when all boxes are on storage locations, the program tries to find a path to return the player to the original position. If successful, the puzzle is considered solved in reverse; otherwise, it displays: "This is not a reverse mode solution because the player is not in the right zone".
Sokofan
Every time reverse mode is activated, it swaps boxes and storage locations based on the current puzzle state. On the first play, the player must choose the initial pulling position. Once all storage locations are occupied by boxes, the program tries to automatically find a path to return the player to the original position. If successful, the puzzle is considered solved in reverse; otherwise, it displays a message such as: "Deadlocked man cannot reach c2 (row 2, col 3)".
This program also includes a mode called "normal", which is not necessarily the same as the "normal mode" in Sokoban YASC. It works forward as well. In Sokofan, the goal of this mode changes depending on the work done in reverse mode. If reverse mode is used, the goal in normal mode becomes reaching the state where reverse mode stopped.
SokoPlayer HTML5
Every time reverse mode is activated, it swaps boxes and storage locations based on the original layout. The player starts positioned at the same original forward-mode position and can be repositioned to perform the first pull by moving or "jumping". After pulling and filling all storage locations, the player must manually return to the original position.
Rod's Pull-Sokoban
The gameplay is always in reverse. It begins with boxes and storage locations swapped based on the original layout. At the start, the player is positioned on a random square and can be repositioned to perform the first pull. Once all storage locations are occupied by boxes, the player must manually return to the original position.
BoxMan
BoxMan is a Chinese program available on Windows and Android. When playing in reverse mode for the first time, the player must choose the initial pulling position. If a separate mode, Double Push, is inactive, boxes and storage locations are swapped only the first time reverse mode is activated, based on the original layout.
Reverse mode can be seen as a form of emergent gameplay — an unintended use of Sokoban's mechanics — because it was not part of the game's original design but was later added as a tool to assist in solving puzzles.
In reverse mode, if your initial guess for the player's starting position is wrong, you may need to replay the entire puzzle in reverse from a different position. This can be exhausting, especially in complex levels.
[Matthias's note] It's true that it may be exhausting, but on the other hand it's also exhausting to play in forward mode and then realize it's not possible to end the puzzle. Hence, it's not uncommon to try to choose an end position for the player, then try to solve the puzzle and then to realize that the puzzle can't end like this — the initial player position was wrong —. This way you know how to proceed in forward mode. Hence, it's a trade-off: the more you know about how the puzzle must be played in the end, the better it is for the forward play. However, this means more time spent in reverse mode.
Reverse mode is typically used by experienced players, mainly for complex puzzles. They often use it temporarily to gather information or hints before switching back to forward mode.
[Matthias's note] I think in most cases I use the reverse mode BEFORE playing the forward mode.
What information reverse mode can reveal (Ming, with Matthias's notes):
1) The order in which goals can be filled.
2) Which goals should be filled first (important for creating space).
[Matthias's note] A good example for both points is this puzzle from the Rolling Stone paper (page 39).
########## #@--#---.# #-$-$--..# #-$$$##..# #----##### ######----
3) The possible player's position when the level is solved.
[Matthias's note] Sometimes it is useful to know where the player cannot end up — e.g., "top left of the puzzle" and try to prove that the puzzle cannot be solved from this position in reverse mode. This knowledge then helps with the normal forward search. Example: Xsokoban 50.
[Carlos's note] Matthias's example is excellent. Notice how, even if not noticed at the beginning, playing in reverse mode eventually reveals that on the left side of the warehouse the player will never end up playing in normal mode. This also shows an example of a wrong first pulling position choice.
4) How to place boxes before the level ends.
5) The order in which isolated goals are filled.
6) In rare cases, whether a level is unsolvable. (If all possibilities fail in reverse mode, the puzzle cannot be solved in forward mode either.)
Reverse mode is just another perspective on the same level. Its usefulness depends heavily on the player's experience, and the benefits increase with practice.
[Matthias's note] Its usefulness also heavily depends on the puzzle! For some it's no help, for others it's a very huge help.
Situations that are difficult in forward mode may be much easier in reverse mode.
There are levels in which solving from reverse does not help at all (e.g., Orimaze levels).
[Ming's note] An Orimaze Sokoban level is a type of level developed by Dries De Clercq that incorporates the idea of OriMaze, a block-moving puzzle created by John Tromp and Rudi Cilibrasi. In these levels, solving in reverse offers little or no advantage — going forward and backward are equally difficult. Example:
################################# #-------------------------------# #-##-##########-############-##-# #-#-.---*-*-*-*--*--*-*-*-$---#-# #--$#-#*--#---##-##---#--.#-#*--# #-#-----#####-------#####--@--#-# #-#.#-#.--#---#-#-#$--#--$#-#*#-# #-#-$-$-*-*-*-*-*-.-*-*-*-.---#-# #-#*-#-*#####*-###-*#####*-#-*#-# #-#--#--#---#--#-#--#---#--#--#-# #-#*###*#---#*##-##*#---#*###*#-# #-#--#--#---#--#-#--#---#--#--#-# #-#*-#-*#####*-###-*#####*-#-*#-# #-#---.-*-*-*-*-*-$-*-*-*---*-#-# #-#.#-#$--#---#-#-#.--#--*#-#-#-# #-#-----#####-------#####-----#-# #--$#-#---#--*##-##*--#---#-#---# #-#-.-$-*-*-*-------*-*-*-*-*-#-# #-##-############-##########-##-# #-------------------------------# ################################# Author: Dries De Clercq
There are levels designed specifically to make reverse mode confusing — so trying to solve them using reverse mode is almost fruitless. Fortunately, most levels are not like that.
The more you play, the more you learn.
The more you use reverse mode, the better you will get at it.
############### #@$----.#-----# #-$.$$$.#.$$$-# #-$.$.$.#.$.$-# #-$.$.$.#.$.$-# #-$.$.$.#.$.$-# #-$.$.$.#.$.$-# #-#.#.....#.$.# #-$.$$.#.$$.$-# #-$.$..#..$.$-# #-$.$$.#.$$.$-# #-$.$..#..$.$-# #-$$$$.#.$#.$-# #------#.---$-# ############### Title: 00006 solvable Author: Secxyiii url: http://www.game-sokoban.com/index.php?mode=ulevel&lid=4741
[Carlos's note] This puzzle has two sides, so the question is: on which side did the player end in forward mode? That determines which side to choose for the first pulling position. An experienced reverse-mode player might see this almost immediately. Otherwise, it can be determined by pulling boxes from both sides and trying to open a path between them. If it turns out that a path can be opened from one side but no further pulling is possible, it means the player did not end on that side in forward mode.
Anian: "The idea of reverse mode was [...] discussed in forums amongst Sokoban players way before the year 2000."
Ming: "The idea of playing reverse was discussed in at least two Chinese forums — the supersoko forum and 20603's forum — before it was supported in any Sokoban program."
The first verifiable implementation date is June 2002, when Sokoban YASC version 1.30 introduced it as: "New feature: Reverse mode play, i.e., try to solve a level backwards. Sometimes, this feature comes in handy when solving difficult levels."
If reverse mode is powerful, combining reverse and forward play is even more so.
It is like solving a maze with two workers: the first walks from the exit along the green path, and when he stops, the other starts from the entrance along the purple path, trying to reach him. Both workers remain aware of each other's progress — any advance by one affects the goal of the other. When the two paths connect, the solution is complete.
Currently, only two programs support this feature: Sokofan and BoxMan.
In both programs, the view combines the progress made in forward and reverse play.
Sokofan
The feature is built-in and does not need to be activated by the user. It became available in 2005 (v1.8) under the name "Reverse-Play".
BoxMan
Supported since the first Windows release in 2019. Here the feature is called "Interactive Double Push mode" (互动双推), and must be explicitly activated by the player.
[Ming's note] It is activated only with Ctrl+J, not through a GUI button. The word 'interactive' is used because when you toggle between reverse and normal modes, the goals change depending on your moves.
In Sokofan, you play in reverse mode. In BoxMan, you also play in reverse mode, but only after activating Double Push mode. In both cases, you stop at some point.
Then you switch to forward mode. The special thing now is: the storage locations are now all the positions where you left boxes previously using reverse mode.
Later, after having done some pushes, when you switch again to reverse mode, the same effect happens: the storage locations are now all the positions where you left boxes previously using forward mode.
Using this DrFogh's puzzle:
-------######- -####--#----#- -#-@####-##-## ##-$#--#...--# #--$-$-#.#.#-# #-$-$--$...#-# ##-$--$-##-#-# -##-###----#-# --#---######-# --###--------# ----########## Title: 002 Forgotten One Previously published: Accumulated1 Date: 2014-08-23 Author: DrFogh
Original layout.
Switching to reverse mode.
Choosing the first pulling position.
Begin to pull boxes.
Switching to normal mode. Notice that although we switched to reverse mode at the beginning, the state is no longer the same as the original layout. In this normal mode, the goal is to reach the state where reverse mode ended.
Begin to push boxes.
Almost solved.
You have the forward playing moves which are just taken as they are.
Then there are the backward-played moves.
These are just reversed (order and direction).
Then they are combined: forward moves + backward moves.
Note: the changed positions of boxes and goals are irrelevant for constructing the solution. The initial and final positions are always the original ones.
The best way to use Double Push mode is:
- First, begin in reverse mode and pull boxes until you 'open the level'.
[Carlos's note] This means you reach a valid configuration that allows access to some or all critical areas of the level.
- Then switch to forward mode and push boxes until the level is solved.
However, difficult levels often will not be that easy and things will not be as smooth as described above. For difficult levels, you will have to toggle back to reverse mode to figure out more things before you go back to forward mode to play. You may even realize that all of your work done so far in reverse mode is wrong. So, things can play out differently.
In Sokoban YASC, you can approximate double push mode by using two views (after splitting the main view) and solving one view in reverse mode and the other in normal mode, while manually keeping track of the overall progress. When an identical layout of boxes and player position is reached in both views, it is possible to combine the steps to form the solution.
Reverse solving is also used internally by almost all modern automatic solver programs, e.g., Takaken, Sokolution, Festival, YASS, JSoko, and Puzzle Dungeon.
Many thanks to Ming Wu and Matthias Meger for their help in creating this article, sharing information, and clarifying details in private emails. Thanks also to Anian and Mikhael Goikhman for contributing additional information. —Carlos