God of Thunder Level Format

From ModdingWiki
Jump to navigation Jump to search
God of Thunder Level Format
God of Thunder Level Format.png
Format typeMap/level
Map type2D tile-based
Layer count3
Tile size (pixels)16×16
Viewport (pixels)320×192
Games

The God of Thunder Level Format is used by God of Thunder to store each game level.

File format

The file consists of multiple 512-byte levels, one after the other. There is no global header. Each level is structured as follows.

Signature

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.

Content

The file contains two layers.

Data type Name Description
UINT8[240] 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[16] actorID IDs of 16 actors, 0 = no actor
UINT8[16] actorPos Coordinates in tiles of each object (y × 20 + x)
UINT8[16] actorValue pass value ?
UINT8[3] palColors change 251,253,254 to these three
UINT8[16] actorInvis 0 = Visible; 1 = Invisible or swap?
UINT8[13] extra not used
UINT8[30] objectID IDs of 30 objects, 0 = no object, static objects (treasure, keys,etc)
UINT16LE[30] objectX X-coordinate of each object
UINT16LE[30] objectY Y-coordinate of each object
UINT8[10] holeScreen Destination screen number of each hole/door (one value for tiles 0xDC to 0xE5 inclusive)
UINT8[10] holeDestPos Player target position on destination screen (y × 20 + x)
UINT8[16] actorDir Actor initial dir
UINT8[3] future

Tile mapping

Each code in the background layer is a tile index in the corresponding sdat[123] 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 position is the cell number, with cell 0 being the top-left and cell 239 being the 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 positions (x,y) refer to tiles - 0,0 being top left of the map and 19, 11 being bottom-right. It's an integer, although I don't know why because it's just a screen and it's in tiles, X max = 19, Y max = 11

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.

Songs

Episode Song ID Song filename
1 0 song1
1 1 song2
1 2 song3
1 3 song4
1 4 winsong
1 5 bosssong
1 >=6 song33

Credits

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!)