Gods Tileset Format
| Format type | Tileset |
|---|---|
| Hardware | EGA, VGA |
| Max tile count | 240 |
| Palette | External |
| Tile names? | No |
| Minimum tile size (pixels) | 32×16 |
| Maximum tile size (pixels) | 32×16 |
| Plane count | 4 |
| Plane arrangement | DEGAS word-interleaved |
| Transparent pixels? | No |
| Hitmap pixels? | No |
| Metadata? | None |
| Supports sub-tilesets? | No |
| Compressed tiles? | Yes |
| Hidden data? | No |
| Games |
The background tiles for each level of Gods are stored in PBITSnx.PI1, where n is the world (1-4) and x the sublevel (A or B). Levels that need more than 120 tiles also have a PXTRAnx.PI1 file holding the extra tiles. Only four such files exist: PXTRA1B, PXTRA2A, PXTRA3A and PXTRA4B.
Both are ordinary Gods Image Format files (DEGAS images, compressed with PKWARE DCL Compression). The tiles are simply laid out on the 320×200 picture in a grid.
File format
Tiles are 32×16 pixels. They are read left to right, top to bottom, 10 tiles per row, so tile i is found at:
x = (i % 10) * 32 y = (i / 10) * 16
Twelve rows of ten fill 320×192 pixels, giving a maximum of 120 tiles per sheet. The bottom 8 lines are unused.
Tile numbering
The number of tiles a level uses is not stored in any data file. It comes from a small table in GAME.EXE:
| Level | Tiles | Files used |
|---|---|---|
| 1A | 110 | PBITS1A |
| 1B | 126 | PBITS1B + 6 from PXTRA1B |
| 2A | 133 | PBITS2A + 13 from PXTRA2A |
| 2B | 118 | PBITS2B |
| 3A | 124 | PBITS3A + 4 from PXTRA3A |
| 3B | 110 | PBITS3B |
| 4A | 118 | PBITS4A |
| 4B | 123 | PBITS4B + 3 from PXTRA4B |
Tiles 0-119 come from the PBITS sheet. When the count is above 120, tiles 120 and up are taken from the start of the PXTRA sheet. The game only tries to open PXTRA when the count is above 120, which is why the other four levels have no such file. The value stored in the level map (plane A of the Gods Map Format) is the tile number.
Palette
The palette stored in these files is garbage and must be ignored. The tiles are drawn with the level palette, taken from PLEVELnB.PI1 with colours 0 and 1 replaced by black and blue. See Gods Image Format#Level palettes.
Collision
The tiles carry no collision information. Whether a cell is solid, a ladder or empty is stored separately in plane B of the level map.
Source code
From re-gods, the open-source HTML5 port:
- src/formats/pi1.js – tile sheet slicer (sliceTiles)
- src/formats/map.js – per-level tile counts (TILE_COUNTS)
Credits
This file format was reverse engineered by VorticonCmdr. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)