Sokoban level format

All about creating levels and level sets, custom elements and custom artwork.

Moderators: Flumminator, Zomis

Post Reply
Cosmos
Posts: 6
Joined: Tue Feb 13, 2024 6:09 pm

Sokoban level format

Post by Cosmos »

I'd like to convert Sokoban David W. Skinner's legendary levels: Sasquatch 1-12, Microban 1-5 and maybe others. I know that some of them are already converted into RnD format, but there are a lot of errors so levels are unsolvable; look here for example: https://api.artsoft.org/levelsets/view/790. As there are some hundreds of levels and they are done already, is there some converter from any format?

Or maybe there is somewhere level format specification, so I can make such a converter myself? I'm a computer programmer.
User avatar
Holger
Site Admin
Posts: 4122
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Sokoban level format

Post by Holger »

Thanks a lot for bringing the case of the classic Sokoban level sets (especially those of David W. Skinner) back to my attention! :)

In fact, you do not need a converter! And you don't have to be a programmer to convert them for R'n'D! :-)

It may be long forgotten (I think it was discussed decades ago in this or one of the two previous R'n'D forums), but R'n'D can read original Sokoban levels in classic text format out of the box!

To see how it works, I have attached an attempt for a new Sokoban level collection that I created in 2010 for Jürgen Bonhagen (who also has released selected Sokoban level sets in his own level collections, together with his own custom artwork). It mainly shows two things:

a) Using the "filename: <filename>" option in file "levelinfo.conf" to specify using a native Sokoban text level file.
b) Using the "special_flags: load_xsb_to_ces" option in file "levelinfo.conf" to specify using custom elements.

For the first option, see the level set "sb_microban_1" in the attached level collection, for example. The file "Sokoban-UNRELEASED/sb_microban_1/levelinfo.conf" contains the line "filename: sb_microban_1.xsb", which just means to use the Sokoban levels in text format from the specified file (in this case, this is file "Sokoban-UNRELEASED/sb_microban_1/sb_microban_1.xsb"). As far as I can tell, many classic (pre-R'n'D) Sokoban levels are already distributed in that format. So R'n'D can directly use them by simply adding a properly prepared "levelinfo.conf" file!

Regarding the second option (which you can find in the top-level file "Sokoban-UNRELEASED/levelinfo.conf"), this simply tells R'n'D to map all Sokoban game elements from the text format level file to R'n'D custom elements (CEs), which could then decorated with animations or changed to the original Sokoban elements (as needed to play the game). In this example level set, all Sokoban elements look like dynamite and explode to their Sokoban element counterparts after starting the game.

These specific custom elements are defined in a level template (file "Sokoban-UNRELEASED/template.level") which can be edited and saved from the R'n'D level editor.

As you most probably don't want such "special effects" (which is really just an example here), just delete or uncomment the line "special_flags: load_xsb_to_ces" from file "Sokoban-UNRELEASED/levelinfo.conf", and you will just have the plain Sokoban levels, ready to play in R'n'D!

I hope this helps! :)

As this example level set only contains the level sets Microban 1 - 3 and Sasquatch 1 - 10, you might be able to put together a more complete level collection for those classic Sokoban level sets! I will be happy to release the final package on my web site, and properly announce it for others to play them! :-)
Attachments
Sokoban-UNRELEASED.zip
(48.86 KiB) Downloaded 26 times
Cosmos
Posts: 6
Joined: Tue Feb 13, 2024 6:09 pm

Re: Sokoban level format

Post by Cosmos »

Thank you for clarification. Job is done.
Attachments
Sokoban levels.7z
(48.49 KiB) Downloaded 22 times
Post Reply