THE .MAP FILE FORMAT
The .map format. The BUILD .map format, more specifically.
From Matt Saettler's Notes and memory.
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
Version 7.0 then has extra information. Info includes copyright. Not sure
what else.
Next comes
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).
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
This article discusses the inner workings and nuances of it. Note that the idSoftware .map format is completely different. OK? Good.
CryptKey: 0x7474614d
CryptKey: numwalls
skyofsetts (for moving skys)
CryptKey: buffer size
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
-------------
Matt Saettler
matts@saettler.com
http://www.saettler.com