SokoSave

  COPYRIGHT

SokoSave is copyright ©1997,2001,2002 by Eric Sunshine.
SokoSave is copyright ©1997 by Paul McCarthy.

SokoSave is freeware. You may use and enjoy this program for free. You may make and distribute unmodified copies of this program for free provided that no fee of any kind is collected.

The latest version of SokoSave can always be found at www.high-speed-software.com/sokosave.

  THE GAME

  Starting a New Game

You start a new game by selecting the New... item from the Game menu. This brings up a panel that lets you select the puzzle you would like to play.

  Objective

The object of the game is to use the player to push all of the crates onto the blue goal tiles. The various elements in the game are illustrated below.

Player
Crate
Highlighted Crate
Empty Tile
Empty Goal Tile
Wall

SokoSave supports the classic square-tiled Sokoban, hexagon-tiled Hexoban, and triangular-tiled Trioban puzzles.

  Moving Around

For square-tiled games, the player can move up, down, left and right. The player can not move diagonally, though diagonal movement can be simulated by moving horizontally and then vertically, or vice versa. For hexagon-tiled games, the player can move left, right, and digaonally. For triangle-tiled games, the player can move left, right, diagonally, and either up or down, depending upon the orientation of the traingular tile.

The player can not move through walls.

There are several mechanisms for moving the player:

  Pushing Crates

The player can only push one crate at a time. If the player is next to a crate and the tile on the far side of the crate is empty, then moving toward the crate will push it along in front of the player.

For triangle-tiled puzzles, pushes are weighted to give the crate a leftward or rightward motion. The weighting is controlled by the overall direction of player movement. For example, if the overall direction of movement of the player is horizontal, then the crate will be pushed in front of the player along a horizontal path. The same rule applies to diagonal movement.

There are several mechanisms for pushing crates:

  Undo, Redo, and Playback

SokoSave provides unlimited undo and redo capabilities. If you make a mistake, you can back up as many moves as you like by pressing the Undo Move button at the bottom of the board. If you take back too many moves, you can use the Redo Move button to "undo the undo". Redo is available until you make a move which differs from the sequence of moves that was undone.

Undo Move
Redo Move

SokoSave also features smart undo and redo for pushes. Rather than applying to only a single move, the Undo Push and Redo Push buttons undo and redo an entire series of logically related actions. When Undo Push is used, if the last action was a push, then that push is undone along with all other pushes in the same direction. If the last action was a move, then that move is undone along with all other moves until a push is reached. Redo Push works in a complementary fashion.

Undo Push
Redo Push

You can also use the playback slider to back up to any point in the game. If the Animate switch is checked, then the moves and pushes are animated during replay. If this switch is not checked, then the game returns instantaneously to the selected point of play without any animation. If an animated playback becomes too lengthy, you can abort the playback by pressing the Stop button; by pressing the Escape key on the keyboard; by clicking in the puzzle area with the mouse; or by switching to a different window.

SokoSave's undo and redo mechanisms are intelligent. If you make moves which SokoSave considers to be opposite of your most recent moves, then undo or redo actions are invoked automatically on your behalf. For instance, if you move the player left three times and up once without pushing a crate, and then immediately move down once and right three times, SokoSave sees this as four moves followed by four undo actions.

  Scoring

SokoSave computes several scores as you play.

Puzzle maniacs should try to find solutions with the minimum number of moves, pushes, runs, or focus changes. These are different goals. For example, sometimes you can reduce the number of moves at the cost of added pushes and vice versa. As an illustration of these potentially conflicting goals, consider the following puzzle.

As illustrated below, one can minimize the number of pushes (represented by the dark line), but at the expense of the number of moves (represented by the light line). In this case, getting the crate to the goal required only 6 pushes, but 28 moves.

Conversely, minimizing the number of moves often results in a greater number of pushes, as illustrated below. In this instance, getting the crate to the goal required 14 pushes (8 more than the previous example), but only 18 moves (10 fewer than the previous example).

The effect of the automated movement mechanisms on scoring may impact your choice of which mechanisms to employ or in what manner to employ them.

When the player is moved via either dragging or point-and-click, the computer always chooses the path to the destination tile which requires the fewest number of moves.

When the secondary mouse button is used to push a crate in a straight line, both the number of moves and the number of pushes needed to reach the destination tile are minimized.

When a crate is moved via either dragging or point-and-click, the chosen path minimizes the number of pushes required to deposit the crate at the destination tile. As a secondary objective, the chosen path also minimizes the overall number of moves needed to satisfy the primary objective of minimizing the number of pushes. If your goal is to minimize the overall number of moves in a game, then use caution when employing automated crate movement, since minimizing moves is only a secondary goal of this mechanism.

  Saving and Restoring Games

You can save your current position by selecting the Save or Save As... item from the Game menu. Save uses the current save-file-name associated with the board. This name is displayed in the window's title bar. Each time you use Save it replaces the last saved position with the current position. Using Save As... lets you specify a different name for the saved game, thus allowing you to keep any number of different positions per puzzle. To restore a saved game, use the Open... item from the Game menu.

  CONCLUSION

  Credits

Paul McCarthy wrote the original version of SokoSave for NextStep.

Eric Sunshine added many new features, including several powerful automated movement mechanisms for ease of game play; added support for hexagonal Hexoban puzzles and triangular Trioban puzzles; generalized the core SokoSave game logic and extracted it into a portable and reusable library; and ported SokoSave to Microsoft Windows using C++Builder, and to MacOS/X, MacOS/X Server 1.0 (Rhapsody/YellowBox) for Mach and Windows, and OpenStep for Mach and Windows.

Classic puzzles 1 through 50 were published by Hiroyuki Imabayashi when he invented Sokoban in 1982. Joseph L. Traub collected another 40 levels for XSokoban.

David W. Skinner invented the hexagonal-style Hexoban puzzle layout, created the "dws" Hexoban puzzles, and the "dwstri" Trioban puzzles. François Marques invented the triangular-style Trioban puzzle layout, created the Hexoban-style Heloban and Heroban puzzle sets, and the Trioban-style Tryoban puzzle set. Aymeric Du Peloux created the Hexocet Hexoban puzzle collection, as well as the "adptri" Trioban puzzles. J. Kenneth Riviere created the "jkr" Hexoban puzzles. David Holland created the "dh" Hexoban puzzles. Gerald Holler created the "gh" Hexoban puzzle.

  Feedback

When sending feedback to the authors, please mention the SokoSave release and build numbers, as well as the operating system type and version information with your correspondence.

Send comments to:
Eric Sunshine <sunshine@sunshineco.com>
Paul McCarthy <zarnuk@high-speed-software.com>