Cloudy background
Sokoban Logo
Padfile logotype
 
Sokoban Level Identity


Here is a description of algorithms that calculates an identity for a given Sokoban level. There are two types of identities. The Unique-Id and the Exact-Id. Both are based only on the playable part of the level. Try the LEVEL IDENTITY CALCULATOR on your own level.
  • Unique-Id is independent of rotations and mirroring and of the initial position of the man. Unique-Id can be used to determine if two levels are duplicates or not.
  • Exact-Id is based on the exact layout of the playable part of the level. Exact-Id can be used to match a solution with a level.
level_id picture 1
1
Fill the playable area of the level. Start at the "man" position and recursively fill neighbouring squares until you hit a wall. The result is shown in red here.
level_id picture 2
2
Fill with walls. Change every square that is not marked, to wall. This eliminates everything outside the playable area.
level_id picture 3
3
Reduce walls. Make the four outer walls exactly one unit thick at its thinnest.
level_id picture 4
4
Now the level is ready for the Unique-Id calculation.
level_id picture 5
5
Encode the level, using the usual characters ( $@#.+*). Each line must be terminated with newline (hex 0A).

#
  Wall
$
  Package
space
  Floor
.
  Goal
*
  Package on Goal
@
  Sokoban
+
  Sokoban on Goal
      ###########
      ##### *. ##
      ####  @# ##
      #  $.$#####
      #   #  $ .#
      ##### $  .#
      ###########
6
Calculate an MD5 message digest of the string from step 5. The calculated sum is 32 characters long, but only the first 16 are used. MD5 is available in most programming and scripting languages.The specification can be found here RFC 1321. The result in this example is: 4C58C6973860C790.
7
To calculate the Unique-Id, put the man in every possible position that can be reached from the initial position. This is done since this move is a trivial variation of the original level.
level_id picture 5
8
Rotate and mirror the level in all possible combinations and repeat steps 5 and 6. This produces eight different MD5 sums. Final step is to select the numerically smallest of the eight sums. In this case the level identity is: 1674E2D1AC70B61C.

Try the LEVEL IDENTITY CALCULATOR.

Note that there is a (very) slight risk that two totally different levels will produce the same identity.
49E47127B88A5490
B26AE7764B4984C1
1BC4A18F1B91726C
B1BEE44D8D44F8DC
1674E2D1AC70B61C
9745BF55B27DC965
28573C1F952FD18A
60598C834B8313D0
            
 
anonymous2011-12-21 09:48
level 81 from which levelset ?
isa2011-12-21 19:06
level 81 thomas reinke, 4:4? please
jonathan2011-12-22 15:05
It\'s great. I love it. It blows my and thou mind
isa2011-12-22 19:38
that level has solutions?
Björn2011-12-23 07:57
81 level 4 has solutions. Check here to see still unsolved levels.
Konstantin2011-12-27 00:40
Light up the candels with this Sokoban: http://landkey.net/gio/gio/bs/
roshan2011-12-27 16:28
solution to level 38 please!
anonymous2012-01-02 10:26
look at the forum
Nome2012-01-04 10:36
Do anyone play Zingmagic sokoban on mobile?
Nome2012-01-04 10:39
I think some levels of Zingmagic are unplayable like 14,16,18.21.22 etc....
encarna2012-01-26 14:00
serena 1 nivel 24 solucion
sancor2012-01-31 02:09
someone know were to find the levels of the month of mic? thanx
sancor2012-01-31 02:09
for free...
anonymous2012-01-31 10:00
you find the levels of the month from mic on games4brains.de
anonymous2012-01-31 10:06
--- or at sokofun.de
sancor2012-02-01 21:41
yes, i know that, but i\'m greedy, i want em all, of at least a bunch of them, a collection.
sancor2012-02-01 21:45
hey, i downloaded this sokoban 3.2 build 10 for windows, the problem is that it closes for itself after playing two minutes.
Björn2012-02-01 22:30
This problem should be solved in 3.2.11
anonymous2012-02-03 05:36
letslogic.com might have them
Björn2012-02-04 11:28
IMPORTANT! 3.2 build 10 has a serious bug. UPGRADE to 3.2 build 11 asap.
Submit