What's Cool About It?

THE .MAP FILE FORMAT
messy

The .map format. The BUILD .map format, more specifically.
This article discusses the inner workings and nuances of it. Note that the idSoftware .map format is completely different. OK? Good.

From Matt Saettler's Notes and memory.
messy

Typical header with signature.

Header has version. Version 6.03 is unencrypted. Version 7.0 is encrypted (same xor encryption algorithm used in RFF file format).

After header comes (possible encrypted) Information structure. This contains global information like map revision count, 'start' x,y,z, number of walls, sectors, etc. This is the same for 6.03 and 7.0


CryptKey: 0x7474614d

Version 7.0 then has extra information. Info includes copyright. Not sure what else.


CryptKey: numwalls

Next comes


skyofsetts (for moving skys)
CryptKey: buffer size

The Build info and the 'Extra' information. The Extra info is where the blood-specific information is stored. This info is kept in an array by type. The 'extra' member of the base build structure is the array offset into the extra array. If zero, then there is no extra information. see mapedit for access to what the info is; mapedit allows editing of all this structure).

all valid sectors

Sector
CryptKey: map Rev * sizeof(SECTOR) (I was sneaky, using maprev.. So it
changes each time you save it....)
If extra:
Xsector
CryptKey: Unencrypted

All valid walls

wall
CryptKey: map Rev * sizeof(SECTOR) | 0x7474614d
if extra:
xwall
CryptKey: Unencrypted

all valid sprites

sprite
CryptKey: map Rev * sizeof(SPRITE) | 0x7474614d
if extra:
xsprite
CryptKey: UnEncrypted

Last is a CRC of the entire file (to detect modifications)

If you are converting to basic Build files, you can just read and ignore the 'extra' information.

Copyright (c) 2000, Matt Saettler. All Rights Reserved
-------------
Matt Saettler
matts@saettler.com
http://www.saettler.com