Ultima 9 terrain.* file format ============================== Revision 1.00 7th Jan 2002 Offset Size Description 0 DWORD Width of Map (in tiles... 128 game coord's per tile) 4 DWORD Height of Map (in tiles... 128 game coord's per tile) 8 0x80 Name of Map 0x88 DWORD Water Height 0x8C DWORD ?? 0x90 DWORD Environment type 0x94 DWORD ?? 0x98 H*W/0x80 Chunk Table Chunk Data Follows (size undeterminable... just keeps going till end of file) Chunk Table ----------- There is a word here for every 16x16 block on the map, which assigns a certain chunk to it. Eg First word might be 0000. This will mean that block's chunk will be the very first in the chunk data area. Chunk Data Area --------------- Chunks are divided into areas of 16 tiles x 16 tiles. There are 4 bytes per tile : ------- end of file this way ---------> byte1 byte2 byte3 byte4 1234 5678 1234 5678 1234 5678 1234 5678 \____________/ |\/ \__/ \_________/ | | | | | height | | frame type | dir texture on/off height : height of tile's southwest vertex texture on/off : 1 to display a texture, 0 for invisible surface dir : orientation of texture. 0=top faces north ; 1=east ; 2=south ; 3=west type : texture index for bitmap*.flx frame : frame number for that type Environment types ----------------- bit 1 = dungeon/darkness 2 = scrolling map (ie loops) 4 = ? 8 = ? 16 = ? 32 = ? 64 = ? 128 = ? Written by John Larcombe aka TumbleWeed Dragon tumble_weed@hotmail.com http://www.iinet.net.au/~larcombe