Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenMian committed Jan 21, 2024
1 parent 0ac0c41 commit b39737e
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ A sokoban with a solver.

## Features

- Integrated solver.
- Full mouse control.
- Player animation.
- Front-end and back-end separation.
- Levels and solutions are stored in the database.

### [Auto crate push](docs/auto_crate_push.md)

<p align="center"><img src="./docs/auto_crate_push.gif" width=50%></p>

- Integrated solver.
### [Solver](docs/solver.md)

<p align="center"><img src="./docs/auto_solve.gif" width=50%></p>

- Front-end and back-end separation.
- Levels and solutions are stored in the database.

## Keymap

### Mouse
Expand Down
30 changes: 30 additions & 0 deletions docs/auto_crate_push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Auto crate push

<p align="center"><img src="auto_crate_push.gif" width=70%></p>

This feature can provide good assistance when users play larger levels.
At the same time, it also retains the traditional control method.

Clicking on a crate will display all the points that the crate can reach (without moving other crates).

Take Microban #155 as an example:

<p align="center"><img src="auto_crate_push_1.png" width=70%></p>

Clicking on one of the points will automatically push the crate to that position.

For example, user can click on the target, and the character will automatically push the crate to the target to complete the level.

Some areas where the cratees are reachable do not display points. This is because pushing the crate to those locations will lead to a dead end and the player will not be able to continue to complete the level.

<p align="center"><img src="auto_crate_push_2.png" width=70%></p>

## Controversial

This feature is a bit controversial, with some people saying it's akin to cheating.

For simple levels, this does significantly reduce the level difficulty. An extreme example is a level with only a single crate and target, which means the player can complete it without having to do any reasoning.

But for complex levels, the difficulty mainly lies in the complex pushing relationship between multiple cratees, rather than the pushing of a single crate. This feature allows players to focus on more complex reasoning instead of repeating the simple work of pushing a single crate.

Otherwise, this feature is **optional**. Users can always use traditional control methods.
Binary file added docs/auto_crate_push_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/auto_crate_push_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/solver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Solver

<p align="center"><img src="auto_solve.gif" width=70%></p>

The solver can automatically solve simple levels.

## Strategy

- `Fast`: Speed priority.
- `Mixed`: Balanced speed and steps.
- `OptimalMovePush`: Find move optimal solutions with best pushes.
- `OptimalPushMove`: Find push optimal solutions with best moves.

## Lower bound calculation method

- `PushCount`: Minimum push count to nearest target.
- `MoveCount`: Minimum move count to nearest target.
- `ManhattanDistance`: Manhattan distance to nearest target.

## Optimization

- Deadlocks detection.
- Dead square deadlocks.
- Freeze deadlocks.
- Tunnels detection.

## Visualization

Supports visualization of the automatic solution process. This feature can be used to intuitively view the working status of the solver.

- Displays the optimal state obtained by the current solver.
- Display the lower bound as a heat map.

![Visualization](solver_visualization.png)
Binary file added docs/solver_visualization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b39737e

Please sign in to comment.