![]() Each plane data is compressed by RLEW compression followed by Carmack compression.īecause all planes are 64圆4 grids containing 2-byte values, the decompressed data for each plane should be 8192 bytes long. Some other ID Soft games use a third grid to describe levels (plane 2) so there are pointers to it in the level headers but it is never used in Wolfenstein 3D. The second (plane 1) contains information for things (collectibles, enemies, sprites, pushwalls, etc.). The first (plane 0) contains positions and types of walls, doors and “sectors” (floor tiles are indexed and grouped as rooms). GAMEMAPS.WL6Įach level is represented by two 64圆4 grids of values. The MAPHEAD.WL6 file always has 100 pointers but the ones for which the game has no map are zeroes. Levels are numbered from 00 to 59 (first digit for the episode, second for the level number, 9 being the secret level). The original game had 3 episodes but later versions contained 3 more (the Nocturnal Missions) for a total of 6 episodes. Each episode has 9 regular levels and one secret level. Note: Levels in Wolfenstein 3D are grouped into episodes. Offsets for levels 00 to 99 in GAMEMAPS.WL6 This very short file contains the RLEW tag used for all other RLEW-compressed files (it’s 0xABCD) as well as offsets to the data for each level in the GAMEMAPS.WL6 file: Type See function carmackDecode in js/files.js for an implementation. In that case an extra byte z is read and the word zy is appended to the output. Note: Because 0xA7 and 0xA8 have special meaning, a special case is used to represent directly words that have one of these as second byte: an exception is recognized when x = 0 and y = 0xA7 or 0xA8. x words should be appended to the output from that absolute position. An extra word w should be read that indicates the absolute offset in words from which the repeated sequence starts. if y is 0xA8, it indicates a far pointer.x words should be appended to the output from that position. In that case, an extra byte z should be read that indicates the offset in words (counted backwards from the current location in the output) where the repeated sequence starts. if y is 0xA7, it indicates a near pointer.if y is neither 0xA7 nor 0xA8, append the word xy to the output (no pointer).After this, while there is data to be read (or while the decoded data length is less than the total expected length): Their offsets are encoded on 2 bytes.Īs with RLEW-encoding the first word represents the total length in bytes of the decoded data. Far pointers are absolute addresses from the start of the decoded data (but they point to words so the address in bytes is twice the represented value). The offsets for near pointers are only one byte long so they can only point to one of the last 255 previously decoded words. Near pointers point to an address relative to the current decoding position. There are near pointers and far pointers. Although this idea is similar to Lempel-Ziv compression, pointers to previous patterns are encoded in a more complicated way. The idea is to identify repeating patterns in the data to compress and when such a repetition is found, to describe the repeated pattern by pointing to its previous appearance. Carmack CompressionĬarmack compression is an algorithm designed by John Carmack for ID Soft games. See function rlewDecode in js/files.js for an implementation. if the word is the RLEW tag, read two more words w1 and w2, repeat w1 times the word w2 in the output.While the decoded data length is less than the total length (or while there are bytes to decode):.This is the total length in bytes of the decoded data In the case of RLEW, the considered symbols are words (UInt16LE).Ī special UInt16LE value ( RLEW tag) is used to indicate a repeated value (for Wolfenstein 3D, the tag is the first word in MAPHEAD.WL6, which is 0xABCD). The general idea is that sequences of identical symbols are represented by giving the number of repetitions followed by the symbol, which saves space for files containing long sequences of repeated symbols. Row-length encoding is a commonly used compression algorithm. Two algorithms are used Row-Length Encoding Word (RLEW) Compression Most of the data in the game files is compressed. Note: In all files, all multi-byte integers are stored in little-endian format. MAPHEAD.WL6 contains a list of offsets to the data for each level in the GAMEMAPS.WL6 file.GAMEMAPS.WL6 contains the map data for all levels (walls, enemies, objects, etc.). ![]() VSWAP.WL6 contains the wall textures, the sprite graphics (also the sound effects but not used in this project).Most of the information on this page is taken from Gaarabis’s page (no longer available) and the Wolfenstein wiki.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |