Simple Sokoban skin format
00 |
01 |
02 |
03 |
FLOOR |
PUSHER |
BOX |
|
04 |
05 |
06 |
07 |
GOAL |
PUSHER on Goal |
BOX on Goal |
|
08 |
09 |
10 |
11 |
↑ ← WALL → ↓ |
← WALL → |
WALL- CAP |
Back- ground |
12 |
13 |
14 |
15 |
↑ WALL ↓ |
‾‾ | WALL | __ |
© |
© (settings) |
16 |
17 |
18 |
19 |
↑ PUSHER |
← PUSHER |
↓ PUSHER |
→ PUSHER |
20 |
21 |
22 |
23 |
↑ PUSHER on Goal |
← PUSHER on Goal |
↓ PUSHER on Goal |
→ PUSHER on Goal |
24 |
25 |
26 |
27 |
|
Animation |
Frames |
|
28 |
29 |
30 |
31 |
|
Animation |
Frames |
|
Starting with version 1.0.6 Simplesok uses a modified version of the "Common skin format". Older versions of the game used a custom format.
The "Common skin format" is convention on how individual tiles are placed in skin image, a kind of cross-program standard format.
This makes it possible, to use some skin, i.e. downloaded from the net, which was not designed for it, with Simplesok. There are however some limitations, when doing this.
The common skin is just an image file usually in PNG or BMP format. The skin image is consisted of 4 by 8 tiles, with each tile representing a game element. Skin sizes for each tile can be 16x16, 32x32, 64x64 or any size you like, because Simplesok supports skins of any size.
The drawing shows, how the tiles are placed into the image.
Here is a short description:
- Tile 00 is the FLOOR, that's the background used within the walls.
- Tile 04 is the GOAL, that marks the place, where the boxes go.
- Tile 02 is the BOX itself.
- Tile 01, the pusher is the little guy, who moves the BOXES.
- Tile 05 and tile 06 represent the PUSHER and the BOX, when they are over the GOAL. These can be the same as tile 01 and 02.
- Tile 11 is the Background outside the playfield. It often is the same than tile 00.
- Tiles 08, 09, 10, 12 and 13 are used to build the WALLS. These 5 tiles can be either identical, or they can be used to piece together seamless WALLS. For seamless walls you need 16 tiles, but these can be generated from just those 5 tiles. Tile 10, labeled WALLCAP is a little special. It is used to cover the hole that appears when four walls are placed in a square.
- Tile 14 is used for the copyright.
- Tile 15 is special to a sokoban game named YASC. They call it the SETTINGS tile. We use it for additional copyright information.
- Tile 3 and 7 are not defined and can be used by the programs as desired.
- Tile 16 to 19 are used, when the PUSHER changes when moving into different directions. This is called an ANIMATED PUSHER.
- Tile 20 to 23 are the same when the PUSHER is on the GOAL.
- Tiles > 23 are for video animation frames, strictly optional, and we do not know any Sokoban game, that is using those.
Now we need to talk about the ANIMATED PUSHER and the animation used in Simplesok in general.
The only things that are animated within a Sokoban game are the BOXES and the PUSHER. Most skins, you find on the net, use for both tiles that have a solid background. This has the downside, that the whole tile moves over the background, when the pusher or the box is moving. This makes it impossible to do a smooth, seamless animation. We have to resort to an animation, that "jumps from tile to tile" when using a solid background with the moving tiles.
With the pusher, we have to distinguish 3 different cases:
- The pusher is fixed, not animated, also known as static pusher.
- The pusher looks completely different when changing direction.
- The pusher can be rotated when changing directions.
The 3rd case can only be used with skins, that are created or specially modified for Simplesok. Those skins can not be used with other Sokoban games. These skins make it possible to have smooth, seamless animations by taking advantage of the "chameleon effect". This requires to have a transparent background with the moving tiles and a few other changes.
Here is, what Simplesok does differently:
- tiles 1, 5, 14, 15 and everything at and beyond tile 24 is not used at all by simplesok.
- tile 10 is optional, it may be completely transparent. in such case simplesok detects that it is missing and substitute it with tile 8.
- the height of the skin file must be at least 6 tiles (ie. the tile map must be at least 4x6). Having more rows is fine. Having more columns might also work because simplesok makes a best effort to guess the geometry, but there's no guarantee it will figure out all combinations properly.
- tiles 17, 18, 19 and 21, 22, 23 may be completely transparent. In such case simplesok will rotate the player's character on tiles 16 or 20 to the proper angle with a smooth animation.
- it is recommended that non-floor tiles have a transparent background. Otherwise simplesok won't be able to animate movements.
- wall tiles do not have to cover 100% of the tile (ie. they may contain transparent pixels), because a floor tile is always drawn under them.
documentation written and maintained by Friedhelm Mehnert