God of Thunder Level Format
The God of Thunder Level Format is used by God of Thunder to store each game level.
The file consists of multiple 512-byte levels, one after the other. There is no global header. Each level is structured as follows.
There is no signature, however careful processing of the files can be used to check whether the format is correct:
- There are 230 tiles in the background layer, so no background code should be larger than 229.
- There are 32 tiles in the object layer, so no object ID should be larger than 31.
The file contains two layers.
|UINT8||background||Background layer, one byte for each of the 20×12 cells in the map|
|UINT8||defaultBG||Tile to draw behind other background tiles that have transparent areas (e.g. rocks)|
|UINT8||song||ID of song How does this map to song files?|
|UINT8||actorID||IDs of 16 actors|
|UINT8||actorPos||Coordinates of each object (y × 20 + x)|
|UINT8||objectID||IDs of 30 objects|
|UINT16LE||objectX||X-coordinate of each object|
|UINT16LE||objectY||Y-coordinate of each object|
|UINT8||holeScreen||Destination screen number of each hole/door (one value for tiles 0xDC to 0xE5 inclusive)|
|UINT8||holeDestPos||Player target position on destination screen (y × 20 + x)|
Each code in the background layer is a tile index in the corresponding sdat file.
Each actor ID refers to the file with that ID - so an actor ID of 2 would mean the file named 'actor2'. Actor ID 0 is used if no actor is at that entry. The positions refer to tiles - 0,0 being top left of the map and 19, 11 being bottom-right.
Each object ID is an index into the objects tileset. An object ID of 1 maps to the first tile, ID 2 maps to the second tile, etc. Object ID 0 is used if no object is at that entry. The position is the cell number, with cell 0 being the top-left and cell 239 being the bottom-right.
Screen arrangement, holes and doors
The screens are arranged left to right, ten levels wide. Moving off the left or right of the screen subtracts or adds one to the screen number respectively. Moving off the top or bottom subtracts or adds 10 to the screen number.
Tile numbers 0xDC through 0xE5 are doorways. Some look like holes, while others look like ladders out of the hole. In an underground level, the exit back to the surface must use one of the ladder tiles, otherwise it will simply scroll to the next screen like normal. This is not usually the intention when returning to the surface as there is less control over where the player appears.
The first value in holeScreen is for tile 0xDC, and the last value is for tile 0xE5. Likewise for holeDestPos which specifies the player's position on the destination screen.
|Episode||Song ID||Song filename|
This file format was reverse engineered by Malvineous. 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!)