
A visited position is insufficient when the ball has moved since the previous visit. Include the remaining pushable objects in the definition of the search state.
One practical way into grid state space comes from Sokobear Goo. Consider a forest puzzle board and the instant a player tries to line up the next slime ball.
What grid state space measures
A board diagram captures positions, but an interactive puzzle needs legal transitions between positions. A useful place to observe the distinction is a forest puzzle board. Define one state, one accepted input and the state it produces. Treat blocked attempts consistently. Two boards that look alike can still be different if an item was consumed or a partner ended on the opposite side.
Build a paper version of the scene
The figures below define a paper model. They are neither captured timings nor developer specifications for Sokobear Goo. Start with a 7-by-8 board containing 56 squares. Block 4 squares. One marker now has 52 possible locations. Two distinguishable markers that cannot share a square have at most 52 × 51 = 2652 joint placements before movement rules are applied.

Read the figures as text
| State model | Assumption | Candidate placements |
|---|---|---|
| Empty board | 7 × 8 cells | 56 |
| One piece | 4 blocked cells | 52 |
| Two distinct pieces | No shared open cell | 2652 |
That last number counts candidates, including combinations that may be unreachable. A movement rule tying both markers to one command, a one-way corridor or an object that must stay adjacent cuts down the valid set.
Where the comparison can go wrong
Start with an empty rectangular test board. Keep a note beside the result about the possibility of treating every creature as a one-hit target. Draw the open moves from one corner and mark each newly reached position once. Repeat after adding an obstruction. Write the movement rule beside the drawing, particularly if a move can continue past the first adjacent cell.
Try walking the proposed route in reverse. The observation to retain for Sokobear Goo is whether a second push remains possible. A missing return edge is useful evidence: a graph for one-way actions cannot silently assume every connection is reversible. For a paired character, include both positions in the test state before declaring a duplicate. Include that square in the route, even when the destination of the ball appears obvious.
Xbox · Sokobear Goo official listing · AStarGrid2D · Godot documentation
Sources and further reading
Cover photograph: Xbox Wireless Controller black rear by 茅野ふたば. CC BY-SA 4.0. Cropped and typeset for this cover. The photograph illustrates the topic. This image adaptation uses the same share-alike license.
