<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://moddingwiki.shikadi.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Congusbongus</id>
	<title>ModdingWiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://moddingwiki.shikadi.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Congusbongus"/>
	<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/wiki/Special:Contributions/Congusbongus"/>
	<updated>2026-05-14T02:50:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=12410</id>
		<title>Super 3-D Noah&#039;s Ark</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=12410"/>
		<updated>2025-07-29T13:27:40Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: Add music tables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Yes&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the PC version of the game &#039;&#039;&#039;Super 3D Noah&#039;s Ark&#039;&#039;&#039; by Wisdom Tree Games. It uses a modified (licensed) version of the [[Wolfenstein 3-D]] engine, with added support for textured floors and ceilings. Super 3D Noah&#039;s Ark&#039;s [https://web.archive.org/web/20151003140316/www.wisdomtreegames.com/games/super3dnoahsark/ original homepage went down around 2015], but the game is still available [https://www.gog.com/en/game/super_3d_noahs_ark on GOG.com] and [https://wisdomtree.itch.io/s3dna itch.io].&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
As the game uses a licensed version of the [[Wolfenstein 3-D]] engine, it shares many of the same file formats, although some have been enhanced.&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audiot.n3d&amp;lt;br/&amp;gt;audiohed.n3d&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sound effects and music.  Note however the files are empty, as the game stores Ogg Vorbis music in a WAD file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = maphead.n3d&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.pk3&lt;br /&gt;
 | Format = PK3 file (ZIP)&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains mainly formatted text files of actor parameters, level parameters, strings and quiz questions.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.wad&lt;br /&gt;
 | Format = [[WAD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive containing Ogg Vorbis music files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = vswap.n3d&lt;br /&gt;
 | Format = Wolf3D VSWAP file&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains sprites, textures and sounds at 11025 Hz&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
The following is a list of sounds in the VSWAP file&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Antelope alert&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Bear alert&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Item pickup&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Camel alert&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Door close&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Cantaloupe hit&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Cantaloupe feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Goat kick&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Animal falling asleep&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Elephant alert&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Life powerup&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Super feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Giraffe alert&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Goat alert&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Small feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 16 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Kangaroo alert&lt;br /&gt;
|-&lt;br /&gt;
| 18 || Level end&lt;br /&gt;
|-&lt;br /&gt;
| 19 || Hand feed&lt;br /&gt;
|-&lt;br /&gt;
| 20 || Monkey alert&lt;br /&gt;
|-&lt;br /&gt;
| 21 || Bear walk&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Door open&lt;br /&gt;
|-&lt;br /&gt;
| 23 || Ostrich alert&lt;br /&gt;
|-&lt;br /&gt;
| 24 || Ox alert&lt;br /&gt;
|-&lt;br /&gt;
| 25 || Player hurt&lt;br /&gt;
|-&lt;br /&gt;
| 26 || Game over&lt;br /&gt;
|-&lt;br /&gt;
| 27 || Secret door&lt;br /&gt;
|-&lt;br /&gt;
| 28 || Sheep alert&lt;br /&gt;
|-&lt;br /&gt;
| 29 || Large feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 30 || Animal spit&lt;br /&gt;
|-&lt;br /&gt;
| 31 || Watermelon hit&lt;br /&gt;
|-&lt;br /&gt;
| 32 || Watermelon feeder shoot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Music ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Name !! Used In&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||  || Intro&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ALLGOOD || End of game level&lt;br /&gt;
|-&lt;br /&gt;
| 2 ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 3 ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || FEEDTIME || End of level&lt;br /&gt;
|-&lt;br /&gt;
| 5 ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 ||  || Boss levels&lt;br /&gt;
|-&lt;br /&gt;
| 7 ||  ||&lt;br /&gt;
|-&lt;br /&gt;
| 8 ||  || Menus&lt;br /&gt;
|-&lt;br /&gt;
| 9 || HAPPYSNG ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 ||  || High scores&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Level !! Music&lt;br /&gt;
|-&lt;br /&gt;
| E1L1 || 0&lt;br /&gt;
|-&lt;br /&gt;
| E1L2 || 1&lt;br /&gt;
|-&lt;br /&gt;
| E1L3 || 6&lt;br /&gt;
|-&lt;br /&gt;
| E2L1 || 2&lt;br /&gt;
|-&lt;br /&gt;
| E2L2 || 0&lt;br /&gt;
|-&lt;br /&gt;
| E2L3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| E2L4 || 6&lt;br /&gt;
|-&lt;br /&gt;
| E3L1 || 3&lt;br /&gt;
|-&lt;br /&gt;
| E3L2 || 2&lt;br /&gt;
|-&lt;br /&gt;
| E3L3 || 0&lt;br /&gt;
|-&lt;br /&gt;
| E3L4 || 6&lt;br /&gt;
|-&lt;br /&gt;
| E3L5 || 8&lt;br /&gt;
|-&lt;br /&gt;
| E4L1 || 5&lt;br /&gt;
|-&lt;br /&gt;
| E4L2 || 3&lt;br /&gt;
|-&lt;br /&gt;
| E4L3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| E4L4 || 2&lt;br /&gt;
|-&lt;br /&gt;
| E4L5 || 6&lt;br /&gt;
|-&lt;br /&gt;
| E5L1 || 7&lt;br /&gt;
|-&lt;br /&gt;
| E5L2 || 0&lt;br /&gt;
|-&lt;br /&gt;
| E5L3 || 5&lt;br /&gt;
|-&lt;br /&gt;
| E5L4 || 3&lt;br /&gt;
|-&lt;br /&gt;
| E5L5 || 9&lt;br /&gt;
|-&lt;br /&gt;
| E5L6 || 6&lt;br /&gt;
|-&lt;br /&gt;
| E6L1 || 10&lt;br /&gt;
|-&lt;br /&gt;
| E6L2 || 1&lt;br /&gt;
|-&lt;br /&gt;
| E6L3 || 2&lt;br /&gt;
|-&lt;br /&gt;
| E6L4 || 7&lt;br /&gt;
|-&lt;br /&gt;
| E6L5 || 5&lt;br /&gt;
|-&lt;br /&gt;
| E6L6 || 6&lt;br /&gt;
|-&lt;br /&gt;
| End of game || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://hwolf3d.dugtrio17.com/index.php?section=hwe Havoc&#039;s Wolf3D Editor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://slade.mancubus.net SLADE]&lt;br /&gt;
| Platform = Windows/Mac&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
| notes = Slade erroneously uses Wolf3D&#039;s sample rate of 7042Hz, instead of 11025Hz, so the sounds are too slow&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Wolfenstein 3-D]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=12409</id>
		<title>Super 3-D Noah&#039;s Ark</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=12409"/>
		<updated>2025-07-28T13:13:14Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: add itch link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Yes&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the PC version of the game &#039;&#039;&#039;Super 3D Noah&#039;s Ark&#039;&#039;&#039; by Wisdom Tree Games. It uses a modified (licensed) version of the [[Wolfenstein 3-D]] engine, with added support for textured floors and ceilings. Super 3D Noah&#039;s Ark&#039;s [https://web.archive.org/web/20151003140316/www.wisdomtreegames.com/games/super3dnoahsark/ original homepage went down around 2015], but the game is still available [https://www.gog.com/en/game/super_3d_noahs_ark on GOG.com] and [https://wisdomtree.itch.io/s3dna itch.io].&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
As the game uses a licensed version of the [[Wolfenstein 3-D]] engine, it shares many of the same file formats, although some have been enhanced.&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audiot.n3d&amp;lt;br/&amp;gt;audiohed.n3d&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sound effects and music.  Note however the files are empty, as the game stores Ogg Vorbis music in a WAD file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = maphead.n3d&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.pk3&lt;br /&gt;
 | Format = PK3 file (ZIP)&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains mainly formatted text files of actor parameters, level parameters, strings and quiz questions.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.wad&lt;br /&gt;
 | Format = [[WAD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive containing Ogg Vorbis music files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = vswap.n3d&lt;br /&gt;
 | Format = Wolf3D VSWAP file&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains sprites, textures and sounds at 11025 Hz&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
The following is a list of sounds in the VSWAP file&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Antelope alert&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Bear alert&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Item pickup&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Camel alert&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Door close&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Cantaloupe hit&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Cantaloupe feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Goat kick&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Animal falling asleep&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Elephant alert&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Life powerup&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Super feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Giraffe alert&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Goat alert&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Small feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 16 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Kangaroo alert&lt;br /&gt;
|-&lt;br /&gt;
| 18 || Level end&lt;br /&gt;
|-&lt;br /&gt;
| 19 || Hand feed&lt;br /&gt;
|-&lt;br /&gt;
| 20 || Monkey alert&lt;br /&gt;
|-&lt;br /&gt;
| 21 || Bear walk&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Door open&lt;br /&gt;
|-&lt;br /&gt;
| 23 || Ostrich alert&lt;br /&gt;
|-&lt;br /&gt;
| 24 || Ox alert&lt;br /&gt;
|-&lt;br /&gt;
| 25 || Player hurt&lt;br /&gt;
|-&lt;br /&gt;
| 26 || Game over&lt;br /&gt;
|-&lt;br /&gt;
| 27 || Secret door&lt;br /&gt;
|-&lt;br /&gt;
| 28 || Sheep alert&lt;br /&gt;
|-&lt;br /&gt;
| 29 || Large feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 30 || Animal spit&lt;br /&gt;
|-&lt;br /&gt;
| 31 || Watermelon hit&lt;br /&gt;
|-&lt;br /&gt;
| 32 || Watermelon feeder shoot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://hwolf3d.dugtrio17.com/index.php?section=hwe Havoc&#039;s Wolf3D Editor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://slade.mancubus.net SLADE]&lt;br /&gt;
| Platform = Windows/Mac&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
| notes = Slade erroneously uses Wolf3D&#039;s sample rate of 7042Hz, instead of 11025Hz, so the sounds are too slow&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Wolfenstein 3-D]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Crystal_Caves_Sound_format&amp;diff=12161</id>
		<title>Crystal Caves Sound format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Crystal_Caves_Sound_format&amp;diff=12161"/>
		<updated>2025-03-09T05:56:40Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: Fix order of data in info table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Sound Infobox&lt;br /&gt;
 | Type = PC Speaker&lt;br /&gt;
 | Count = 12&lt;br /&gt;
 | NumChannels = 1&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Tags = None&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Crystal Caves}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
Files in [[Crystal Caves]] sound format do not contain a header or sound names, and sounds are of a fixed length. (610 bytes.)&lt;br /&gt;
&lt;br /&gt;
The sounds are stored in the files &amp;lt;tt&amp;gt;CCx-y.SND&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;SAMx0yE.SND&amp;lt;/tt&amp;gt; for [[Secret Agent]]); 12 sounds to a file.&lt;br /&gt;
&lt;br /&gt;
The sound data itself consists of an array of two-byte values each giving a tone frequency in Hertz. (Larger value, higher pitch.) with a value of -1 ending the sound. (There is one terminator at the sound play end and another at the sound data end, just to be sure.) The actual sound data takes up the first 600 bytes of the sound, the last 10 being a number of attributes as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[SINT16LE]][300] || data || Sound data (frequencies in Hertz)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || priority || Whether or not sound will be interrupted by another sound if said sound starts playing while the first is. Sounds can only be interrupted by sounds that have an equal or higher value of this.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || unknown || {{TODO|Unknown}}&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || vibrate || A divider for the vibrate; this changes a sound&#039;s tone by periodicly switching off the PC speaker. (But at a more rapid rate than would be achieved by simply adding silences to the sound data.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] || unknown2 || {{TODO|Unknown}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;pascal&amp;quot;&amp;gt;&lt;br /&gt;
{Sound player for Crystal Caves and Secret Agent}&lt;br /&gt;
{Created by K1n9_Duk3 in January 2015, based on a partial disassembly}&lt;br /&gt;
&lt;br /&gt;
program CCSASound;&lt;br /&gt;
&lt;br /&gt;
uses Dos, Crt;&lt;br /&gt;
&lt;br /&gt;
type&lt;br /&gt;
  TSound = record&lt;br /&gt;
    fData: array [1..300] of Word;&lt;br /&gt;
    fPriority: Word;&lt;br /&gt;
    fUnknown1: Word;&lt;br /&gt;
    fVibrate: Word;&lt;br /&gt;
    fUnknown2: Word;&lt;br /&gt;
    fUnknown3: Word;&lt;br /&gt;
  end;&lt;br /&gt;
  TSoundFile = record&lt;br /&gt;
    fSounds: array [1..12] of TSound;&lt;br /&gt;
  end;&lt;br /&gt;
  PSoundFile = ^TSoundFile;&lt;br /&gt;
  PByte = ^Byte;&lt;br /&gt;
&lt;br /&gt;
var&lt;br /&gt;
  OldInt: Pointer;&lt;br /&gt;
&lt;br /&gt;
  SoundsOn, SoundIsPlaying: Boolean;&lt;br /&gt;
  TickCount: Word;&lt;br /&gt;
  sndIndex, sndNumberInFile, sndFileNumber: Word;&lt;br /&gt;
  sndFiles: array [1..3] of PSoundFile;&lt;br /&gt;
&lt;br /&gt;
procedure SoundService; interrupt;&lt;br /&gt;
begin&lt;br /&gt;
  asm cli end;&lt;br /&gt;
  if (SoundIsPlaying) then begin&lt;br /&gt;
    Sound(sndFiles[sndFileNumber]^.fSounds[sndNumberInFile].fData[sndIndex]);&lt;br /&gt;
    Inc(sndIndex);&lt;br /&gt;
    if (sndIndex mod sndFiles[sndFileNumber]^.fSounds[sndNumberInFile].fVibrate &amp;lt;&amp;gt; 0)&lt;br /&gt;
      then NoSound;&lt;br /&gt;
    if (sndFiles[sndFileNumber]^.fSounds[sndNumberInFile].fData[sndIndex] = $FFFF) then begin&lt;br /&gt;
      SoundIsPlaying := FALSE;&lt;br /&gt;
      sndIndex := 1;&lt;br /&gt;
      NoSound;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
  Inc(TickCount);&lt;br /&gt;
  asm sti end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
procedure PlaySound(soundNum:Word);&lt;br /&gt;
var oldFileNum, oldSndNumInFile:Word;&lt;br /&gt;
begin&lt;br /&gt;
  oldFileNum := sndFileNumber;&lt;br /&gt;
  oldSndNumInFile := sndNumberInFile;&lt;br /&gt;
  if (SoundsOn) then begin&lt;br /&gt;
    if (SoundIsPlaying) then begin&lt;br /&gt;
      sndFileNumber := 1 + (soundNum-1) div 12;&lt;br /&gt;
      sndNumberInFile := 1 + (soundNum-1) mod 12;&lt;br /&gt;
      if (&lt;br /&gt;
        sndFiles[sndFileNumber]^.fSounds[sndNumberInFile].fPriority&lt;br /&gt;
        &amp;gt;=&lt;br /&gt;
        sndFiles[oldFileNum]^.fSounds[oldSndNumInFile].fPriority&lt;br /&gt;
      ) then begin&lt;br /&gt;
        sndIndex := 1;&lt;br /&gt;
        SoundIsPlaying := TRUE;&lt;br /&gt;
      end else begin&lt;br /&gt;
        sndFileNumber := oldFileNum;&lt;br /&gt;
        sndNumberInFile := oldSndNumInFile;&lt;br /&gt;
      end;&lt;br /&gt;
    end else begin&lt;br /&gt;
      sndFileNumber := 1 + (soundNum-1) div 12;&lt;br /&gt;
      sndIndex := 1;&lt;br /&gt;
      SoundIsPlaying := TRUE;&lt;br /&gt;
      sndNumberInFile := 1 + (soundNum-1) mod 12;&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
procedure WaitSoundDone;&lt;br /&gt;
begin&lt;br /&gt;
     while (SoundIsPlaying) do;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
procedure StartSoundService;&lt;br /&gt;
begin&lt;br /&gt;
  SoundIsPlaying := FALSE;&lt;br /&gt;
  GetIntVec($1c, OldInt);&lt;br /&gt;
  SetIntVec($1c, Addr(SoundService));&lt;br /&gt;
  asm&lt;br /&gt;
    push bx&lt;br /&gt;
    push ax&lt;br /&gt;
    mov bx, 2147h&lt;br /&gt;
    cli&lt;br /&gt;
    mov al, 36h&lt;br /&gt;
    out 43h, al&lt;br /&gt;
    mov al, 0&lt;br /&gt;
    mov al, bl&lt;br /&gt;
    out 40h, al&lt;br /&gt;
    mov al, bh&lt;br /&gt;
    out 40h, al&lt;br /&gt;
    sti&lt;br /&gt;
    pop ax&lt;br /&gt;
    pop bx&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
procedure StopSoundService;&lt;br /&gt;
begin;&lt;br /&gt;
  SoundIsPlaying := FALSE;&lt;br /&gt;
  SetIntVec($1c, OldInt);&lt;br /&gt;
  asm&lt;br /&gt;
    push ax&lt;br /&gt;
    cli&lt;br /&gt;
    mov al, 36h&lt;br /&gt;
    out 43h, al&lt;br /&gt;
    mov al, 0&lt;br /&gt;
    out 40h, al&lt;br /&gt;
    out 40h, al&lt;br /&gt;
    sti&lt;br /&gt;
    pop ax&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
var REV_TABLE: array[0..255] of byte;&lt;br /&gt;
&lt;br /&gt;
procedure DecryptData(dataptr: PByte; size:Word);&lt;br /&gt;
const&lt;br /&gt;
  XOR_KEY  : array [0..27] of byte = ($43, $6F, $70, $79, $72, $69, $67, $68, $74, $20, $31, $39, $39, $31,&lt;br /&gt;
                                      $20, $50, $65, $64, $65, $72, $20, $4A, $75, $6E, $67, $63, $6B, $00);&lt;br /&gt;
var&lt;br /&gt;
  counter: byte;&lt;br /&gt;
  i,b:Byte;&lt;br /&gt;
begin&lt;br /&gt;
  if REV_TABLE[1] &amp;lt;&amp;gt; $80 then&lt;br /&gt;
  for i:= 0 to 255 do begin&lt;br /&gt;
    b := ((i and $0F) shl 4) or ((i and $F0) shr 4);&lt;br /&gt;
    b := ((b and $33) shl 2) or ((b and $CC) shr 2);&lt;br /&gt;
    b := ((b and $55) shl 1) or ((b and $AA) shr 1);&lt;br /&gt;
    REV_TABLE[i] := b&lt;br /&gt;
  end;&lt;br /&gt;
  counter := 0;&lt;br /&gt;
  while size &amp;gt; 0 do begin&lt;br /&gt;
    dataptr^ := REV_TABLE[dataptr^] xor XOR_KEY[counter];&lt;br /&gt;
    Inc(counter);&lt;br /&gt;
    if counter = 28 then counter := 0;&lt;br /&gt;
    Inc(dataptr);&lt;br /&gt;
    Dec(size);&lt;br /&gt;
  end&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
procedure LoadSoundsSA;&lt;br /&gt;
var&lt;br /&gt;
  source: file of TSoundFile;&lt;br /&gt;
  name: string;&lt;br /&gt;
  i: byte;&lt;br /&gt;
begin&lt;br /&gt;
  name := &#039;SAM101E.SND&#039;;&lt;br /&gt;
  for i := 1 to 3 do begin&lt;br /&gt;
    sndFiles[i] := New(PSoundFile);&lt;br /&gt;
    Assign(source, name);&lt;br /&gt;
    Reset(source);&lt;br /&gt;
    Read(source, sndFiles[i]^);&lt;br /&gt;
    Close(source);&lt;br /&gt;
    Inc(name[6]);&lt;br /&gt;
    DecryptData(Addr(sndFiles[i]^), 7320);&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
procedure LoadSoundsCC;&lt;br /&gt;
var&lt;br /&gt;
  source: file of TSoundFile;&lt;br /&gt;
  name: string;&lt;br /&gt;
  i: byte;&lt;br /&gt;
begin&lt;br /&gt;
  name := &#039;CC1-1.SND&#039;;&lt;br /&gt;
  for i := 1 to 3 do begin&lt;br /&gt;
    sndFiles[i] := New(PSoundFile);&lt;br /&gt;
    Assign(source, name);&lt;br /&gt;
    Reset(source);&lt;br /&gt;
    Read(source, sndFiles[i]^);&lt;br /&gt;
    Close(source);&lt;br /&gt;
    Inc(name[5]);&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
var i:Byte;&lt;br /&gt;
begin&lt;br /&gt;
  LoadSoundsCC;&lt;br /&gt;
  StartSoundService;&lt;br /&gt;
  SoundsOn := TRUE;&lt;br /&gt;
&lt;br /&gt;
  for i:= 1 to 36 do begin&lt;br /&gt;
    PlaySound(i);&lt;br /&gt;
    writeln(&#039;Now playing sound #&#039;, i);&lt;br /&gt;
    WaitSoundDone;&lt;br /&gt;
    Delay(500);&lt;br /&gt;
  end;&lt;br /&gt;
&lt;br /&gt;
  StopSoundService;&lt;br /&gt;
end.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11845</id>
		<title>Super 3-D Noah&#039;s Ark</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11845"/>
		<updated>2024-03-30T07:44:30Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: fix some sounds&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Yes&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the PC version of the game &#039;&#039;&#039;Super 3D Noah&#039;s Ark&#039;&#039;&#039; by Wisdom Tree Games. It uses a modified (licensed) version of the [[Wolfenstein 3-D]] engine, with added support for textured floors and ceilings. Super 3D Noah&#039;s Ark&#039;s [https://web.archive.org/web/20151003140316/www.wisdomtreegames.com/games/super3dnoahsark/ original homepage went down around 2015], but the game is still available [https://www.gog.com/en/game/super_3d_noahs_ark on GOG.com].&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
As the game uses a licensed version of the [[Wolfenstein 3-D]] engine, it shares many of the same file formats, although some have been enhanced.&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audiot.n3d&amp;lt;br/&amp;gt;audiohed.n3d&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sound effects and music.  Note however the files are empty, as the game stores Ogg Vorbis music in a WAD file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = maphead.n3d&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.pk3&lt;br /&gt;
 | Format = PK3 file (ZIP)&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains mainly formatted text files of actor parameters, level parameters, strings and quiz questions.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.wad&lt;br /&gt;
 | Format = [[WAD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive containing Ogg Vorbis music files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = vswap.n3d&lt;br /&gt;
 | Format = Wolf3D VSWAP file&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains sprites, textures and sounds at 11025 Hz&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
The following is a list of sounds in the VSWAP file&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Antelope alert&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Bear alert&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Item pickup&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Camel alert&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Door close&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Cantaloupe hit&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Cantaloupe feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Goat kick&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Animal falling asleep&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Elephant alert&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Life powerup&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Super feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Giraffe alert&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Goat alert&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Small feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 16 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Kangaroo alert&lt;br /&gt;
|-&lt;br /&gt;
| 18 || Level end&lt;br /&gt;
|-&lt;br /&gt;
| 19 || Hand feed&lt;br /&gt;
|-&lt;br /&gt;
| 20 || Monkey alert&lt;br /&gt;
|-&lt;br /&gt;
| 21 || Bear walk&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Door open&lt;br /&gt;
|-&lt;br /&gt;
| 23 || Ostrich alert&lt;br /&gt;
|-&lt;br /&gt;
| 24 || Ox alert&lt;br /&gt;
|-&lt;br /&gt;
| 25 || Player hurt&lt;br /&gt;
|-&lt;br /&gt;
| 26 || Game over&lt;br /&gt;
|-&lt;br /&gt;
| 27 || Secret door&lt;br /&gt;
|-&lt;br /&gt;
| 28 || Sheep alert&lt;br /&gt;
|-&lt;br /&gt;
| 29 || Large feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 30 || Animal spit&lt;br /&gt;
|-&lt;br /&gt;
| 31 || Watermelon hit&lt;br /&gt;
|-&lt;br /&gt;
| 32 || Watermelon feeder shoot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://hwolf3d.dugtrio17.com/index.php?section=hwe Havoc&#039;s Wolf3D Editor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://slade.mancubus.net SLADE]&lt;br /&gt;
| Platform = Windows/Mac&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
| notes = Slade erroneously uses Wolf3D&#039;s sample rate of 7042Hz, instead of 11025Hz, so the sounds are too slow&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Wolfenstein 3-D]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11835</id>
		<title>Super 3-D Noah&#039;s Ark</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11835"/>
		<updated>2024-03-29T02:23:42Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: gameover sound&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Yes&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the PC version of the game &#039;&#039;&#039;Super 3D Noah&#039;s Ark&#039;&#039;&#039; by Wisdom Tree Games. It uses a modified (licensed) version of the [[Wolfenstein 3-D]] engine, with added support for textured floors and ceilings. Super 3D Noah&#039;s Ark&#039;s [https://web.archive.org/web/20151003140316/www.wisdomtreegames.com/games/super3dnoahsark/ original homepage went down around 2015], but the game is still available [https://www.gog.com/en/game/super_3d_noahs_ark on GOG.com].&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
As the game uses a licensed version of the [[Wolfenstein 3-D]] engine, it shares many of the same file formats, although some have been enhanced.&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audiot.n3d&amp;lt;br/&amp;gt;audiohed.n3d&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sound effects and music.  Note however the files are empty, as the game stores Ogg Vorbis music in a WAD file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = maphead.n3d&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.pk3&lt;br /&gt;
 | Format = PK3 file (ZIP)&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains mainly formatted text files of actor parameters, level parameters, strings and quiz questions.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.wad&lt;br /&gt;
 | Format = [[WAD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive containing Ogg Vorbis music files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = vswap.n3d&lt;br /&gt;
 | Format = Wolf3D VSWAP file&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains sprites, textures and sounds at 11025 Hz&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
The following is a list of sounds in the VSWAP file&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Antelope alert&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Item pickup&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Camel alert&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Door close&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Cantaloupe hit&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Cantaloupe feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Goat kick&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Animal falling asleep&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Elephant alert&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Life powerup&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Super feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Giraffe alert&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Goat alert&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Small feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 16 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Kangaroo alert&lt;br /&gt;
|-&lt;br /&gt;
| 18 || Level end&lt;br /&gt;
|-&lt;br /&gt;
| 19 || Hand feed&lt;br /&gt;
|-&lt;br /&gt;
| 20 || Monkey alert&lt;br /&gt;
|-&lt;br /&gt;
| 21 || Bear alert&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Door open&lt;br /&gt;
|-&lt;br /&gt;
| 23 || Ostrich alert&lt;br /&gt;
|-&lt;br /&gt;
| 24 || Ox alert&lt;br /&gt;
|-&lt;br /&gt;
| 25 || Player hurt&lt;br /&gt;
|-&lt;br /&gt;
| 26 || Game over&lt;br /&gt;
|-&lt;br /&gt;
| 27 || Secret door&lt;br /&gt;
|-&lt;br /&gt;
| 28 || Sheep alert&lt;br /&gt;
|-&lt;br /&gt;
| 29 || Large feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 30 || Animal spit&lt;br /&gt;
|-&lt;br /&gt;
| 31 || Watermelon hit&lt;br /&gt;
|-&lt;br /&gt;
| 32 || Watermelon feeder shoot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://hwolf3d.dugtrio17.com/index.php?section=hwe Havoc&#039;s Wolf3D Editor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://slade.mancubus.net SLADE]&lt;br /&gt;
| Platform = Windows/Mac&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
| notes = Slade erroneously uses Wolf3D&#039;s sample rate of 7042Hz, instead of 11025Hz, so the sounds are too slow&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Wolfenstein 3-D]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11834</id>
		<title>Super 3-D Noah&#039;s Ark</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11834"/>
		<updated>2024-03-29T02:20:46Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Yes&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the PC version of the game &#039;&#039;&#039;Super 3D Noah&#039;s Ark&#039;&#039;&#039; by Wisdom Tree Games. It uses a modified (licensed) version of the [[Wolfenstein 3-D]] engine, with added support for textured floors and ceilings. Super 3D Noah&#039;s Ark&#039;s [https://web.archive.org/web/20151003140316/www.wisdomtreegames.com/games/super3dnoahsark/ original homepage went down around 2015], but the game is still available [https://www.gog.com/en/game/super_3d_noahs_ark on GOG.com].&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
As the game uses a licensed version of the [[Wolfenstein 3-D]] engine, it shares many of the same file formats, although some have been enhanced.&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audiot.n3d&amp;lt;br/&amp;gt;audiohed.n3d&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sound effects and music.  Note however the files are empty, as the game stores Ogg Vorbis music in a WAD file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = maphead.n3d&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.pk3&lt;br /&gt;
 | Format = PK3 file (ZIP)&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains mainly formatted text files of actor parameters, level parameters, strings and quiz questions.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.wad&lt;br /&gt;
 | Format = [[WAD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive containing Ogg Vorbis music files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = vswap.n3d&lt;br /&gt;
 | Format = Wolf3D VSWAP file&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains sprites, textures and sounds at 11025 Hz&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
The following is a list of sounds in the VSWAP file&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Antelope alert&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Item pickup&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Camel alert&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Door close&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Cantaloupe hit&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Cantaloupe feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Goat kick&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Animal falling asleep&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Elephant alert&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Life powerup&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Super feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Giraffe alert&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Goat alert&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Small feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 16 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Kangaroo alert&lt;br /&gt;
|-&lt;br /&gt;
| 18 || Level end&lt;br /&gt;
|-&lt;br /&gt;
| 19 || Hand feed&lt;br /&gt;
|-&lt;br /&gt;
| 20 || Monkey alert&lt;br /&gt;
|-&lt;br /&gt;
| 21 || Bear alert&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Door open&lt;br /&gt;
|-&lt;br /&gt;
| 23 || Ostrich alert&lt;br /&gt;
|-&lt;br /&gt;
| 24 || Ox alert&lt;br /&gt;
|-&lt;br /&gt;
| 25 || Player hurt&lt;br /&gt;
|-&lt;br /&gt;
| 26 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 27 || Secret door&lt;br /&gt;
|-&lt;br /&gt;
| 28 || Sheep alert&lt;br /&gt;
|-&lt;br /&gt;
| 29 || Large feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 30 || Animal spit&lt;br /&gt;
|-&lt;br /&gt;
| 31 || Watermelon hit&lt;br /&gt;
|-&lt;br /&gt;
| 32 || Watermelon feeder shoot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://hwolf3d.dugtrio17.com/index.php?section=hwe Havoc&#039;s Wolf3D Editor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://slade.mancubus.net SLADE]&lt;br /&gt;
| Platform = Windows/Mac&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
| notes = Slade erroneously uses Wolf3D&#039;s sample rate of 7042Hz, instead of 11025Hz, so the sounds are too slow&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Wolfenstein 3-D]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11833</id>
		<title>Super 3-D Noah&#039;s Ark</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11833"/>
		<updated>2024-03-29T02:09:49Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: Add incomplete list of sounds&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Yes&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the PC version of the game &#039;&#039;&#039;Super 3D Noah&#039;s Ark&#039;&#039;&#039; by Wisdom Tree Games. It uses a modified (licensed) version of the [[Wolfenstein 3-D]] engine, with added support for textured floors and ceilings. Super 3D Noah&#039;s Ark&#039;s [https://web.archive.org/web/20151003140316/www.wisdomtreegames.com/games/super3dnoahsark/ original homepage went down around 2015], but the game is still available [https://www.gog.com/en/game/super_3d_noahs_ark on GOG.com].&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
As the game uses a licensed version of the [[Wolfenstein 3-D]] engine, it shares many of the same file formats, although some have been enhanced.&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audiot.n3d&amp;lt;br/&amp;gt;audiohed.n3d&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sound effects and music.  Note however the files are empty, as the game stores Ogg Vorbis music in a WAD file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = maphead.n3d&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.pk3&lt;br /&gt;
 | Format = PK3 file (ZIP)&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains mainly formatted text files of actor parameters, level parameters, strings and quiz questions.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.wad&lt;br /&gt;
 | Format = [[WAD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive containing Ogg Vorbis music files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = vswap.n3d&lt;br /&gt;
 | Format = Wolf3D VSWAP file&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains sprites, textures and sounds at 11025 Hz&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
=== Sounds ===&lt;br /&gt;
&lt;br /&gt;
The following is a list of sounds in the VSWAP file&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Antelope alert&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Item pickup&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Camel alert&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Door close&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Cantaloupe hit&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Cantaloupe feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Goat kick&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Animal falling asleep&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Elephant alert&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Life powerup&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Super feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Giraffe alert&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Goat alert&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Small feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 16 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Kangaroo alert&lt;br /&gt;
|-&lt;br /&gt;
| 18 || Level end&lt;br /&gt;
|-&lt;br /&gt;
| 19 || Hand feed&lt;br /&gt;
|-&lt;br /&gt;
| 20 || Monkey alert&lt;br /&gt;
|-&lt;br /&gt;
| 21 || Bear alert&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Door open&lt;br /&gt;
|-&lt;br /&gt;
| 23 || Ostrich alert&lt;br /&gt;
|-&lt;br /&gt;
| 24 || Ox alert&lt;br /&gt;
|-&lt;br /&gt;
| 25 || Player hurt&lt;br /&gt;
|-&lt;br /&gt;
| 26 || ?&lt;br /&gt;
|-&lt;br /&gt;
| 27 || Secret door&lt;br /&gt;
|-&lt;br /&gt;
| 28 || Sheep alert&lt;br /&gt;
|-&lt;br /&gt;
| 29 || Large feeder shoot&lt;br /&gt;
|-&lt;br /&gt;
| 30 || Animal spit&lt;br /&gt;
|-&lt;br /&gt;
| 31 || Watermelon hit&lt;br /&gt;
|-&lt;br /&gt;
| 32 || Watermelon feeder shoot&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://hwolf3d.dugtrio17.com/index.php?section=hwe Havoc&#039;s Wolf3D Editor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://slade.mancubus.net SLADE]&lt;br /&gt;
| Platform = Windows/Mac&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Wolfenstein 3-D]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Wolfenstein_3-D&amp;diff=11801</id>
		<title>Wolfenstein 3-D</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Wolfenstein_3-D&amp;diff=11801"/>
		<updated>2024-02-27T11:18:32Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: add vswap file&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = Edit&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = Edit&lt;br /&gt;
 | Story = Edit&lt;br /&gt;
 | Interface = Edit&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wolfenstein 3-D&#039;&#039;&#039; is the game that brought world attention to first-person shooter games.  It is considered the father of all modern 3D games.&lt;br /&gt;
&lt;br /&gt;
The complete source code was released by id Software on July 21, 1995, only three years after the game&#039;s release.  It can be downloaded from [ftp://ftp.idsoftware.com/idstuff/source/ id Software&#039;s FTP server].  This was the first in a long line of source-code releases by id, and paved the way for their later success by designing and selling game engines to other game developers.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[TED5]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
| notes = Editor used by id Software to create the original levels&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
Many more tools can be found at [http://www.wolfenstein3d.co.uk/utilities.htm The Wolfenstein 3D Dome].&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audiot.wl?&amp;lt;br/&amp;gt;audiohed.wl?&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sound effects and music.  The game uses the uncompressed version of this format.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = maptemp.wl? (v1.0)&amp;lt;br/&amp;gt;gamemaps.wl? (v1.1+)&amp;lt;br/&amp;gt;maphead.wl? (all versions)&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = VSWAP.WL?&lt;br /&gt;
 | Format = Wolf3D VSWAP file&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.exe&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = There are a couple of text screens in the main .EXE file (including the text displayed on the screen when you quit)&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11800</id>
		<title>Super 3-D Noah&#039;s Ark</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=11800"/>
		<updated>2024-02-27T11:17:40Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: Add VSWAP info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the PC version of the game &#039;&#039;&#039;Super 3D Noah&#039;s Ark&#039;&#039;&#039; by Wisdom Tree Games. It uses a modified (licensed) version of the [[Wolfenstein 3-D]] engine, with added support for textured floors and ceilings. Super 3D Noah&#039;s Ark&#039;s [https://web.archive.org/web/20151003140316/www.wisdomtreegames.com/games/super3dnoahsark/ original homepage went down around 2015], but the game is still available [https://www.gog.com/en/game/super_3d_noahs_ark on GOG.com].&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
As the game uses a licensed version of the [[Wolfenstein 3-D]] engine, it shares many of the same file formats, although some have been enhanced.&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audiot.n3d&amp;lt;br/&amp;gt;audiohed.n3d&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sound effects and music.  Note however the files are empty, as the game stores Ogg Vorbis music in a WAD file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = maphead.n3d&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.pk3&lt;br /&gt;
 | Format = PK3 file (ZIP)&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains mainly formatted text files of actor parameters, level parameters, strings and quiz questions.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.wad&lt;br /&gt;
 | Format = [[WAD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive containing Ogg Vorbis music files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = vswap.n3d&lt;br /&gt;
 | Format = Wolf3D VSWAP file&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains sprites, textures and sounds at 11025 Hz&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://hwolf3d.dugtrio17.com/index.php?section=hwe Havoc&#039;s Wolf3D Editor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://slade.mancubus.net SLADE]&lt;br /&gt;
| Platform = Windows/Mac&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Wolfenstein 3-D]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Crystal_Caves&amp;diff=11660</id>
		<title>Crystal Caves</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Crystal_Caves&amp;diff=11660"/>
		<updated>2024-01-27T09:34:47Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: Add note about MNI file trailing junk&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = None&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Crystal Caves&#039;&#039;&#039; is a platform game often noted for the smoothness of the game creature animations, due to the programmer deciding to use more animation frames than was typical at the time.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = N/A&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://sfprod.shikadi.net/old/games/crystalcaves.htm#tile_modifier CCmod]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = N/A&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.apg&amp;lt;br/&amp;gt;*.cdt&amp;lt;br/&amp;gt;*.end&amp;lt;br/&amp;gt;*.ttl&lt;br /&gt;
 | Format = [[PCX Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 320&amp;amp;times;200 16-colour full screen images&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.gfx&lt;br /&gt;
 | Format = [[ProGraphx Toolbox tileset format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 16&amp;amp;times;16 16-colour sprites. The registered version contains three gfx files but they are identical.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mni&lt;br /&gt;
 | Format = [[ProGraphx Toolbox tileset format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 8&amp;amp;times;8 16-colour sprites, like the characters and icons on the status bar.  Not to be confused with the MNI files from [[Cosmo&#039;s Cosmic Adventures]]. Note that the files contain a single 50-sprite chunk; there is junk trailing data after this chunk.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.snd&lt;br /&gt;
 | Format = [[Crystal Caves Sound format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = PC speaker sound effects (a modified form of [[Inverse Frequency Sound format]])&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = cc?.exe&lt;br /&gt;
 | Format = [[Crystal Caves Map Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game levels are stored inside the main game .exe&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
== Trivia ==&lt;br /&gt;
&lt;br /&gt;
* Episode 1, level 16 is made up primarily of green pipes.  Two join types (left/right/top and left/open-down) were drawn and have usable level codes, however they were not used in the game.&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=PCX_Format&amp;diff=11350</id>
		<title>PCX Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=PCX_Format&amp;diff=11350"/>
		<updated>2023-10-12T06:57:34Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: /* Tools */ Add SDL_image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Image Infobox&lt;br /&gt;
 | Hardware1 = CGA&lt;br /&gt;
 | Hardware2 = EGA&lt;br /&gt;
 | Hardware3 = VGA&lt;br /&gt;
 | Depth = Multiple&lt;br /&gt;
 | MinSize = 0&amp;amp;times;0&lt;br /&gt;
 | MaxSize = 65536&amp;amp;times;65536 &amp;lt;!-- Ymin=0, Ymax=65535 = height 65536 --&amp;gt;&lt;br /&gt;
 | Palette = Internal (optional)&lt;br /&gt;
 | NumPlanes = 1-255&lt;br /&gt;
 | HasTransparency = No&lt;br /&gt;
 | HasHitmap = No&lt;br /&gt;
&amp;lt;!-- All the games that use this file format --&amp;gt;&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bubble Bobble featuring Rainbow Islands}}&lt;br /&gt;
   {{Game|Command &amp;amp; Conquer}} (Win95 version only)&lt;br /&gt;
   {{Game|Command &amp;amp; Conquer: Red Alert}}&lt;br /&gt;
   {{Game|Crystal Caves}}&lt;br /&gt;
   {{Game|F1 Manager Professional}}&lt;br /&gt;
   {{Game|Halloween Harry}}&lt;br /&gt;
   {{Game|Hocus Pocus}}&lt;br /&gt;
   {{Game|Hugo&#039;s House of Horrors}}&lt;br /&gt;
   {{Game|Hugo II, Whodunit?}}&lt;br /&gt;
   {{Game|Hugo III, Jungle of Doom!}}&lt;br /&gt;
   {{Game|Math Rescue}}&lt;br /&gt;
   {{Game|The Oregon Trail}}&lt;br /&gt;
   {{Game|Wacky Wheels}}&lt;br /&gt;
   {{Game|Word Rescue}}&lt;br /&gt;
}}&lt;br /&gt;
The [[PCX Format]] is an image format used by many games, usually to store full screen (320x200) 16-colour EGA, and later 256-colour VGA (mode 13h), graphics.  It was, for a time, also a general picture format like .bmp or .png, and was the primary format used by PC Paintbrush.  It declined in popularity after support for 24-bit true colour images was added too late, by which time many people had switched to competing formats like .png and JPEG (the latter offering far better compression for photos.)  It also lacks support for transparency, which resulted in it losing some ground to the GIF format which otherwise provided a similar feature set.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
The PCX file is composed of two parts, the header and the image data, which is usually compressed. The header is as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || Manufacturer || Always 0x0A&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || Version || PC Paintbrush version. Acts as file format version. &amp;lt;br/&amp;gt;0 = v2.5&amp;lt;br/&amp;gt;2 = v2.8 with palette&amp;lt;br/&amp;gt;3 = v2.8 without palette&amp;lt;br/&amp;gt;4 = Paintbrush for Windows&amp;lt;br/&amp;gt;5 = v3.0 or higher&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || Encoding || Should be 0x01&amp;lt;br/&amp;gt;0 = uncompressed image (not officially allowed, but some software supports it)&amp;lt;br/&amp;gt;1 = PCX run length encoding&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || BitsPerPlane || Number of bits per pixel in each entry of the colour planes (1, 2, 4, 8, 24)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || WindowXmin ||rowspan=4| Window (image dimensions):&amp;lt;br/&amp;gt;ImageWidth = &amp;lt;tt&amp;gt;Xmax - Xmin + 1&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;ImageHeight = &amp;lt;tt&amp;gt;Ymax - Ymin + 1&amp;lt;/tt&amp;gt;&amp;lt;br/&amp;gt;Normally &amp;lt;tt&amp;gt;Xmin&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Ymin&amp;lt;/tt&amp;gt; should be set to zero. Note that these field values are valid rows and columns, which is why you have to add one to get the actual dimension (so a 200 pixel high image would have Ymin=0 and Ymax=199, or Ymin=100 and Ymax=299, etc.)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || WindowYmin&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || WindowXmax&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || WindowYmax&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || VertDPI ||rowspan=2| This is supposed to specify the image&#039;s vertical and horizontal resolution in DPI (dots per inch), but it is rarely reliable. It often contains the image dimensions, or nothing at all.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || HorzDPI&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || Palette[48] || Palette for 16 colors or less, in three-byte RGB entries. Padded with 0x00 to 48 bytes in total length. See below for more details on palette handling.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || Reserved || Should be set to 0, but can sometimes contain junk.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] || ColorPlanes || Number of colour planes. Multiply by &amp;lt;tt&amp;gt;BitsPerPlane&amp;lt;/tt&amp;gt; to get the actual colour depth.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || BytesPerPlaneLine || Number of bytes to read for a single plane&#039;s scanline, i.e. at least &amp;lt;tt&amp;gt;ImageWidth&amp;lt;/tt&amp;gt; &amp;amp;divide; 8 bits per byte &amp;amp;times; &amp;lt;tt&amp;gt;BitsPerPlane&amp;lt;/tt&amp;gt;. Must be an even number. Do &#039;&#039;&#039;not&#039;&#039;&#039; calculate from Xmax-Xmin. Normally a multiple of the machine&#039;s native word length (2 or 4)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || PaletteInfo || How to interpret palette:&amp;lt;br/&amp;gt;1 = Color/BW&amp;lt;br/&amp;gt;2 = Grayscale (ignored in PC Paintbrush IV and later)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || HorScrSize ||rowspan=2| Only supported by PC Paintbrush IV or higher; deals with scrolling. Best to just ignore it.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || VerScrSize&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][54] || Padding || Filler to bring header up to 128 bytes total. Can contain junk.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Image Data ==&lt;br /&gt;
&lt;br /&gt;
Image data comes after the header (starting at offset 0x80 in a PCX file), and will be RLE compressed if the header indicated so. The way the data is stored depends on how many colour planes are specified. Each row has its color planes stored sequentially, similar to [[raw EGA data]].&lt;br /&gt;
&lt;br /&gt;
For one plane of eight bits (256-colour), each byte will represent one pixel. For one plane of four bits (16-colour), each byte will represent two pixels. The bits within the byte are in big-endian order, so the most significant bit belongs to the left-most pixel. In other words, in two bits per pixel mode, a byte of value 0xE4 (binary 11 10 01 00) will have left-to-right pixel values of 3, 2, 1, 0.&lt;br /&gt;
&lt;br /&gt;
EGA 16-colour images are often stored with four colour planes instead of one, with each plane being one-bit-per-pixel (think of four black and white images, one each for red, green, blue and intensity.)  The planes are stored sequentially for each line (see [[Raw EGA data#Row-planar EGA data|Row-planar EGA data]] for the exact details), thus a 320x200 EGA image will store at least 40 bytes for each scanline&#039;s colour plane (320 pixels &amp;amp;divide; 8 bits per byte &amp;amp;times; 1 bit per pixel), with each scanline being at least 160 bytes long (320 pixels &amp;amp;divide; 8 bits per byte &amp;amp;times; 1 bit per pixel &amp;amp;times; 4 planes). Note that the scanline length can be larger than expected (40 bytes in this example), especially for images whose width is not a multiple of four. This is because each scanline in a plane is padded to a multiple of two or four bytes, depending on the architecture of the machine used to create the file. The actual size is stored in the &amp;lt;tt&amp;gt;BytesPerPlaneLine&amp;lt;/tt&amp;gt; field in the header, which should always be used instead of calculating the value from the other image attributes.&lt;br /&gt;
&lt;br /&gt;
True colour PCX files are not common, and could be either three planes (R, G and B) of eight bits each (24-bit RGB) or one plane of 24-bits. Technically, the same is applicable for alpha-capable 32-bit images (with four planes in planar mode), though no official format specs ever included such a thing.&lt;br /&gt;
&lt;br /&gt;
The split into planes is generally governed by what is most convenient for the game at the time, which in turn depends on which video mode is being used to display the image. Since EGA video memory is split into planes, 16-colour PCX files are frequently split into matching planes so that no processing is required when loading an image directly into video memory.&lt;br /&gt;
&lt;br /&gt;
=== RLE Compression ===&lt;br /&gt;
&lt;br /&gt;
The PCX format uses a form of [[RLE Compression]] that is rather unique. It compresses on the byte level and uses a flag system, where the flag is the two highest bits of a byte. If this flag is set (i.e. the two upper bits are set, or in other words the value is &amp;gt;= 192) then the lower six bits are the number of times to repeat the following byte.&lt;br /&gt;
&lt;br /&gt;
Thus, for a  byte pair &amp;lt;tt&amp;gt;C7 28&amp;lt;/tt&amp;gt;, the 0xC7 can be decomposed into the flag value 192 (128 + 64) plus 7, meaning the full byte pair means &#039;7 bytes of 0x28&#039;. So to get the amount, you subtract 192 from the flag, or, using faster logic operations, you can do &amp;lt;code&amp;gt;byte &amp;amp; 0x3F&amp;lt;/code&amp;gt; to retain only the lowest six bits.&lt;br /&gt;
&lt;br /&gt;
This means that the six-bit length values have a maximum of 63. It also means that any value larger than 191 &#039;&#039;must&#039;&#039; be stored as a length/value pair, which can actually &#039;&#039;increase&#039;&#039; the size of the file in some cases. For instance, if you have a single byte of color 192, then it must be represented by two bytes - one of 193 (C1, a repeat of one time) followed by one of 192 (C0, color byte 192).&lt;br /&gt;
&lt;br /&gt;
It is also worth noting that the byte value C0 does not have a clearly defined effect. Depending on the implementation in the decoding program, this could do any of the following:&lt;br /&gt;
&lt;br /&gt;
* treat &amp;lt;tt&amp;gt;C0&amp;lt;/tt&amp;gt; as a literal byte.&lt;br /&gt;
* ignore &amp;lt;tt&amp;gt;C0&amp;lt;/tt&amp;gt; and continue with the following byte.&lt;br /&gt;
* &#039;repeat the following byte zero times&#039;, effectively ignoring any byte following &amp;lt;tt&amp;gt;C0&amp;lt;/tt&amp;gt;. This could conceivably be used to embed non-image data in the PCX file which would be ignored by any program displaying the image.&lt;br /&gt;
* &#039;repeat the following byte 65536 times&#039;, which is basically a bugged implementation using a &amp;quot;&amp;lt;tt&amp;gt;while (--count != 0)&amp;lt;/tt&amp;gt;&amp;quot; style loop with a 16 bit variable/CPU register.&lt;br /&gt;
&lt;br /&gt;
At any rate, the best way to handle a &amp;lt;tt&amp;gt;C0&amp;lt;/tt&amp;gt; when encoding (compressing) is to write the sequence &amp;lt;tt&amp;gt;C1 C0&amp;lt;/tt&amp;gt;. When decoding (decompressing), a value of &amp;lt;tt&amp;gt;C0&amp;lt;/tt&amp;gt; almost always indicates an error in the file.&lt;br /&gt;
&lt;br /&gt;
Note that each scanline is compressed independently - an RLE sequence may span multiple planes, but it will never span more than one row of pixels. Thus when decompressing an image, the RLE algorithm will produce at most &amp;lt;tt&amp;gt;BytesPerPlaneLine&amp;lt;/tt&amp;gt; bytes at a time. Even where the RLE coding could have continued over to the next scanline, it will stop and start again fresh for each line.&amp;lt;ref&amp;gt;[http://www.drdobbs.com/pcx-graphics/184402396#01ED_0105 PCX Graphics | Dr Dobb&#039;s]&amp;lt;/ref&amp;gt;  For example, if the input image is 8&amp;amp;times;4 pixels EGA 16-colour, and the first two lines of pixels are black (color 0) and the last two are white (color 15), they must be compressed as &amp;lt;tt&amp;gt;C4 00 | C4 00 | C4 FF | C4 FF&amp;lt;/tt&amp;gt; and not as &amp;lt;tt&amp;gt;C8 00 | C8 FF&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Palettes ===&lt;br /&gt;
&lt;br /&gt;
Most of the game&#039;s supported formats are indexed, and thus require a colour palette. There are, however, three distinct ways of handling those palettes; CGA, EGA and VGA. For images with 16 colours or less, the palette is stored in the header. For images with more colours (i.e. 256-colour images) the header palette is ignored, and the 768-byte palette is stored after the image data. Some sources seem to indicate that there are formats where even the smaller palettes are added behind the image, so it is best to always check for it there. To determine if this is the case, check if the decompressed image data is followed by a &amp;lt;tt&amp;gt;0C&amp;lt;/tt&amp;gt; byte, and if there is enough data left in the file behind that for the palette data.&lt;br /&gt;
&lt;br /&gt;
As a general rule, the palettes are lists of 3-byte blocks. These blocks normally contain 8-bit RGB data, but even if they are used differently (as is the case for CGA palettes), they will still retain the 3-byte block structure.&lt;br /&gt;
&lt;br /&gt;
It is difficult to correctly determine the palette for 1-bit and 2-bit images, since they can be stored either as CGA or as EGA, and there is no real way to identify which method to use. Some sources suggest checking for 640x200 dimensions on 1-bit images, or 320x200 on 2-bit, since those are standard CGA sizes for respectively its monochrome and 4-colour mode, but 320x200 is a very common size for non-CGA images as well, and there has most likely never been anything preventing people on CGA hardware from saving PCX images in different sizes than a full screen. It is also suggested, for two bit per pixel images, that those with a single 2-bit plane would use a CGA palette, while those with two 1-bit planes would use EGA&amp;lt;ref&amp;gt;[http://www.fysnet.net/pcxfile.htm PCX graphics files explained] - section &amp;quot;Interpretation of the PCX data&amp;quot;&amp;lt;/ref&amp;gt;. All of this makes fully automatic identification for these image types very difficult.&lt;br /&gt;
&lt;br /&gt;
==== CGA palette ====&lt;br /&gt;
&lt;br /&gt;
CGA palette handling is a bit peculiar. As with other colour palettes, the data is seen as blocks of three bytes. However, in CGA mode, these blocks do not contain normal RGB colour data.&lt;br /&gt;
&lt;br /&gt;
The first triplet contains a specifically-defined colour. Only the highest four bits of the first byte are used, meaning the actual colour value can be found by taking that byte and shifting it four bits to the right. The result is a value from 0..15, which matches [[EGA Palette|one of the standard CGA/EGA text-mode colours]].&lt;br /&gt;
&lt;br /&gt;
For monochrome CGA images, this colour is put on index 1 on the palette, and index 0 is filled in with black (EGA palette entry #0).&lt;br /&gt;
&lt;br /&gt;
For actual 4-colour palettes, this colour becomes the background colour at index 0. The other colours are determined by three status bits fed into the CGA hardware; &amp;lt;tt&amp;gt;ColorBurst&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Palette&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Intensity&amp;lt;/tt&amp;gt;. For the full explanation on which colours this produces, see the [[CGA Palette]] article.&lt;br /&gt;
&lt;br /&gt;
However, the way these three bits are determined changed in PC Paintbrush version IV, and this change is not reflected in a change in the &amp;lt;tt&amp;gt;Version&amp;lt;/tt&amp;gt; value in the header. The only decent way to distinguish the files from before and after version IV is to check the &amp;lt;tt&amp;gt;PaletteInfo&amp;lt;/tt&amp;gt; byte in the header, which is 0 on files using the old method, and filled in (with 1 or 2) on files using the new method.&lt;br /&gt;
&lt;br /&gt;
===== Older method =====&lt;br /&gt;
&lt;br /&gt;
In the original way the status bits were saved, the second palette entry&#039;s first byte (byte 3) contains the three status bits.&amp;lt;ref name=&amp;quot;fileformat&amp;quot;&amp;gt;[https://www.fileformat.info/format/pcx/egff.htm PCX specs on fileformat.info]&amp;lt;/ref&amp;gt; They can be extracted by taking the highest three bits of that byte.&lt;br /&gt;
&lt;br /&gt;
* Bit 8 (&amp;lt;tt&amp;gt;10000000&amp;lt;/tt&amp;gt;) is &amp;lt;tt&amp;gt;ColorBurst&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Bit 7 (&amp;lt;tt&amp;gt;01000000&amp;lt;/tt&amp;gt;) is the &amp;lt;tt&amp;gt;Palette&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* Bit 6 (&amp;lt;tt&amp;gt;00100000&amp;lt;/tt&amp;gt;) is the &amp;lt;tt&amp;gt;Intensity&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Newer method =====&lt;br /&gt;
&lt;br /&gt;
For the newer files, with the &amp;lt;tt&amp;gt;PaletteInfo&amp;lt;/tt&amp;gt; byte filled in, the following&amp;lt;ref&amp;gt;[https://github.com/samuel/go-pcx/blob/d9c017170db4e016377181263f7e4cbb6bf1d8cc/pcx/decoder.go#L299 PCX image encoder and decoder for Go] - &#039;&#039;PC Paintbush 4.0 encodes the CGA palettes differently than 3.0.&#039;&#039;&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[https://github.com/wjaguar/mtPaint/blob/3884b6d6ebc18511df7bf1485a19fe774dd61dcf/src/png.c#L5416 Mark Tyler&#039;s Painting Program] - &#039;&#039;CGA palette is evil: what the PCX spec describes is the way it was handled by PC Paintbrush 3.0, while 4.0 was using an entirely different, undocumented encoding for palette selection.&#039;&#039;&amp;lt;/ref&amp;gt; should be done to determine the palette:&lt;br /&gt;
&lt;br /&gt;
* Take the green and blue values of the second palette entry. These are the bytes at index 4 and 5 in the palette data.&lt;br /&gt;
* If the green value is strictly-greater than the blue value, take Palette 0, otherwise take Palette 1.&lt;br /&gt;
* If the largest of these two values is greater than 200, the Intensity bit is enabled.&lt;br /&gt;
&lt;br /&gt;
The new method seemed to have been intended to convert a fully-saved colour palette back to CGA status bits. Sadly, it seems people figured out exactly what it checked, and started writing PCX files which contained only exactly enough data to derive those bits instead of saving an actual full palette.&lt;br /&gt;
&lt;br /&gt;
As a side effect of this, there is no real check for the color burst, meaning it is always considered to be enabled, and there is no support for palette 2. If an actual palette is saved in the file, such support &#039;&#039;could&#039;&#039; be added. A viable check for detecting palette 2 (meaning, a disabled colour burst bit) would be that the original logic matches palette 1, and the third entry&#039;s red value is greater than its blue value.&lt;br /&gt;
&lt;br /&gt;
==== EGA palette ====&lt;br /&gt;
&lt;br /&gt;
EGA images are those with eight or sixteen colours. Typically, they have &amp;lt;tt&amp;gt;BitsPerPlane&amp;lt;/tt&amp;gt; set to 1 and &amp;lt;tt&amp;gt;ColorPlanes&amp;lt;/tt&amp;gt; set to 3 or 4, though variations like two 2-bit planes or one 4-bit plane are possible as well. For these images, there are two ways of handling the colours:&lt;br /&gt;
&lt;br /&gt;
* If the version in the header is 0 or 3, then the [[EGA Palette|standard EGA palette]] is used, since version 0 does not support a modified palette, and version 3 specifically indicates that no palette information is present in the file.&amp;lt;ref name=&amp;quot;fileformat&amp;quot; /&amp;gt;&lt;br /&gt;
* In any other version, the palette is read from the header. The data is structured the same way as [[VGA Palette#The_.22Modern.22_format|8-bit VGA palettes]], except that it&#039;s less long.&lt;br /&gt;
&lt;br /&gt;
Most EGA images will be 4 bits per pixel, meaning the palette will be 16 colours long, but 3 bit per pixel planar format is supported as well. In that case, only 8 entries are read, or if it uses the default EGA palette, only the darker first eight colours will be available. 2 bit per pixel images could use EGA palette handling as well, but these are hard to distinguish from the CGA ones.&lt;br /&gt;
&lt;br /&gt;
Note that technically, EGA images are limited to 2 bit colour components, meaning every component would need to be rounded to the nearest multiple of &amp;lt;tt&amp;gt;0x55&amp;lt;/tt&amp;gt;, though, practically, there is little reason to not let the images retain the more accurate colours as they are specified in the palette.&lt;br /&gt;
&lt;br /&gt;
==== VGA palette ====&lt;br /&gt;
&lt;br /&gt;
For 8-bit images, the 256-colour palette can be found behind the image data. It is a [[VGA Palette#The_.22Modern.22_format|standard VGA palette in 8-bit RGB format]]. A single signature byte of &amp;lt;tt&amp;gt;0C&amp;lt;/tt&amp;gt; is included before the palette data begins.&lt;br /&gt;
&lt;br /&gt;
Some PCX readers simplify the start offset of the 256-colour palette to &amp;lt;code&amp;gt;EndOfFile - 768&amp;lt;/code&amp;gt;, though technically, the correct way to find it is to take the offset you end up at after decompressing the image, checking for the &amp;lt;tt&amp;gt;0C&amp;lt;/tt&amp;gt; byte after that, and then reading the 768-byte palette.&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
=== ASM ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;asm&amp;quot;&amp;gt;&lt;br /&gt;
EXTERN  kbdin, dosxit           ; LIB291 functions&lt;br /&gt;
&lt;br /&gt;
SEGMENT ScratchSeg&lt;br /&gt;
ScratchPad      resb 65535&lt;br /&gt;
&lt;br /&gt;
SEGMENT stkseg STACK&lt;br /&gt;
        resb    64*8&lt;br /&gt;
stacktop:&lt;br /&gt;
        resb    0&lt;br /&gt;
&lt;br /&gt;
SEGMENT code&lt;br /&gt;
&lt;br /&gt;
PCX1    db      &#039;my_pcx1.pcx&#039;, 0        ; Filenames&lt;br /&gt;
PCX2    db      &#039;my_pcx2.pcx&#039;, 0        ; (Must end with 0 byte)&lt;br /&gt;
&lt;br /&gt;
..start:&lt;br /&gt;
        mov     ax, cs          ; Set up data and stack segments&lt;br /&gt;
        mov     ds, ax&lt;br /&gt;
        mov     ax, stkseg&lt;br /&gt;
        mov     ss, ax&lt;br /&gt;
        mov     sp, stacktop&lt;br /&gt;
&lt;br /&gt;
MAIN:&lt;br /&gt;
        ; Sets up mode 13h and clears screen&lt;br /&gt;
        mov     ax, 0013h&lt;br /&gt;
        int     10h&lt;br /&gt;
&lt;br /&gt;
        mov     dx, pcx1        ; Filename to display&lt;br /&gt;
        call    ShowPCX         ; Display PCX file to screen&lt;br /&gt;
&lt;br /&gt;
        ; Wait for keypress&lt;br /&gt;
        call    kbdin&lt;br /&gt;
&lt;br /&gt;
        ; Go back to text mode&lt;br /&gt;
        mov     ax, 0003h&lt;br /&gt;
        int     10h&lt;br /&gt;
&lt;br /&gt;
        ; Return to DOS&lt;br /&gt;
        call    dosxit&lt;br /&gt;
&lt;br /&gt;
;-----------------------------------------------------------------------------&lt;br /&gt;
; ShowPCX procedure by Brandon Long,&lt;br /&gt;
;   modified by Eric Meidel and Nathan Jachimiec,&lt;br /&gt;
;   converted to NASM, cleaned up, and better commented by Peter Johnson&lt;br /&gt;
; Inputs: DX has the offset of PCX filename to show.&lt;br /&gt;
; Output: PCX file displayed (all registers unchanged)&lt;br /&gt;
; Notes:  Assumes PCX file is 320x200x256.&lt;br /&gt;
;         Uses ScratchSeg for temporary storage.&lt;br /&gt;
;         The PCX file must be in the same directory as this executable.&lt;br /&gt;
;-----------------------------------------------------------------------------&lt;br /&gt;
ShowPCX&lt;br /&gt;
        push    ax              ; Save registers&lt;br /&gt;
        push    bx&lt;br /&gt;
        push    cx&lt;br /&gt;
        push    si&lt;br /&gt;
        push    di&lt;br /&gt;
        push    es&lt;br /&gt;
&lt;br /&gt;
        mov     ax, 3D00h&lt;br /&gt;
        int     21h             ; Open file&lt;br /&gt;
        jc      .error          ; Exit if open failed&lt;br /&gt;
&lt;br /&gt;
        mov     bx, ax          ; File handle&lt;br /&gt;
        mov     cx, 65535       ; Number of bytes to read&lt;br /&gt;
        mov     ax, ScratchSeg  ; DS:DX -&amp;gt; buffer for data&lt;br /&gt;
        mov     ds, ax&lt;br /&gt;
        mov     dx, ScratchPad&lt;br /&gt;
        mov     si, dx&lt;br /&gt;
        mov     ah, 3Fh&lt;br /&gt;
        int     21h             ; Read from file&lt;br /&gt;
&lt;br /&gt;
        mov     ax, 0A000h      ; Start writing to upper-left corner&lt;br /&gt;
        mov     es, ax          ; of graphics display&lt;br /&gt;
        xor     di, di&lt;br /&gt;
&lt;br /&gt;
        add     si, 128         ; Skip header information&lt;br /&gt;
&lt;br /&gt;
        xor     ch, ch          ; Clear high part of CX for string copies&lt;br /&gt;
&lt;br /&gt;
.nextbyte:&lt;br /&gt;
        mov     cl, [si]        ; Get next byte&lt;br /&gt;
        cmp     cl, 0C0h        ; Is it a length byte?&lt;br /&gt;
        jb      .normal         ;  No, just copy it&lt;br /&gt;
        and     cl, 3Fh         ; Strip upper two bits from length byte&lt;br /&gt;
        inc     si              ; Advance to next byte - color byte&lt;br /&gt;
        lodsb                   ; Get color byte into AL from [SI]&lt;br /&gt;
        rep stosb               ; Store to [ES:DI] and inc DI, CX times&lt;br /&gt;
        jmp     short .tst&lt;br /&gt;
&lt;br /&gt;
.normal:&lt;br /&gt;
        movsb                   ; Copy color value from [SI] to [ES:DI]&lt;br /&gt;
&lt;br /&gt;
.tst:&lt;br /&gt;
        cmp     di, 320*200     ; End of file? (written 320x200 bytes)&lt;br /&gt;
        jb      .nextbyte&lt;br /&gt;
&lt;br /&gt;
        mov     cl, [si]&lt;br /&gt;
        cmp     cl, 0Ch         ; Palette available?&lt;br /&gt;
        jne     .close&lt;br /&gt;
&lt;br /&gt;
        ; Set palette using port I/O&lt;br /&gt;
        mov     dx, 3C8h&lt;br /&gt;
        mov     al, 0&lt;br /&gt;
        out     dx, al&lt;br /&gt;
        inc     dx              ; Port 3C9h&lt;br /&gt;
        mov     cx, 256*3       ; Copy 256 entries, 3 bytes (RGB) apiece&lt;br /&gt;
        inc     si              ; Skip past padding byte&lt;br /&gt;
&lt;br /&gt;
.palette:&lt;br /&gt;
        lodsb&lt;br /&gt;
        shr     al, 1           ; PCX stores color values as 0-255&lt;br /&gt;
        shr     al, 1           ;  but VGA DAC is only 0-63&lt;br /&gt;
        out     dx, al&lt;br /&gt;
        dec     cx&lt;br /&gt;
        jnz     .palette&lt;br /&gt;
&lt;br /&gt;
.close:&lt;br /&gt;
        mov     ah, 3Eh&lt;br /&gt;
        int     21h             ; Close file&lt;br /&gt;
&lt;br /&gt;
.error:&lt;br /&gt;
        pop     es              ; Restore registers&lt;br /&gt;
        pop     di&lt;br /&gt;
        pop     si&lt;br /&gt;
        pop     cx&lt;br /&gt;
        pop     bx&lt;br /&gt;
        pop     ax&lt;br /&gt;
        ret&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
PCX files can be read, and occasionally converted by several programs, notably, the Microsoft Photo Editor included in Windows XP can do so.&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=image}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.xnview.com XnView]&lt;br /&gt;
| Platform = Windows/MacOSX/Linux&lt;br /&gt;
| canView = Yes&lt;br /&gt;
| canExport = Yes&lt;br /&gt;
| canImport = Yes&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = Freeware for private non-commercial or educational use.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.imagemagick.com ImageMagick]&lt;br /&gt;
| Platform = Cross-platform&lt;br /&gt;
| canView = Yes&lt;br /&gt;
| canExport = Yes&lt;br /&gt;
| canImport = Yes&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = Is unable to correctly write 16-colour PCX files.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.gimp.org GNU Image Manipulation Program]&lt;br /&gt;
| Platform = Cross-platform&lt;br /&gt;
| canView = Yes&lt;br /&gt;
| canExport = Yes&lt;br /&gt;
| canImport = Yes&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = Does not handle CGA or default-palette EGA images correctly.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Engie File Converter]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canView = Yes&lt;br /&gt;
| canExport = Yes&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = Relies on common image dimensions for CGA detection. No save functionality so far.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [https://github.com/libsdl-org/SDL_image SDL_image]&lt;br /&gt;
| Platform = Cross-platform&lt;br /&gt;
| canView = Yes&lt;br /&gt;
| canExport = No&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editHidden = N/A&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
| notes = &lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Useful links ==&lt;br /&gt;
&lt;br /&gt;
* [http://bespin.org/~qz/pc-gpe/pcx.txt Official PCX documentation]&lt;br /&gt;
* [http://web.archive.org/web/20030111010058/http://www.nist.fss.ru/hr/doc/spec/pcx.htm Official PCX documentation in HTML (archived version)]&lt;br /&gt;
* [http://www.fileformat.info/format/pcx/egff.htm PCX at the File Format Encyclopaedia] - very detailed&lt;br /&gt;
* [http://fileformats.archiveteam.org/wiki/PCX PCX on the &#039;Just Solve the File Format Problem&#039; wiki] - includes useful sample files.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Crystal_Caves&amp;diff=11174</id>
		<title>Crystal Caves</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Crystal_Caves&amp;diff=11174"/>
		<updated>2023-08-04T10:22:44Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = None&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Crystal Caves]] is a platform game often noted for the smoothness of the game creature animations, due to the programmer deciding to use more animation frames than was typical at the time.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = N/A&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://sfprod.shikadi.net/old/games/crystalcaves.htm#tile_modifier CCmod]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = N/A&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.apg&amp;lt;br/&amp;gt;*.cdt&amp;lt;br/&amp;gt;*.end&amp;lt;br/&amp;gt;*.ttl&lt;br /&gt;
 | Format = [[PCX Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 320&amp;amp;times;200 16-colour full screen images&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.gfx&lt;br /&gt;
 | Format = [[ProGraphx Toolbox tileset format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 16&amp;amp;times;16 16-colour sprites. The registered version contains three gfx files but they are identical.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mni&lt;br /&gt;
 | Format = [[ProGraphx Toolbox tileset format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 8&amp;amp;times;8 16-colour sprites, like the characters and icons on the status bar.  Not to be confused with the MNI files from [[Cosmo&#039;s Cosmic Adventures]]&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.snd&lt;br /&gt;
 | Format = [[Crystal Caves Sound format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = PC speaker sound effects (a modified form of [[Inverse Frequency Sound format]])&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = cc?.exe&lt;br /&gt;
 | Format = [[Crystal Caves Map Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game levels are stored inside the main game .exe&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
== Trivia ==&lt;br /&gt;
&lt;br /&gt;
* Episode 1, level 16 is made up primarily of green pipes.  Two join types (left/right/top and left/open-down) were drawn and have usable level codes, however they were not used in the game.&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=10884</id>
		<title>Super 3-D Noah&#039;s Ark</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Super_3-D_Noah%27s_Ark&amp;diff=10884"/>
		<updated>2023-03-02T06:04:42Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: Add file formats and tools&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the PC version of the game &#039;&#039;&#039;Super 3D Noah&#039;s Ark&#039;&#039;&#039; by Wisdom Tree Games. It uses a modified (licensed) version of the [[Wolfenstein 3-D]] engine, with added support for textured floors and ceilings. Super 3D Noah&#039;s Ark&#039;s homepage is at [http://www.wisdomtreegames.com/games/super3dnoahsark/ http://www.wisdomtreegames.com/games/super3dnoahsark/], where it is still for sale.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://hwolf3d.dugtrio17.com/index.php?section=hwe Havoc&#039;s Wolf3D Editor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://slade.mancubus.net SLADE]&lt;br /&gt;
| Platform = Windows/Mac&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
As the game uses a licensed version of the [[Wolfenstein 3-D]] engine, it shares many of the same file formats, although some have been enhanced.&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audiot.n3d&amp;lt;br/&amp;gt;audiohed.n3d&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sound effects and music.  Note however the files are empty, as the game stores Ogg Vorbis music in a WAD file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = maphead.n3d&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.pk3&lt;br /&gt;
 | Format = PK3 file (ZIP)&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains mainly formatted text files of actor parameters, level parameters, strings and quiz questions.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = noah3d.wad&lt;br /&gt;
 | Format = [[WAD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive containing Ogg Vorbis music files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = vswap.n3d&lt;br /&gt;
 | Format = ?&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Contains sprites and textures&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:3D]]&lt;br /&gt;
[[Category:First-Person Shooter]]&lt;br /&gt;
[[Category:Wolfenstein 3-D]]&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=10881</id>
		<title>GameMaps Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=10881"/>
		<updated>2023-02-25T10:16:52Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: add header for noah&amp;#039;s ark&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 3&lt;br /&gt;
 | Viewport = &#039;&#039;Varies by game&#039;&#039;&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Catacomb Abyss}}&lt;br /&gt;
   {{Game|Commander Keen Dreams}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Dangerous Dave 3}}&lt;br /&gt;
   {{Game|Dangerous Dave 4}}&lt;br /&gt;
   {{Game|Super 3-D Noah&#039;s Ark}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Rescue Rover 2}}&lt;br /&gt;
   {{Game|Spear of Destiny}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;GameMaps Format&#039;&#039;&#039; stores levels in a number of [[:Category:id Software]] games. The filenames and compression varies somewhat across different games but all files stored in this format were produced by the [[TED5]] level editor.&lt;br /&gt;
&lt;br /&gt;
There are three main varieties of the file format. The most basic version is just [[RLEW compression|RLEW compressed]], the other two are either [[Carmack compression|carmackized]] or [[Huffman Compression|Huffman compressed]] on top of the RLEW compression. Each variation has its own file naming scheme and pattern of external/internal files.&lt;br /&gt;
&lt;br /&gt;
There are two main components to the format.  The game maps proper, which contain the actual level data, and the map headers, which contain both the location of each level&#039;s data within the game maps file, and the tile info for the game.&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! RLEW !! Carmackization !! Huffman !! Head || Gamemaps || Notes&lt;br /&gt;
|-&lt;br /&gt;
| Bio Menace || Yes || No || No || maphead.bm[123] || maptemp.bm[123] || gamemaps.bm[123] and mapthead.bm[123] are present but not used&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Aliens of Gold || Yes || No || No || maphead.bs[16] || maptemp.bs[16] ||&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Planet Strike || Yes || No || No || maphead.vsi || maptemp.vsi ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb 3-D || Yes || Yes || No || Inside .exe || gamemaps.c3d ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Abyss || Yes || Yes || No || Inside .exe || gamemaps.abs ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Apocalypse || Yes || Yes || No || Inside .exe || gamemaps.apc ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Armageddon || Yes || Yes || No || Inside .exe || gamemaps.arm ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen Dreams || Yes || No || Yes || Inside .exe || gamemaps.kdr (v1.00), kdreams.map (v1.01+) ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen 4-6 || Yes || Yes || No || Inside .exe || gamemaps.ck[456] ||&lt;br /&gt;
|-&lt;br /&gt;
| Corridor 7 Alien Invasion || Yes || No || No || ? || ? || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 3 || Yes || No || Yes || Inside .exe || gamemaps.dav ||&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 4 || Yes || No || Yes || Inside .exe || gamemaps.dav ||&lt;br /&gt;
|-&lt;br /&gt;
| Super 3-D Noah&#039;s Ark || Yes || Yes || No || maphead.n3d || gamemaps.n3d ||&lt;br /&gt;
|-&lt;br /&gt;
| Operation Body Count || Yes || No || No || ? || ? || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Rescue Rover 2 || Yes || Yes || No || Inside .exe || gamemaps.rr2 ||&lt;br /&gt;
|-&lt;br /&gt;
| Spear of Destiny || Yes || Yes || No || maphead.sod || gamemaps.sod ||&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.0) || Yes || No || No || maphead.wl1 || maptemp.wl1 ||&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.1 and above)|| Yes || Yes || No || maphead.wl[16] || gamemaps.wl[16] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The games that use Huffman compression will have a MAPDICT (embedded in the game&#039;s main executable).  Those missing the map dictionary are not Huffman encoded.&lt;br /&gt;
&lt;br /&gt;
To work out whether Carmackization is used, read the first UINT16LE in a map plane (the field storing the decompressed size).  If the value matches the expected size of the plane (i.e. width * height * 2), then only RLEW compression is used.  If it doesn&#039;t match, check the second UINT16LE in the file (which will become the first UINT16LE once Carmackization has been removed).  If this matches the expected plane size then the plane must first have Carmackization removed followed by removal of RLEW. The exception to this rule are plane sizes that have either 0xA7 or 0xA8 as the high byte (i.e. any value from 0xA700 to 0xA8FF), as those values would have been encoded differently by the [[Carmack compression]] algorithm.&lt;br /&gt;
&lt;br /&gt;
== Data structures==&lt;br /&gt;
&lt;br /&gt;
The map data is split into two files: The map header (&amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt;) and the main map file (usually &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt;). The map header may be embedded in the game&#039;s main executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; is the working format saved by [[TED5]] when maps are being edited and can be directly accessed and edited by this utility, allowing changes to be made to the game. Note that if the MAPHEAD file exists as an external file, the game always reads it from a file named named &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; for both the &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; variation. TED5 also saves a &amp;lt;tt&amp;gt;MAPTHEAD.xx&amp;lt;/tt&amp;gt; file when editing maps, but that file is only used by TED5 and usually omitted from any game release.&lt;br /&gt;
&lt;br /&gt;
The maps were often compressed even further for the public release versions of the games. This more compressed version of the map file was saved as &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; by TED5. Later releases would omit the additional compression layer and ship with the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; file instead. One possible reason for this could be that the size of the games grew to the point where they would no longer fit onto and be playable from a single floppy disk, and therefore the additional compression was no longer worth the amount of time it took to compress the maps and re-compile the code.&lt;br /&gt;
&lt;br /&gt;
=== Map headers (MAPHEAD) ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[UINT16LE]] || magic || Magic word signalling [[RLEW compression]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[INT32LE]][100] || ptr || 100 pointers to start of level 0-99 data in the game maps file&lt;br /&gt;
|-&lt;br /&gt;
| 402 || {{TODO|Unknown}} || tileinfo || Optional tileinfo data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The map header file (MAPHEAD) is of varying length and contains three main types of data.&lt;br /&gt;
&lt;br /&gt;
* The first is the magic word or flag used for RLEW compression, which is almost always $ABCD in the original files. It could be changed to any other value if necessary.&lt;br /&gt;
&lt;br /&gt;
* The second is 100 level pointers which give the location of the start of level data in the GAMEMAPS file, relative to the start of that file.  A value less than 1 indicates no level (generally 0, but occasionally -1 (0xFFFFFFFF) is used). Using -1 should be preferred over 0, as the pre-Wolf3D version of the engine will treat any negative value as &amp;quot;a non existant map&amp;quot; [sic!] and quit with an appropriate error message, while 0 will cause it to try reading a level header at offset 0 (where the &amp;quot;TED5v1.0&amp;quot; string is usually stored), which will cause all kinds of errors as there is clearly no valid level header at that offset.&lt;br /&gt;
&lt;br /&gt;
* The third is the tileinfo data, which contains tile properties for each tile used in level creation. (These are masked and unmasked and either 8x8, 16x16 or 32x32.)&lt;br /&gt;
&lt;br /&gt;
Many programs treat the tileinfo as a separate file from the MAPHEAD and it is possible to modify a game in this manner.  Indeed, some games such as Wolfenstein 3-D do not have any tileinfo data at all in the map header file (giving a total file length of 402 bytes.) However TED5 works with any tileinfo data in the MAPHEAD.&lt;br /&gt;
&lt;br /&gt;
=== Map data (GAMEMAPS) ===&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file consists of the string &amp;quot;TED5v1.0&amp;quot; and a number of compressed chunks of varying length.  Each level in the file will have from two to four chunks (usually four) depending on the game, with all levels in a given game having the same number of chunks.  These are the level header and 1-3 planes (foreground, background and sprite/info.)  The chunks are in no particular order and it is possible to read through the entire file decompressing chunks as they&#039;re found.&lt;br /&gt;
&lt;br /&gt;
Chunks are ordered by the MAPHEAD file, which will point to the GAMEMAPS level header chunks which in turn contain pointers to the other GAMEMAPS chunks used by that level.&lt;br /&gt;
&lt;br /&gt;
All level data is in the form of [[UINT16LE]] values (or in the case of pointers, [[UINT32LE]].)&lt;br /&gt;
&lt;br /&gt;
==== Level headers ====&lt;br /&gt;
&lt;br /&gt;
The header for each level inside the GAMEMAPS file (which is pointed to by MAPHEAD) is 38 bytes long and &#039;&#039;never&#039;&#039; RLEW compressed.  If the GAMEMAPS file is using Huffman compression, the level header itself is Huffman-compressed.  In that case, the size of the compressed level header can be found in the MAPHEAD file.  Since the uncompressed level header always has a size of 38 bytes, that size is not stored at the beginning of the compressed data.  The header is sometimes followed by a signature &amp;quot;!ID!&amp;quot; string, which would give the header a total size of 42 bytes, but that string is not part of the actual level header.&lt;br /&gt;
&lt;br /&gt;
The expanded size of each map plane is the size of a word ([[UINT16LE]]) times the width times the height.  This is the final, expected size and can be precomputed even if there are two layers of compression.&lt;br /&gt;
&lt;br /&gt;
Plane 0 is background using unmasked tiles, plane 1 is foreground and uses masked tiles, and plane 2 is sprite/info.  Levels must contain a background plane and usually an infoplane.&lt;br /&gt;
&lt;br /&gt;
For the compressed size of each level plane, a value of 0 indicates the plane does not exist. The offset value for unused planes appears to be set to a random number with the most significant byte set to 0xFF, making it either a negative number or an offset close to the 4 gigabyte range. The games only check the compressed size and ignore the offset if the size is 0.&lt;br /&gt;
&lt;br /&gt;
Note that Wolf3D is hard-coded to always load the first two planes, even if the compressed size of a plane is 0. Wolf3D also ignores the width and height stored in the level header and just assumes the level is 64x64 tiles. This also applies to Blake Stone and probably any other game based on the Wolf3D code.&lt;br /&gt;
&lt;br /&gt;
All versions of the &amp;quot;Id Software Caching Manager&amp;quot; ignore the expanded size value at the beginning of the RLEW data and just assume that the size is the same as the size of the plane (width * height * 2).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[INT32LE]] || offPlane0 || Offset in GAMEMAPS to beginning of compressed plane 0 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || INT32LE || offPlane1 || Offset in GAMEMAPS to beginning of compressed plane 1 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || INT32LE || offPlane2 || Offset in GAMEMAPS to beginning of compressed plane 2 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 12 || UINT16LE || lenPlane0 || Length of compressed plane 0 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 14 || UINT16LE || lenPlane1 || Length of compressed plane 1 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || UINT16LE || lenPlane2 || Length of compressed plane 2 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 18 || UINT16LE || width || Width of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || UINT16LE || height || Height of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 22 || char[16] || name || Internal name for level (used only by editor, not displayed in-game. null-terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D, a 4-byte signature string (&amp;quot;!ID!&amp;quot;) will normally be present directly after the level name. The signature does not appear to be used anywhere, but is useful for distinguishing between v1.0 files (the signature string is missing), and files for v1.1 and later (includes the signature string).&lt;br /&gt;
&lt;br /&gt;
== Carmack compression ==&lt;br /&gt;
&lt;br /&gt;
[[Carmack compression]] is the method used to compress later &#039;&#039;id Software&#039;&#039; games, when file size was still a concern.  It is the most efficient and complex compression method and was created specifically to work with the 16-bit word structure of the GameMaps file.  The compression is detailed on its [[Carmack compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Carmackized game maps files are external &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; files and the map header is usually (but not always) stored internally in the executable.  The map header must be extracted and the game maps decompressed before TED5 can access them.  TED5 itself can produce carmackized files and external &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; files. Carmackization does not replace the RLEW compression used in uncompressed data, but compresses this data, that is, the data is doubly compressed.&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D v1.0, map files are not carmackized, only RLEW compression is applied.&lt;br /&gt;
&lt;br /&gt;
== Huffman compression ==&lt;br /&gt;
&lt;br /&gt;
[[Huffman Compression]] was probably used by earlier versions of TED5 (but possibly not TED5 at all) before carmackization was introduced.  It uses the same method to compress its data as is used by &#039;&#039;id Software&#039;&#039; games to compress their graphics and sounds.  Again this compression method works with RLEW compressed data and has its [[Huffman Compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Huffman compression is easily detected since it works on the bit level and thus disrupts the word structure of the game data.  This is easily seen in a hex editor.  Compressed data will not contain the string $00 $00 or indeed even $00 very often. (In contrast, even carmackized data contains both strings hundreds of times.)&lt;br /&gt;
&lt;br /&gt;
There will be two internal files for this format: the map header and the Huffman dictionary (which is always the first dictionary in the executable.)  The map header format is also slightly different, being 502 bytes long, the extra 100 bytes being the length of the compressed level headers in the game maps data, which occur immediately after the normal level header offsets and before the tileinfo. Each entry is one octet indicating the decompressed header length in bytes or zero if the level does not exist. (These can be ignored when decompressing since Huffman data can be read until the decompressed level header&#039;s fixed size is reached, but if they are omitted when writing the MAPHEAD, the game may experience a buffer overflow when reading the maps.)&lt;br /&gt;
&lt;br /&gt;
== Location of internal files ==&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file itself is always external, but in the case of compression, the MAPHEAD is stored internally in the main .exe file.  Executables are themselves compressed with either with LZEXE or PKLite.  Once the .exe has been decompressed it is a trivial task to find the MAPHEAD as it will start with the UINT16LE value $ABCD (i.e. the byte $CD followed by the byte $AB.)  For level editing purposes only the first 402 (or 502) bytes of the file need to be extracted, though it is possible to read the MAPHEAD file to calculate its length.&lt;br /&gt;
&lt;br /&gt;
The following table lists the offsets of the MAPHEAD file for various games, relative to the start of the decompressed game .exe file.&lt;br /&gt;
&lt;br /&gt;
{{TODO|TODO: Add all known versions of all games}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! Version !! Location !! Filename !! Offset !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Bio Menace]] || Freeware || External || &amp;lt;tt&amp;gt;MAPHEAD.BM[123]&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Blake Stone]]: Aliens of Gold || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.BS1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| Registered|| External || &amp;lt;tt&amp;gt;MAPHEAD.BS6&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]] 2: Planet Strike || All || External || &amp;lt;tt&amp;gt;MAPHEAD.VSI&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb 3-D]] (3) || 1.00 || Internal || &amp;lt;tt&amp;gt;CAT3D.EXE&amp;lt;/tt&amp;gt; || $1C570 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Abyss]] (4) || 1.13 || Internal || &amp;lt;tt&amp;gt;CATABYSS.EXE&amp;lt;/tt&amp;gt; || $1C510 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Armageddon]] (5) || 1.01a || Internal || &amp;lt;tt&amp;gt;CATARMA.EXE&amp;lt;/tt&amp;gt; || $1D900 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Apocalypse]] (6) || 1.00b || Internal || &amp;lt;tt&amp;gt;CATAPOC.EXE&amp;lt;/tt&amp;gt; || $1DD50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=3| [[Corridor 7 Alien Invasion]] || Demo || External || &amp;lt;tt&amp;gt;MAPHEAD.DMO&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|| CD || Internal || &amp;lt;tt&amp;gt;CORR7CD.EXE&amp;lt;/tt&amp;gt; || $30D50 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
| Floppy || Internal || &amp;lt;tt&amp;gt;C7.EXE&amp;lt;/tt&amp;gt; || $24BF0 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Commander Keen 4-6|Keen 4]] || Special Demo || ? || ? || ? || File is PKLite compressed&lt;br /&gt;
|-&lt;br /&gt;
| 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN4E.EXE&amp;lt;/tt&amp;gt; || $24830 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 5]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN5E.EXE&amp;lt;/tt&amp;gt; || $25990 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 6]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN6.EXE&amp;lt;/tt&amp;gt; || $25080 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen Dreams]] || 1.13 || Internal || ? || $1FA50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Super 3-D Noah&#039;s Ark]] || All || External || &amp;lt;tt&amp;gt;maphead.n3d&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Operation Body Count]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.BC&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Spear of Destiny]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.SOD&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Wolfenstein 3-D]] || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.WL1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| Registered || External || &amp;lt;tt&amp;gt;MAPHEAD.WL6&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
* [[TED5]] can edit the &amp;lt;tt&amp;gt;GAMEMAPS&amp;lt;/tt&amp;gt; format of any games that use it.  It is the original editor used to create these files.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by Andrew Durdin (adurdin).  If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=10829</id>
		<title>GameMaps Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=10829"/>
		<updated>2022-11-30T01:47:08Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: /* Location of internal files */ add bs aog registered to table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 3&lt;br /&gt;
 | Viewport = &#039;&#039;Varies by game&#039;&#039;&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Catacomb Abyss}}&lt;br /&gt;
   {{Game|Commander Keen Dreams}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Dangerous Dave 3}}&lt;br /&gt;
   {{Game|Dangerous Dave 4}}&lt;br /&gt;
   {{Game|Super 3-D Noah&#039;s Ark}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Rescue Rover 2}}&lt;br /&gt;
   {{Game|Spear of Destiny}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;GameMaps Format&#039;&#039;&#039; stores levels in a number of [[:Category:id Software]] games. The filenames and compression varies somewhat across different games but all files stored in this format were produced by the [[TED5]] level editor.&lt;br /&gt;
&lt;br /&gt;
There are three main varieties of the file format. The most basic version is just [[RLEW compression|RLEW compressed]], the other two are either [[Carmack compression|carmackized]] or [[Huffman Compression|Huffman compressed]] on top of the RLEW compression. Each variation has its own file naming scheme and pattern of external/internal files.&lt;br /&gt;
&lt;br /&gt;
There are two main components to the format.  The game maps proper, which contain the actual level data, and the map headers, which contain both the location of each level&#039;s data within the game maps file, and the tile info for the game.&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! RLEW !! Carmackization !! Huffman !! Head || Gamemaps || Notes&lt;br /&gt;
|-&lt;br /&gt;
| Bio Menace || Yes || No || No || maphead.bm[123] || maptemp.bm[123] || gamemaps.bm[123] and mapthead.bm[123] are present but not used&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Aliens of Gold || Yes || No || No || maphead.bs[16] || maptemp.bs[16] ||&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Planet Strike || Yes || No || No || maphead.vsi || maptemp.vsi ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb 3-D || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Abyss || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Apocalypse || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Armageddon || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen Dreams || Yes || No || Yes || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen 4-6 || Yes || Yes || No || Inside .exe || gamemaps.ck[456] ||&lt;br /&gt;
|-&lt;br /&gt;
| Corridor 7 Alien Invasion || Yes || No || No || ? || ? || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 3 || Yes || No || Yes || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 4 || Yes || No || Yes || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Super 3-D Noah&#039;s Ark || Yes || Yes || No || maphead.n3d || gamemaps.n3d ||&lt;br /&gt;
|-&lt;br /&gt;
| Operation Body Count || Yes || No || No || ? || ? || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Rescue Rover 2 || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Spear of Destiny || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.0) || Yes || No || No || maphead.wl1 || maptemp.wl1 ||&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.1 and above)|| Yes || Yes || No || maphead.wl[16] || gamemaps.wl[16] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The games that use Huffman compression will have a MAPDICT (embedded in the game&#039;s main executable).  Those missing the map dictionary are not Huffman encoded.&lt;br /&gt;
&lt;br /&gt;
To work out whether Carmackization is used, read the first UINT16LE in a map plane (the field storing the decompressed size).  If the value matches the expected size of the plane (i.e. width * height * 2), then only RLEW compression is used.  If it doesn&#039;t match, check the second UINT16LE in the file (which will become the first UINT16LE once Carmackization has been removed).  If this matches the expected plane size then the plane must first have Carmackization removed followed by removal of RLEW. The exception to this rule are plane sizes that have either 0xA7 or 0xA8 as the high byte (i.e. any value from 0xA700 to 0xA8FF), as those values would have been encoded differently by the [[Carmack compression]] algorithm.&lt;br /&gt;
&lt;br /&gt;
== Data structures==&lt;br /&gt;
&lt;br /&gt;
The map data is split into two files: The map header (&amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt;) and the main map file (usually &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt;). The map header may be embedded in the game&#039;s main executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; is the working format saved by [[TED5]] when maps are being edited and can be directly accessed and edited by this utility, allowing changes to be made to the game. Note that if the MAPHEAD file exists as an external file, the game always reads it from a file named named &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; for both the &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; variation. TED5 also saves a &amp;lt;tt&amp;gt;MAPTHEAD.xx&amp;lt;/tt&amp;gt; file when editing maps, but that file is only used by TED5 and usually omitted from any game release.&lt;br /&gt;
&lt;br /&gt;
The maps were often compressed even further for the public release versions of the games. This more compressed version of the map file was saved as &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; by TED5. Later releases would omit the additional compression layer and ship with the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; file instead. One possible reason for this could be that the size of the games grew to the point where they would no longer fit onto and be playable from a single floppy disk, and therefore the additional compression was no longer worth the amount of time it took to compress the maps and re-compile the code.&lt;br /&gt;
&lt;br /&gt;
=== Map headers (MAPHEAD) ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[UINT16LE]] || magic || Magic word signalling [[RLEW compression]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[INT32LE]][100] || ptr || 100 pointers to start of level 0-99 data in the game maps file&lt;br /&gt;
|-&lt;br /&gt;
| 402 || {{TODO|Unknown}} || tileinfo || Optional tileinfo data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The map header file (MAPHEAD) is of varying length and contains three main types of data.&lt;br /&gt;
&lt;br /&gt;
* The first is the magic word or flag used for RLEW compression, which is almost always $ABCD in the original files. It could be changed to any other value if necessary.&lt;br /&gt;
&lt;br /&gt;
* The second is 100 level pointers which give the location of the start of level data in the GAMEMAPS file, relative to the start of that file.  A value less than 1 indicates no level (generally 0, but occasionally -1 (0xFFFFFFFF) is used). Using -1 should be preferred over 0, as the pre-Wolf3D version of the engine will treat any negative value as &amp;quot;a non existant map&amp;quot; [sic!] and quit with an appropriate error message, while 0 will cause it to try reading a level header at offset 0 (where the &amp;quot;TED5v1.0&amp;quot; string is usually stored), which will cause all kinds of errors as there is clearly no valid level header at that offset.&lt;br /&gt;
&lt;br /&gt;
* The third is the tileinfo data, which contains tile properties for each tile used in level creation. (These are masked and unmasked and either 8x8, 16x16 or 32x32.)&lt;br /&gt;
&lt;br /&gt;
Many programs treat the tileinfo as a separate file from the MAPHEAD and it is possible to modify a game in this manner.  Indeed, some games such as Wolfenstein 3-D do not have any tileinfo data at all in the map header file (giving a total file length of 402 bytes.) However TED5 works with any tileinfo data in the MAPHEAD.&lt;br /&gt;
&lt;br /&gt;
=== Map data (GAMEMAPS) ===&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file consists of the string &amp;quot;TED5v1.0&amp;quot; and a number of compressed chunks of varying length.  Each level in the file will have from two to four chunks (usually four) depending on the game, with all levels in a given game having the same number of chunks.  These are the level header and 1-3 planes (foreground, background and sprite/info.)  The chunks are in no particular order and it is possible to read through the entire file decompressing chunks as they&#039;re found.&lt;br /&gt;
&lt;br /&gt;
Chunks are ordered by the MAPHEAD file, which will point to the GAMEMAPS level header chunks which in turn contain pointers to the other GAMEMAPS chunks used by that level.&lt;br /&gt;
&lt;br /&gt;
All level data is in the form of [[UINT16LE]] values (or in the case of pointers, [[UINT32LE]].)&lt;br /&gt;
&lt;br /&gt;
==== Level headers ====&lt;br /&gt;
&lt;br /&gt;
The header for each level inside the GAMEMAPS file (which is pointed to by MAPHEAD) is 38 bytes long and &#039;&#039;never&#039;&#039; RLEW compressed.  If the GAMEMAPS file is using Huffman compression, the level header itself is Huffman-compressed.  In that case, the size of the compressed level header can be found in the MAPHEAD file.  Since the uncompressed level header always has a size of 38 bytes, that size is not stored at the beginning of the compressed data.  The header is sometimes followed by a signature &amp;quot;!ID!&amp;quot; string, which would give the header a total size of 42 bytes, but that string is not part of the actual level header.&lt;br /&gt;
&lt;br /&gt;
Plane 0 is background using unmasked tiles, plane 1 is foreground and uses masked tiles, and plane 2 is sprite/info.  Levels must contain a background plane and usually an infoplane.&lt;br /&gt;
&lt;br /&gt;
For the compressed size of each level plane, a value of 0 indicates the plane does not exist. The offset value for unused planes appears to be set to a random number with the most significant byte set to 0xFF, making it either a negative number or an offset close to the 4 gigabyte range. The games only check the compressed size and ignore the offset if the size is 0.&lt;br /&gt;
&lt;br /&gt;
Note that Wolf3D is hard-coded to always load the first two planes, even if the compressed size of a plane is 0. Wolf3D also ignores the width and height stored in the level header and just assumes the level is 64x64 tiles. This also applies to Blake Stone and probably any other game based on the Wolf3D code.&lt;br /&gt;
&lt;br /&gt;
All versions of the &amp;quot;Id Software Caching Manager&amp;quot; ignore the expanded size value at the beginning of the RLEW data and just assume that the size is the same as the size of the plane (width * height * 2).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[INT32LE]] || offPlane0 || Offset in GAMEMAPS to beginning of compressed plane 0 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || INT32LE || offPlane1 || Offset in GAMEMAPS to beginning of compressed plane 1 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || INT32LE || offPlane2 || Offset in GAMEMAPS to beginning of compressed plane 2 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 12 || UINT16LE || lenPlane0 || Length of compressed plane 0 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 14 || UINT16LE || lenPlane1 || Length of compressed plane 1 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || UINT16LE || lenPlane2 || Length of compressed plane 2 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 18 || UINT16LE || width || Width of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || UINT16LE || height || Height of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 22 || char[16] || name || Internal name for level (used only by editor, not displayed in-game. null-terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D, a 4-byte signature string (&amp;quot;!ID!&amp;quot;) will normally be present directly after the level name. The signature does not appear to be used anywhere, but is useful for distinguishing between v1.0 files (the signature string is missing), and files for v1.1 and later (includes the signature string).&lt;br /&gt;
&lt;br /&gt;
== Carmack compression ==&lt;br /&gt;
&lt;br /&gt;
[[Carmack compression]] is the method used to compress later &#039;&#039;id Software&#039;&#039; games, when file size was still a concern.  It is the most efficient and complex compression method and was created specifically to work with the 16-bit word structure of the GameMaps file.  The compression is detailed on its [[Carmack compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Carmackized game maps files are external &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; files and the map header is usually (but not always) stored internally in the executable.  The map header must be extracted and the game maps decompressed before TED5 can access them.  TED5 itself can produce carmackized files and external &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; files. Carmackization does not replace the RLEW compression used in uncompressed data, but compresses this data, that is, the data is doubly compressed.&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D v1.0, map files are not carmackized, only RLEW compression is applied.&lt;br /&gt;
&lt;br /&gt;
== Huffman compression ==&lt;br /&gt;
&lt;br /&gt;
[[Huffman Compression]] was probably used by earlier versions of TED5 (but possibly not TED5 at all) before carmackization was introduced.  It uses the same method to compress its data as is used by &#039;&#039;id Software&#039;&#039; games to compress their graphics and sounds.  Again this compression method works with RLEW compressed data and has its [[Huffman Compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Huffman compression is easily detected since it works on the bit level and thus disrupts the word structure of the game data.  This is easily seen in a hex editor.  Compressed data will not contain the string $00 $00 or indeed even $00 very often. (In contrast, even carmackized data contains both strings hundreds of times.)&lt;br /&gt;
&lt;br /&gt;
There will be two internal files for this format: the map header and the Huffman dictionary (which is always the first dictionary in the executable.)  The map header format is also slightly different, being 502 bytes long, the extra 100 bytes being the length of the compressed level headers in the game maps data, which occur immediately after the normal level header offsets and before the tileinfo. Each entry is one octet indicating the decompressed header length in bytes or zero if the level does not exist. (These can be ignored when decompressing since Huffman data can be read until the decompressed level header&#039;s fixed size is reached, but if they are omitted when writing the MAPHEAD, the game may experience a buffer overflow when reading the maps.)&lt;br /&gt;
&lt;br /&gt;
== Location of internal files ==&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file itself is always external, but in the case of compression, the MAPHEAD is stored internally in the main .exe file.  Executables are themselves compressed with either with LZEXE or PKLite.  Once the .exe has been decompressed it is a trivial task to find the MAPHEAD as it will start with the UINT16LE value $ABCD (i.e. the byte $CD followed by the byte $AB.)  For level editing purposes only the first 402 (or 502) bytes of the file need to be extracted, though it is possible to read the MAPHEAD file to calculate its length.&lt;br /&gt;
&lt;br /&gt;
The following table lists the offsets of the MAPHEAD file for various games, relative to the start of the decompressed game .exe file.&lt;br /&gt;
&lt;br /&gt;
{{TODO|TODO: Add all known versions of all games}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! Version !! Location !! Filename !! Offset !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Bio Menace]] || Freeware || External || &amp;lt;tt&amp;gt;MAPHEAD.BM[123]&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Blake Stone]]: Aliens of Gold || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.BS1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| Registered|| External || &amp;lt;tt&amp;gt;MAPHEAD.BS6&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]] 2: Planet Strike || All || External || &amp;lt;tt&amp;gt;MAPHEAD.VSI&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb 3-D]] (3) || 1.00 || Internal || &amp;lt;tt&amp;gt;CAT3D.EXE&amp;lt;/tt&amp;gt; || $1C570 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Abyss]] (4) || 1.13 || Internal || &amp;lt;tt&amp;gt;CATABYSS.EXE&amp;lt;/tt&amp;gt; || $1C510 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Armageddon]] (5) || 1.01a || Internal || &amp;lt;tt&amp;gt;CATARMA.EXE&amp;lt;/tt&amp;gt; || $1D900 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Apocalypse]] (6) || 1.00b || Internal || &amp;lt;tt&amp;gt;CATAPOC.EXE&amp;lt;/tt&amp;gt; || $1DD50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=3| [[Corridor 7 Alien Invasion]] || Demo || External || &amp;lt;tt&amp;gt;MAPHEAD.DMO&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|| CD || Internal || &amp;lt;tt&amp;gt;CORR7CD.EXE&amp;lt;/tt&amp;gt; || $30D50 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
| Floppy || Internal || &amp;lt;tt&amp;gt;C7.EXE&amp;lt;/tt&amp;gt; || $24BF0 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Commander Keen 4-6|Keen 4]] || Special Demo || ? || ? || ? || File is PKLite compressed&lt;br /&gt;
|-&lt;br /&gt;
| 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN4E.EXE&amp;lt;/tt&amp;gt; || $24830 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 5]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN5E.EXE&amp;lt;/tt&amp;gt; || $25990 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 6]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN6.EXE&amp;lt;/tt&amp;gt; || $25080 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen Dreams]] || 1.13 || Internal || ? || $1FA50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Noah&#039;s Ark 3D]] || All || External || ? || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Operation Body Count]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.BC&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Spear of Destiny]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.SOD&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Wolfenstein 3-D]] || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.WL1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| Registered || External || &amp;lt;tt&amp;gt;MAPHEAD.WL6&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
* [[TED5]] can edit the &amp;lt;tt&amp;gt;GAMEMAPS&amp;lt;/tt&amp;gt; format of any games that use it.  It is the original editor used to create these files.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by Andrew Durdin (adurdin).  If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=10828</id>
		<title>GameMaps Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=10828"/>
		<updated>2022-11-30T01:45:10Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: Undo revision 10826 by Congusbongus (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 3&lt;br /&gt;
 | Viewport = &#039;&#039;Varies by game&#039;&#039;&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Catacomb Abyss}}&lt;br /&gt;
   {{Game|Commander Keen Dreams}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Dangerous Dave 3}}&lt;br /&gt;
   {{Game|Dangerous Dave 4}}&lt;br /&gt;
   {{Game|Super 3-D Noah&#039;s Ark}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Rescue Rover 2}}&lt;br /&gt;
   {{Game|Spear of Destiny}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;GameMaps Format&#039;&#039;&#039; stores levels in a number of [[:Category:id Software]] games. The filenames and compression varies somewhat across different games but all files stored in this format were produced by the [[TED5]] level editor.&lt;br /&gt;
&lt;br /&gt;
There are three main varieties of the file format. The most basic version is just [[RLEW compression|RLEW compressed]], the other two are either [[Carmack compression|carmackized]] or [[Huffman Compression|Huffman compressed]] on top of the RLEW compression. Each variation has its own file naming scheme and pattern of external/internal files.&lt;br /&gt;
&lt;br /&gt;
There are two main components to the format.  The game maps proper, which contain the actual level data, and the map headers, which contain both the location of each level&#039;s data within the game maps file, and the tile info for the game.&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! RLEW !! Carmackization !! Huffman !! Head || Gamemaps || Notes&lt;br /&gt;
|-&lt;br /&gt;
| Bio Menace || Yes || No || No || maphead.bm[123] || maptemp.bm[123] || gamemaps.bm[123] and mapthead.bm[123] are present but not used&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Aliens of Gold || Yes || No || No || maphead.bs[16] || maptemp.bs[16] ||&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Planet Strike || Yes || No || No || maphead.vsi || maptemp.vsi ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb 3-D || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Abyss || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Apocalypse || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Armageddon || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen Dreams || Yes || No || Yes || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen 4-6 || Yes || Yes || No || Inside .exe || gamemaps.ck[456] ||&lt;br /&gt;
|-&lt;br /&gt;
| Corridor 7 Alien Invasion || Yes || No || No || ? || ? || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 3 || Yes || No || Yes || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 4 || Yes || No || Yes || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Super 3-D Noah&#039;s Ark || Yes || Yes || No || maphead.n3d || gamemaps.n3d ||&lt;br /&gt;
|-&lt;br /&gt;
| Operation Body Count || Yes || No || No || ? || ? || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Rescue Rover 2 || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Spear of Destiny || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.0) || Yes || No || No || maphead.wl1 || maptemp.wl1 ||&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.1 and above)|| Yes || Yes || No || maphead.wl[16] || gamemaps.wl[16] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The games that use Huffman compression will have a MAPDICT (embedded in the game&#039;s main executable).  Those missing the map dictionary are not Huffman encoded.&lt;br /&gt;
&lt;br /&gt;
To work out whether Carmackization is used, read the first UINT16LE in a map plane (the field storing the decompressed size).  If the value matches the expected size of the plane (i.e. width * height * 2), then only RLEW compression is used.  If it doesn&#039;t match, check the second UINT16LE in the file (which will become the first UINT16LE once Carmackization has been removed).  If this matches the expected plane size then the plane must first have Carmackization removed followed by removal of RLEW. The exception to this rule are plane sizes that have either 0xA7 or 0xA8 as the high byte (i.e. any value from 0xA700 to 0xA8FF), as those values would have been encoded differently by the [[Carmack compression]] algorithm.&lt;br /&gt;
&lt;br /&gt;
== Data structures==&lt;br /&gt;
&lt;br /&gt;
The map data is split into two files: The map header (&amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt;) and the main map file (usually &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt;). The map header may be embedded in the game&#039;s main executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; is the working format saved by [[TED5]] when maps are being edited and can be directly accessed and edited by this utility, allowing changes to be made to the game. Note that if the MAPHEAD file exists as an external file, the game always reads it from a file named named &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; for both the &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; variation. TED5 also saves a &amp;lt;tt&amp;gt;MAPTHEAD.xx&amp;lt;/tt&amp;gt; file when editing maps, but that file is only used by TED5 and usually omitted from any game release.&lt;br /&gt;
&lt;br /&gt;
The maps were often compressed even further for the public release versions of the games. This more compressed version of the map file was saved as &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; by TED5. Later releases would omit the additional compression layer and ship with the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; file instead. One possible reason for this could be that the size of the games grew to the point where they would no longer fit onto and be playable from a single floppy disk, and therefore the additional compression was no longer worth the amount of time it took to compress the maps and re-compile the code.&lt;br /&gt;
&lt;br /&gt;
=== Map headers (MAPHEAD) ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[UINT16LE]] || magic || Magic word signalling [[RLEW compression]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[INT32LE]][100] || ptr || 100 pointers to start of level 0-99 data in the game maps file&lt;br /&gt;
|-&lt;br /&gt;
| 402 || {{TODO|Unknown}} || tileinfo || Optional tileinfo data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The map header file (MAPHEAD) is of varying length and contains three main types of data.&lt;br /&gt;
&lt;br /&gt;
* The first is the magic word or flag used for RLEW compression, which is almost always $ABCD in the original files. It could be changed to any other value if necessary.&lt;br /&gt;
&lt;br /&gt;
* The second is 100 level pointers which give the location of the start of level data in the GAMEMAPS file, relative to the start of that file.  A value less than 1 indicates no level (generally 0, but occasionally -1 (0xFFFFFFFF) is used). Using -1 should be preferred over 0, as the pre-Wolf3D version of the engine will treat any negative value as &amp;quot;a non existant map&amp;quot; [sic!] and quit with an appropriate error message, while 0 will cause it to try reading a level header at offset 0 (where the &amp;quot;TED5v1.0&amp;quot; string is usually stored), which will cause all kinds of errors as there is clearly no valid level header at that offset.&lt;br /&gt;
&lt;br /&gt;
* The third is the tileinfo data, which contains tile properties for each tile used in level creation. (These are masked and unmasked and either 8x8, 16x16 or 32x32.)&lt;br /&gt;
&lt;br /&gt;
Many programs treat the tileinfo as a separate file from the MAPHEAD and it is possible to modify a game in this manner.  Indeed, some games such as Wolfenstein 3-D do not have any tileinfo data at all in the map header file (giving a total file length of 402 bytes.) However TED5 works with any tileinfo data in the MAPHEAD.&lt;br /&gt;
&lt;br /&gt;
=== Map data (GAMEMAPS) ===&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file consists of the string &amp;quot;TED5v1.0&amp;quot; and a number of compressed chunks of varying length.  Each level in the file will have from two to four chunks (usually four) depending on the game, with all levels in a given game having the same number of chunks.  These are the level header and 1-3 planes (foreground, background and sprite/info.)  The chunks are in no particular order and it is possible to read through the entire file decompressing chunks as they&#039;re found.&lt;br /&gt;
&lt;br /&gt;
Chunks are ordered by the MAPHEAD file, which will point to the GAMEMAPS level header chunks which in turn contain pointers to the other GAMEMAPS chunks used by that level.&lt;br /&gt;
&lt;br /&gt;
All level data is in the form of [[UINT16LE]] values (or in the case of pointers, [[UINT32LE]].)&lt;br /&gt;
&lt;br /&gt;
==== Level headers ====&lt;br /&gt;
&lt;br /&gt;
The header for each level inside the GAMEMAPS file (which is pointed to by MAPHEAD) is 38 bytes long and &#039;&#039;never&#039;&#039; RLEW compressed.  If the GAMEMAPS file is using Huffman compression, the level header itself is Huffman-compressed.  In that case, the size of the compressed level header can be found in the MAPHEAD file.  Since the uncompressed level header always has a size of 38 bytes, that size is not stored at the beginning of the compressed data.  The header is sometimes followed by a signature &amp;quot;!ID!&amp;quot; string, which would give the header a total size of 42 bytes, but that string is not part of the actual level header.&lt;br /&gt;
&lt;br /&gt;
Plane 0 is background using unmasked tiles, plane 1 is foreground and uses masked tiles, and plane 2 is sprite/info.  Levels must contain a background plane and usually an infoplane.&lt;br /&gt;
&lt;br /&gt;
For the compressed size of each level plane, a value of 0 indicates the plane does not exist. The offset value for unused planes appears to be set to a random number with the most significant byte set to 0xFF, making it either a negative number or an offset close to the 4 gigabyte range. The games only check the compressed size and ignore the offset if the size is 0.&lt;br /&gt;
&lt;br /&gt;
Note that Wolf3D is hard-coded to always load the first two planes, even if the compressed size of a plane is 0. Wolf3D also ignores the width and height stored in the level header and just assumes the level is 64x64 tiles. This also applies to Blake Stone and probably any other game based on the Wolf3D code.&lt;br /&gt;
&lt;br /&gt;
All versions of the &amp;quot;Id Software Caching Manager&amp;quot; ignore the expanded size value at the beginning of the RLEW data and just assume that the size is the same as the size of the plane (width * height * 2).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[INT32LE]] || offPlane0 || Offset in GAMEMAPS to beginning of compressed plane 0 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || INT32LE || offPlane1 || Offset in GAMEMAPS to beginning of compressed plane 1 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || INT32LE || offPlane2 || Offset in GAMEMAPS to beginning of compressed plane 2 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 12 || UINT16LE || lenPlane0 || Length of compressed plane 0 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 14 || UINT16LE || lenPlane1 || Length of compressed plane 1 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || UINT16LE || lenPlane2 || Length of compressed plane 2 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 18 || UINT16LE || width || Width of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || UINT16LE || height || Height of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 22 || char[16] || name || Internal name for level (used only by editor, not displayed in-game. null-terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D, a 4-byte signature string (&amp;quot;!ID!&amp;quot;) will normally be present directly after the level name. The signature does not appear to be used anywhere, but is useful for distinguishing between v1.0 files (the signature string is missing), and files for v1.1 and later (includes the signature string).&lt;br /&gt;
&lt;br /&gt;
== Carmack compression ==&lt;br /&gt;
&lt;br /&gt;
[[Carmack compression]] is the method used to compress later &#039;&#039;id Software&#039;&#039; games, when file size was still a concern.  It is the most efficient and complex compression method and was created specifically to work with the 16-bit word structure of the GameMaps file.  The compression is detailed on its [[Carmack compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Carmackized game maps files are external &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; files and the map header is usually (but not always) stored internally in the executable.  The map header must be extracted and the game maps decompressed before TED5 can access them.  TED5 itself can produce carmackized files and external &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; files. Carmackization does not replace the RLEW compression used in uncompressed data, but compresses this data, that is, the data is doubly compressed.&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D v1.0, map files are not carmackized, only RLEW compression is applied.&lt;br /&gt;
&lt;br /&gt;
== Huffman compression ==&lt;br /&gt;
&lt;br /&gt;
[[Huffman Compression]] was probably used by earlier versions of TED5 (but possibly not TED5 at all) before carmackization was introduced.  It uses the same method to compress its data as is used by &#039;&#039;id Software&#039;&#039; games to compress their graphics and sounds.  Again this compression method works with RLEW compressed data and has its [[Huffman Compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Huffman compression is easily detected since it works on the bit level and thus disrupts the word structure of the game data.  This is easily seen in a hex editor.  Compressed data will not contain the string $00 $00 or indeed even $00 very often. (In contrast, even carmackized data contains both strings hundreds of times.)&lt;br /&gt;
&lt;br /&gt;
There will be two internal files for this format: the map header and the Huffman dictionary (which is always the first dictionary in the executable.)  The map header format is also slightly different, being 502 bytes long, the extra 100 bytes being the length of the compressed level headers in the game maps data, which occur immediately after the normal level header offsets and before the tileinfo. Each entry is one octet indicating the decompressed header length in bytes or zero if the level does not exist. (These can be ignored when decompressing since Huffman data can be read until the decompressed level header&#039;s fixed size is reached, but if they are omitted when writing the MAPHEAD, the game may experience a buffer overflow when reading the maps.)&lt;br /&gt;
&lt;br /&gt;
== Location of internal files ==&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file itself is always external, but in the case of compression, the MAPHEAD is stored internally in the main .exe file.  Executables are themselves compressed with either with LZEXE or PKLite.  Once the .exe has been decompressed it is a trivial task to find the MAPHEAD as it will start with the UINT16LE value $ABCD (i.e. the byte $CD followed by the byte $AB.)  For level editing purposes only the first 402 (or 502) bytes of the file need to be extracted, though it is possible to read the MAPHEAD file to calculate its length.&lt;br /&gt;
&lt;br /&gt;
The following table lists the offsets of the MAPHEAD file for various games, relative to the start of the decompressed game .exe file.&lt;br /&gt;
&lt;br /&gt;
{{TODO|TODO: Add all known versions of all games}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! Version !! Location !! Filename !! Offset !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Bio Menace]] || Freeware || External || &amp;lt;tt&amp;gt;MAPHEAD.BM[123]&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]]: Aliens of Gold || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.BS1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]] 2: Planet Strike || All || External || &amp;lt;tt&amp;gt;MAPHEAD.VSI&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb 3-D]] (3) || 1.00 || Internal || &amp;lt;tt&amp;gt;CAT3D.EXE&amp;lt;/tt&amp;gt; || $1C570 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Abyss]] (4) || 1.13 || Internal || &amp;lt;tt&amp;gt;CATABYSS.EXE&amp;lt;/tt&amp;gt; || $1C510 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Armageddon]] (5) || 1.01a || Internal || &amp;lt;tt&amp;gt;CATARMA.EXE&amp;lt;/tt&amp;gt; || $1D900 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Apocalypse]] (6) || 1.00b || Internal || &amp;lt;tt&amp;gt;CATAPOC.EXE&amp;lt;/tt&amp;gt; || $1DD50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=3| [[Corridor 7 Alien Invasion]] || Demo || External || &amp;lt;tt&amp;gt;MAPHEAD.DMO&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|| CD || Internal || &amp;lt;tt&amp;gt;CORR7CD.EXE&amp;lt;/tt&amp;gt; || $30D50 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
| Floppy || Internal || &amp;lt;tt&amp;gt;C7.EXE&amp;lt;/tt&amp;gt; || $24BF0 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Commander Keen 4-6|Keen 4]] || Special Demo || ? || ? || ? || File is PKLite compressed&lt;br /&gt;
|-&lt;br /&gt;
| 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN4E.EXE&amp;lt;/tt&amp;gt; || $24830 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 5]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN5E.EXE&amp;lt;/tt&amp;gt; || $25990 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 6]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN6.EXE&amp;lt;/tt&amp;gt; || $25080 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen Dreams]] || 1.13 || Internal || ? || $1FA50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Noah&#039;s Ark 3D]] || All || External || ? || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Operation Body Count]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.BC&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Spear of Destiny]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.SOD&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Wolfenstein 3-D]] || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.WL1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| Registered || External || &amp;lt;tt&amp;gt;MAPHEAD.WL6&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
* [[TED5]] can edit the &amp;lt;tt&amp;gt;GAMEMAPS&amp;lt;/tt&amp;gt; format of any games that use it.  It is the original editor used to create these files.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by Andrew Durdin (adurdin).  If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Id_Software_RLEW_compression&amp;diff=10827</id>
		<title>Id Software RLEW compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Id_Software_RLEW_compression&amp;diff=10827"/>
		<updated>2022-11-30T01:43:47Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: Add finalLength table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:id Software RLEW compression}}&lt;br /&gt;
{{Compression Infobox&lt;br /&gt;
 | Type = Stream&lt;br /&gt;
 | UnitSize = 2-byte&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Catacomb Abyss}}&lt;br /&gt;
   {{Game|Catacomb Apocalypse}}&lt;br /&gt;
   {{Game|Catacomb Armageddon}}&lt;br /&gt;
   {{Game|Commander Keen 1-3}}&lt;br /&gt;
   {{Game|Commander Keen Dreams}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Dangerous Dave 2}}&lt;br /&gt;
   {{Game|Dangerous Dave 3}}&lt;br /&gt;
   {{Game|Dangerous Dave 4}}&lt;br /&gt;
   {{Game|Hovertank 3-D}}&lt;br /&gt;
   {{Game|Super 3-D Noah&#039;s Ark}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Rescue Rover}}&lt;br /&gt;
   {{Game|Rescue Rover 2}}&lt;br /&gt;
   {{Game|Shadow Knights}}&lt;br /&gt;
   {{Game|Slordax}}&lt;br /&gt;
   {{Game|Spear of Destiny}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;id Software RLEW compression&#039;&#039;&#039; was used in a number of id&#039;s early games.  It is an [[RLE Compression]] algorithm that works at the word level, where each word is a group of two bytes (16 bits).  The algorithm is used on files that themselves use 16-bit words as their basic units, such as game levels, where a single 16-bit value such as &amp;quot;12 34&amp;quot; might be repeated multiple times in a row.  A byte-level RLE algorithm would not be able to compress this data at all, as each byte is different to the previous, however the same RLE algorithm operating at the 16-bit word level can achieve good compression.&lt;br /&gt;
&lt;br /&gt;
The use of 16-bit values over 8-bit also yields other benefits, such as the maximum repetition count increasing from around 256 to 65,536, allowing even greater compression of data with large numbers of repeated values.  The RLE code word can also be chosen to be less likely to appear in the data, minimising the number of escapes required.  While 8-bit RLE has a 1 in 256 chance of a given byte needing to be escaped, 16-bit RLE reduces that to 1 in 65,536.&lt;br /&gt;
&lt;br /&gt;
RLEW compression is almost exclusively used to compress level data. Most revisions of the early game engines by id Software used arrays of 16 bit values to store the level data.&lt;br /&gt;
&lt;br /&gt;
== Algorithm ==&lt;br /&gt;
&lt;br /&gt;
The algorithm is very straightforward.  Every 16-bit value is passed through unchanged until an RLE code value is encountered.  Typically this is 0xFEFE or 0xABCD (the latter stored as the two bytes 0xCD 0xAB in little-endian order).  When this code word is read, instead of writing it out like the other values, two further words are read.  The first is the number of times to repeat the word, and the second is the value to be repeated.&lt;br /&gt;
&lt;br /&gt;
All 16-bit words are in little-endian order, although in practice only the code word and the repeat count need to be treated as little-endian.  The other values can be read in either endian so long as they are read and written unchanged.&lt;br /&gt;
&lt;br /&gt;
Data is usually read from the start of a file to the end, but many implementations have the size of the decompressed data as a [[UINT16LE]] at the beginning of the file.  This should be used where possible so that trailing data at the end of the file does not inadvertently get read as input data.&lt;br /&gt;
&lt;br /&gt;
A simple algorithm for decompressing this format is as follows;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;If implemented, get the first word in the file (here called &amp;lt;tt&amp;gt;finalLength&amp;lt;/tt&amp;gt; - see table)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;While the length of the output data is less than &amp;lt;tt&amp;gt;finalLength&amp;lt;/tt&amp;gt;:&lt;br /&gt;
    &amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Read a word from the input data&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Is this word the RLE code word? (e.g. 0xFEFE)&lt;br /&gt;
      &amp;lt;ul&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;If yes;&lt;br /&gt;
          &amp;lt;ol style=&amp;quot;list-style-type:lower-roman&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Get the next two words, the first as &amp;lt;tt&amp;gt;Count&amp;lt;/tt&amp;gt; and the second as &amp;lt;tt&amp;gt;Value&amp;lt;/tt&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Write Value as a word, &amp;lt;tt&amp;gt;Count&amp;lt;/tt&amp;gt; times.&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Move forward three words and go to 2.&amp;lt;/li&amp;gt;&lt;br /&gt;
          &amp;lt;/ol&amp;gt;&lt;br /&gt;
        &amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;If no;&lt;br /&gt;
          &amp;lt;ol style=&amp;quot;list-style-type:lower-roman&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Write the word to the output.&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Move forward a word and go to 2.&amp;lt;/li&amp;gt;&lt;br /&gt;
          &amp;lt;/ol&amp;gt;&lt;br /&gt;
        &amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! finalLength&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Aliens of Gold || No (use 64x64 words as finalLength)&lt;br /&gt;
|-&lt;br /&gt;
| Spear of Destiny || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.0) || Yes&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.1 and above) || Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Minimal compression ===&lt;br /&gt;
&lt;br /&gt;
As only the code word needs to be handled specially, a quick compression function can be implemented by passing through all values as-is, and if the code word has just been written then it is followed by the additional words 0x0001 and the code word again.  For example if the code word is 0xFEFE, then it will end up in the output as &amp;lt;tt&amp;gt;FEFE 0001 FEFE&amp;lt;/tt&amp;gt;, meaning &amp;quot;RLE sequence begins: write 0xFEFE once&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Inefficiencies and hidden data ===&lt;br /&gt;
&lt;br /&gt;
It is interesting to note that as only the RLEW code word needs to be escaped, no other word would ever need to be repeated only once.  This means the escape sequence &amp;lt;tt&amp;gt;FEFE 0001 FEFE&amp;lt;/tt&amp;gt; could have been shortened to &amp;lt;tt&amp;gt;FEFE 0001&amp;lt;/tt&amp;gt; by omitting the field containing the word to repeat, with the assumption that the only word ever written just once is the RLEW code word itself.&lt;br /&gt;
&lt;br /&gt;
Furthermore, the &amp;lt;tt&amp;gt;Count&amp;lt;/tt&amp;gt; field in the RLE sequence is set to 1 to write the word once.  This means it can be set to 0 to write the word zero times, effectively discarding that word.  In theory this could allow &amp;quot;hidden&amp;quot; data to be embedded in the compressed data stream that would be skipped over by the decompressor and not affect the output decompressed data.&lt;br /&gt;
&lt;br /&gt;
Most RLE algorithms avoid this inefficiency by adding 1 (or more) to the count value before using it, meaning a count of 0 writes the word once, a count of 1 writes it twice, and so on.  In this case, as the RLE sequence takes up three words, no space is saved until at least four words are converted into an RLE code.  This means adding 3 to the count would have been most efficient, with a count of 0 reserved as a special case for handling the escaping of the code word itself.  Thus 0 would write the code word, 1 would repeat the word 4 times, 2 would repeat it 5 times, and so on.  Words appearing 2 or 3 times in a row would be written out as-is without incurring any space penalty, with the sole exception of the RLEW code word appearing 2 or 3 times in a row, which would incur a small space penalty.&lt;br /&gt;
&lt;br /&gt;
=== RLEB compression ===&lt;br /&gt;
&lt;br /&gt;
This is almost exactly the same as RLEW compression. The only difference is that it operates on bytes instead of words. The flag value for this compression is $FE in most cases.&lt;br /&gt;
&lt;br /&gt;
[[Dangerous Dave 2]], [[Rescue Rover]] and [[Shadow Knights]] use this method to compress some of their full-screen images. [[Rescue Rover]] and [[Shadow Knights]] also use this method to compress the game&#039;s sprite graphics.&lt;br /&gt;
&lt;br /&gt;
=== Example code ===&lt;br /&gt;
&lt;br /&gt;
* Javascript: the [https://github.com/camoto-project/gamecompjs/blob/master/formats/cmp-rlew-id.js cmp-rlew-id] algorithm in gamecomp.js (full compression and decompression)&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=10826</id>
		<title>GameMaps Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=10826"/>
		<updated>2022-11-30T01:09:03Z</updated>

		<summary type="html">&lt;p&gt;Congusbongus: blake stone is carmackized&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 3&lt;br /&gt;
 | Viewport = &#039;&#039;Varies by game&#039;&#039;&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Catacomb Abyss}}&lt;br /&gt;
   {{Game|Commander Keen Dreams}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Dangerous Dave 3}}&lt;br /&gt;
   {{Game|Dangerous Dave 4}}&lt;br /&gt;
   {{Game|Super 3-D Noah&#039;s Ark}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Rescue Rover 2}}&lt;br /&gt;
   {{Game|Spear of Destiny}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;GameMaps Format&#039;&#039;&#039; stores levels in a number of [[:Category:id Software]] games. The filenames and compression varies somewhat across different games but all files stored in this format were produced by the [[TED5]] level editor.&lt;br /&gt;
&lt;br /&gt;
There are three main varieties of the file format. The most basic version is just [[RLEW compression|RLEW compressed]], the other two are either [[Carmack compression|carmackized]] or [[Huffman Compression|Huffman compressed]] on top of the RLEW compression. Each variation has its own file naming scheme and pattern of external/internal files.&lt;br /&gt;
&lt;br /&gt;
There are two main components to the format.  The game maps proper, which contain the actual level data, and the map headers, which contain both the location of each level&#039;s data within the game maps file, and the tile info for the game.&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! RLEW !! Carmackization !! Huffman !! Head || Gamemaps || Notes&lt;br /&gt;
|-&lt;br /&gt;
| Bio Menace || Yes || No || No || maphead.bm[123] || maptemp.bm[123] || gamemaps.bm[123] and mapthead.bm[123] are present but not used&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Aliens of Gold || Yes || Yes || No || maphead.bs[16] || maptemp.bs[16] ||&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Planet Strike || Yes || Yes || No || maphead.vsi || maptemp.vsi ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb 3-D || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Abyss || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Apocalypse || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Armageddon || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen Dreams || Yes || No || Yes || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen 4-6 || Yes || Yes || No || Inside .exe || gamemaps.ck[456] ||&lt;br /&gt;
|-&lt;br /&gt;
| Corridor 7 Alien Invasion || Yes || No || No || ? || ? || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 3 || Yes || No || Yes || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 4 || Yes || No || Yes || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Super 3-D Noah&#039;s Ark || Yes || Yes || No || maphead.n3d || gamemaps.n3d ||&lt;br /&gt;
|-&lt;br /&gt;
| Operation Body Count || Yes || No || No || ? || ? || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Rescue Rover 2 || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Spear of Destiny || Yes || Yes || No || ? || ? ||&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.0) || Yes || No || No || maphead.wl1 || maptemp.wl1 ||&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.1 and above)|| Yes || Yes || No || maphead.wl[16] || gamemaps.wl[16] ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The games that use Huffman compression will have a MAPDICT (embedded in the game&#039;s main executable).  Those missing the map dictionary are not Huffman encoded.&lt;br /&gt;
&lt;br /&gt;
To work out whether Carmackization is used, read the first UINT16LE in a map plane (the field storing the decompressed size).  If the value matches the expected size of the plane (i.e. width * height * 2), then only RLEW compression is used.  If it doesn&#039;t match, check the second UINT16LE in the file (which will become the first UINT16LE once Carmackization has been removed).  If this matches the expected plane size then the plane must first have Carmackization removed followed by removal of RLEW. The exception to this rule are plane sizes that have either 0xA7 or 0xA8 as the high byte (i.e. any value from 0xA700 to 0xA8FF), as those values would have been encoded differently by the [[Carmack compression]] algorithm.&lt;br /&gt;
&lt;br /&gt;
== Data structures==&lt;br /&gt;
&lt;br /&gt;
The map data is split into two files: The map header (&amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt;) and the main map file (usually &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt;). The map header may be embedded in the game&#039;s main executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; is the working format saved by [[TED5]] when maps are being edited and can be directly accessed and edited by this utility, allowing changes to be made to the game. Note that if the MAPHEAD file exists as an external file, the game always reads it from a file named named &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; for both the &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; variation. TED5 also saves a &amp;lt;tt&amp;gt;MAPTHEAD.xx&amp;lt;/tt&amp;gt; file when editing maps, but that file is only used by TED5 and usually omitted from any game release.&lt;br /&gt;
&lt;br /&gt;
The maps were often compressed even further for the public release versions of the games. This more compressed version of the map file was saved as &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; by TED5. Later releases would omit the additional compression layer and ship with the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; file instead. One possible reason for this could be that the size of the games grew to the point where they would no longer fit onto and be playable from a single floppy disk, and therefore the additional compression was no longer worth the amount of time it took to compress the maps and re-compile the code.&lt;br /&gt;
&lt;br /&gt;
=== Map headers (MAPHEAD) ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[UINT16LE]] || magic || Magic word signalling [[RLEW compression]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[INT32LE]][100] || ptr || 100 pointers to start of level 0-99 data in the game maps file&lt;br /&gt;
|-&lt;br /&gt;
| 402 || {{TODO|Unknown}} || tileinfo || Optional tileinfo data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The map header file (MAPHEAD) is of varying length and contains three main types of data.&lt;br /&gt;
&lt;br /&gt;
* The first is the magic word or flag used for RLEW compression, which is almost always $ABCD in the original files. It could be changed to any other value if necessary.&lt;br /&gt;
&lt;br /&gt;
* The second is 100 level pointers which give the location of the start of level data in the GAMEMAPS file, relative to the start of that file.  A value less than 1 indicates no level (generally 0, but occasionally -1 (0xFFFFFFFF) is used). Using -1 should be preferred over 0, as the pre-Wolf3D version of the engine will treat any negative value as &amp;quot;a non existant map&amp;quot; [sic!] and quit with an appropriate error message, while 0 will cause it to try reading a level header at offset 0 (where the &amp;quot;TED5v1.0&amp;quot; string is usually stored), which will cause all kinds of errors as there is clearly no valid level header at that offset.&lt;br /&gt;
&lt;br /&gt;
* The third is the tileinfo data, which contains tile properties for each tile used in level creation. (These are masked and unmasked and either 8x8, 16x16 or 32x32.)&lt;br /&gt;
&lt;br /&gt;
Many programs treat the tileinfo as a separate file from the MAPHEAD and it is possible to modify a game in this manner.  Indeed, some games such as Wolfenstein 3-D do not have any tileinfo data at all in the map header file (giving a total file length of 402 bytes.) However TED5 works with any tileinfo data in the MAPHEAD.&lt;br /&gt;
&lt;br /&gt;
=== Map data (GAMEMAPS) ===&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file consists of the string &amp;quot;TED5v1.0&amp;quot; and a number of compressed chunks of varying length.  Each level in the file will have from two to four chunks (usually four) depending on the game, with all levels in a given game having the same number of chunks.  These are the level header and 1-3 planes (foreground, background and sprite/info.)  The chunks are in no particular order and it is possible to read through the entire file decompressing chunks as they&#039;re found.&lt;br /&gt;
&lt;br /&gt;
Chunks are ordered by the MAPHEAD file, which will point to the GAMEMAPS level header chunks which in turn contain pointers to the other GAMEMAPS chunks used by that level.&lt;br /&gt;
&lt;br /&gt;
All level data is in the form of [[UINT16LE]] values (or in the case of pointers, [[UINT32LE]].)&lt;br /&gt;
&lt;br /&gt;
==== Level headers ====&lt;br /&gt;
&lt;br /&gt;
The header for each level inside the GAMEMAPS file (which is pointed to by MAPHEAD) is 38 bytes long and &#039;&#039;never&#039;&#039; RLEW compressed.  If the GAMEMAPS file is using Huffman compression, the level header itself is Huffman-compressed.  In that case, the size of the compressed level header can be found in the MAPHEAD file.  Since the uncompressed level header always has a size of 38 bytes, that size is not stored at the beginning of the compressed data.  The header is sometimes followed by a signature &amp;quot;!ID!&amp;quot; string, which would give the header a total size of 42 bytes, but that string is not part of the actual level header.&lt;br /&gt;
&lt;br /&gt;
Plane 0 is background using unmasked tiles, plane 1 is foreground and uses masked tiles, and plane 2 is sprite/info.  Levels must contain a background plane and usually an infoplane.&lt;br /&gt;
&lt;br /&gt;
For the compressed size of each level plane, a value of 0 indicates the plane does not exist. The offset value for unused planes appears to be set to a random number with the most significant byte set to 0xFF, making it either a negative number or an offset close to the 4 gigabyte range. The games only check the compressed size and ignore the offset if the size is 0.&lt;br /&gt;
&lt;br /&gt;
Note that Wolf3D is hard-coded to always load the first two planes, even if the compressed size of a plane is 0. Wolf3D also ignores the width and height stored in the level header and just assumes the level is 64x64 tiles. This also applies to Blake Stone and probably any other game based on the Wolf3D code.&lt;br /&gt;
&lt;br /&gt;
All versions of the &amp;quot;Id Software Caching Manager&amp;quot; ignore the expanded size value at the beginning of the RLEW data and just assume that the size is the same as the size of the plane (width * height * 2).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[INT32LE]] || offPlane0 || Offset in GAMEMAPS to beginning of compressed plane 0 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || INT32LE || offPlane1 || Offset in GAMEMAPS to beginning of compressed plane 1 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || INT32LE || offPlane2 || Offset in GAMEMAPS to beginning of compressed plane 2 data (or &amp;lt;= 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 12 || UINT16LE || lenPlane0 || Length of compressed plane 0 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 14 || UINT16LE || lenPlane1 || Length of compressed plane 1 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || UINT16LE || lenPlane2 || Length of compressed plane 2 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 18 || UINT16LE || width || Width of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || UINT16LE || height || Height of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 22 || char[16] || name || Internal name for level (used only by editor, not displayed in-game. null-terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D, a 4-byte signature string (&amp;quot;!ID!&amp;quot;) will normally be present directly after the level name. The signature does not appear to be used anywhere, but is useful for distinguishing between v1.0 files (the signature string is missing), and files for v1.1 and later (includes the signature string).&lt;br /&gt;
&lt;br /&gt;
== Carmack compression ==&lt;br /&gt;
&lt;br /&gt;
[[Carmack compression]] is the method used to compress later &#039;&#039;id Software&#039;&#039; games, when file size was still a concern.  It is the most efficient and complex compression method and was created specifically to work with the 16-bit word structure of the GameMaps file.  The compression is detailed on its [[Carmack compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Carmackized game maps files are external &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; files and the map header is usually (but not always) stored internally in the executable.  The map header must be extracted and the game maps decompressed before TED5 can access them.  TED5 itself can produce carmackized files and external &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; files. Carmackization does not replace the RLEW compression used in uncompressed data, but compresses this data, that is, the data is doubly compressed.&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D v1.0, map files are not carmackized, only RLEW compression is applied.&lt;br /&gt;
&lt;br /&gt;
== Huffman compression ==&lt;br /&gt;
&lt;br /&gt;
[[Huffman Compression]] was probably used by earlier versions of TED5 (but possibly not TED5 at all) before carmackization was introduced.  It uses the same method to compress its data as is used by &#039;&#039;id Software&#039;&#039; games to compress their graphics and sounds.  Again this compression method works with RLEW compressed data and has its [[Huffman Compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Huffman compression is easily detected since it works on the bit level and thus disrupts the word structure of the game data.  This is easily seen in a hex editor.  Compressed data will not contain the string $00 $00 or indeed even $00 very often. (In contrast, even carmackized data contains both strings hundreds of times.)&lt;br /&gt;
&lt;br /&gt;
There will be two internal files for this format: the map header and the Huffman dictionary (which is always the first dictionary in the executable.)  The map header format is also slightly different, being 502 bytes long, the extra 100 bytes being the length of the compressed level headers in the game maps data, which occur immediately after the normal level header offsets and before the tileinfo. Each entry is one octet indicating the decompressed header length in bytes or zero if the level does not exist. (These can be ignored when decompressing since Huffman data can be read until the decompressed level header&#039;s fixed size is reached, but if they are omitted when writing the MAPHEAD, the game may experience a buffer overflow when reading the maps.)&lt;br /&gt;
&lt;br /&gt;
== Location of internal files ==&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file itself is always external, but in the case of compression, the MAPHEAD is stored internally in the main .exe file.  Executables are themselves compressed with either with LZEXE or PKLite.  Once the .exe has been decompressed it is a trivial task to find the MAPHEAD as it will start with the UINT16LE value $ABCD (i.e. the byte $CD followed by the byte $AB.)  For level editing purposes only the first 402 (or 502) bytes of the file need to be extracted, though it is possible to read the MAPHEAD file to calculate its length.&lt;br /&gt;
&lt;br /&gt;
The following table lists the offsets of the MAPHEAD file for various games, relative to the start of the decompressed game .exe file.&lt;br /&gt;
&lt;br /&gt;
{{TODO|TODO: Add all known versions of all games}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! Version !! Location !! Filename !! Offset !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Bio Menace]] || Freeware || External || &amp;lt;tt&amp;gt;MAPHEAD.BM[123]&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]]: Aliens of Gold || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.BS1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]] 2: Planet Strike || All || External || &amp;lt;tt&amp;gt;MAPHEAD.VSI&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb 3-D]] (3) || 1.00 || Internal || &amp;lt;tt&amp;gt;CAT3D.EXE&amp;lt;/tt&amp;gt; || $1C570 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Abyss]] (4) || 1.13 || Internal || &amp;lt;tt&amp;gt;CATABYSS.EXE&amp;lt;/tt&amp;gt; || $1C510 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Armageddon]] (5) || 1.01a || Internal || &amp;lt;tt&amp;gt;CATARMA.EXE&amp;lt;/tt&amp;gt; || $1D900 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Apocalypse]] (6) || 1.00b || Internal || &amp;lt;tt&amp;gt;CATAPOC.EXE&amp;lt;/tt&amp;gt; || $1DD50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=3| [[Corridor 7 Alien Invasion]] || Demo || External || &amp;lt;tt&amp;gt;MAPHEAD.DMO&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|| CD || Internal || &amp;lt;tt&amp;gt;CORR7CD.EXE&amp;lt;/tt&amp;gt; || $30D50 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
| Floppy || Internal || &amp;lt;tt&amp;gt;C7.EXE&amp;lt;/tt&amp;gt; || $24BF0 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Commander Keen 4-6|Keen 4]] || Special Demo || ? || ? || ? || File is PKLite compressed&lt;br /&gt;
|-&lt;br /&gt;
| 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN4E.EXE&amp;lt;/tt&amp;gt; || $24830 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 5]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN5E.EXE&amp;lt;/tt&amp;gt; || $25990 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 6]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN6.EXE&amp;lt;/tt&amp;gt; || $25080 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen Dreams]] || 1.13 || Internal || ? || $1FA50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Noah&#039;s Ark 3D]] || All || External || ? || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Operation Body Count]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.BC&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Spear of Destiny]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.SOD&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Wolfenstein 3-D]] || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.WL1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| Registered || External || &amp;lt;tt&amp;gt;MAPHEAD.WL6&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
* [[TED5]] can edit the &amp;lt;tt&amp;gt;GAMEMAPS&amp;lt;/tt&amp;gt; format of any games that use it.  It is the original editor used to create these files.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by Andrew Durdin (adurdin).  If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;/div&gt;</summary>
		<author><name>Congusbongus</name></author>
	</entry>
</feed>