Difference between revisions of "Map file"

From RRU Knowledge Base
(saving cuz the power flashed)
(Modified BLX reference here)
(31 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{WIP}}
A '''map''' file is a file format is used in ''[[LEGO Rock Raiders (video game)|LEGO Rock Raiders]]'' to store the layouts of levels and designate various types of markers used for a variety of functions in-game. Multiple map files are stored in every level's folder. They use the filename extension <code>.map</code>.
{{todo|HEAVY rewriting needed}}
The '''Map file format'''
files are certain [[Level Files]] located in a mission's level folder.  These control all the major properties of a the level.  All of these can either be opened using a [[Hex-Editing Program]] or more preferably using the [[RRU Level Editor]] or the [[Map Tool]]. In the base game files they are often paired with [[.BLX file]]s (which are possible leftovers from the [[Rock Raiders Beta]], which are not necessary to run the map).


There are nine different types of map files for the [[LEGO Rock Raiders]]:
Default map files in the Windows version are paired with [[BLX file]]s in every level's folder.  There is speculation as to whether they are an older version of the map format or whether they were something used by the original level editor. 


== Block Pointers Map ==
==Format specifications==
The '''block pointers map''', found as ''tuto.MAP'' in [[LEGO Rock Raiders (PC video game)|LEGO Rock Raiders]]. is the [[.MAP file]] that designates the locations of tutorial blocks.
<!--Would it be helpful to have our own guide to hexadecimal so that we wouldn't have to explain terminology here but also readers wouldn't have to slough through a huge wikipedia article?-->
Map files are encoded in [[Wikipedia:Hexadecimal|hexadecimal code]]. All numerical values in map files are stored in a [[Wikipedia:Endianness#Little|little-endian]] byte order (meaning the least significant byte is stored first - for example, the hexadecimal number 3E8 would be stored as <code>E8 03</code> instead of <code>03 E8</code>). Every block in a level is designated by a 16-bit integer (example: <code>13 00</code>), which the game reads to generate blocks from the leftmost side to the rightmost side, and then back to the leftmost side of the next row down.  


Tutorial blocks are markers or flags that the game uses in cooperation with the [[.NPL file]] of the [[LEGO Rock Raiders missions|mission]] that uses a block pointers map. Depending on the objective scripting, the flags can determine where the camera will move at a certain time, and will check whether a cavern has been exposed or if a [[Rock Raider]] or unit has traveled across a certain block. In some cases, it also tells a [[monster]] where to travel, and can trigger a scripting function if they stop at a certain flag.
Every map file has a [[Wikipedia:File format#File header|file header]] comprised of four 32-bit integers (known as [[Wikipedia:Word (computer architecture)|words]]) . The first word in every map file is always <code>4D 41 50 20</code>, which in [[Wikipedia:ASCII|ASCII]] spells out <tt>MAP</tt> followed by a space. The second word records the number of bytes contained in the rest of the file, not counting the first eight bytes contained in the first two words. For instance, a 24x48 map would have a size value of <code>9A 09 00 00</code>, which means the rest of the file contains 2458 bytes (99A in hexadecimal), and the file's total size would be 2466 bytes. The third and fourth words list the X and Y dimensions of the map respectively, letting the game know how many integers to read before completing a row and moving to the next one below it.


===Coding===
Interestingly, each stored dimensions value is always one greater than the number of blocks actually present in the level in-game - so for instance, a 24x48 map would have a dimensions value of <code>19 00 00 00 31 00 00 00</code>, as 19 is hexadecimal for 25, and 31 is hexadecimal for 49. This may indicate that either that the vertices are counted rather than the blocks, or that there is an extra row and column of blocks on every map that does not generate in-game{{Needs evidence}}. Either possibility may be due to how the Surface map applies height values to the top left corner of a block rather than its center.
Like the [[Emrg.map file]], Tutorial Blocks are all given different numbers in sequence.


<code>00 00</code> - ''Not a Tutorial Block''
==Map types==
Nine different map types are used in the Windows version of ''LEGO Rock Raiders''. Though they all use the same encoding, which type they're marked as will determine how they are used in a level. Because of this, not every level uses all map types, and some are used rarely by default. Every level at minimum requires a Predug, Surface, and Terrain map to function without crashing the game.


<code>01 00 and higher</code> - ''Tutorial Block''
=== Block Pointers map ===
The '''Block Pointers map''', usually found as '''tuto.map''', is the map file type that designates the locations of tutorial blocks.


=== CryOre map ===
Tutorial blocks are markers or flags that are used in a level in cooperation with its [[NPL file]]. Depending on the objective scripting, flags can be used for a wide variety of functions, such as checking whether blocks are exposed or have been crossed, moving the camera to a specific location at a certain time, or pointing to a wall or floor block that the player needs to interact with. In special cases, it also tells an emerging creature where to travel, and can trigger a scripting function if they stop at a certain flag.
The '''CryOre map''', usually found as <tt>cror.map</tt>, is the map file type that designates the locations and amounts of [[Energy Crystals]] and [[Ore]] in a level (hence the name '''Cry'''stals and '''Ore'''). Note that this only applies to materials found in [[rock types|walls]] defined in the [[terrain map]]; materials found lying around in open caverns are defined in the [[Object List]], and Ore dug up out of rubble is defined in the [[PTL file]].


CryOre map files use only the following values:
Block Pointers map files <!--are all given different numbers in sequence-->can use any hexadecimal values between <code>01 00</code> and <code>FF 00</code> ''in sequence''{{Verify}}<!--does it crash if they're out of sequence?--> to designate tutorial blocks. Values of <code>00 00</code> are taken as null.
* <code>00 00</code> - ''None''
* <code>01 00</code>, <code>03 00</code> - ''One Energy Crystal''
* <code>02 00</code>, <code>04 00</code> - ''One Ore''
* <code>05 00</code>, <code>07 00</code> - ''Three Energy Crystals''
* <code>06 00</code>, <code>08 00</code> - ''Three Ore''
* <code>09 00</code>, <code>0B 00</code> - ''Five Energy Crystals''
* <code>0A 00</code>, <code>0C 00</code>, <code>10 00</code> - ''Five Ore''
* <code>0D 00</code>, <code>13 00</code> - ''Eleven Energy Crystals''
* <code>0E 00</code>, <code>14 00</code> - ''Eleven Ore''
* <code>11 00</code>, <code>17 00</code> - ''Twenty-Five Energy Crystals''
* <code>12 00</code>, <code>18 00</code> - ''Twenty-Five Ore''
* <code>19 00</code> and higher - ''Crashes the game when exposed''


=== Emerge map ===
=== CryOre map ===
The '''Emerge map''', usually found as <tt>emrg.map</tt>, is the map file type that designates the locations of emerging [[monsters]].
The '''CryOre map''', usually found as '''cror.map''', is the map file type that designates the locations and amounts of [[energy crystal]]s and [[ore]] in a level (hence the name '''Cry'''stals and '''Ore'''). Note that this only applies to materials found in [[rock types|walls]] defined in the Terrain map; materials found lying around in open caverns are defined in the [[Object List file]], and materials dug up out of rubble is defined in the [[PTL file]].


CryOre map files use only the following hexadecimal values:
{| class="wikitable" border="1"
|-
! Value
! Function
|-
| <code>00 00</code>
| None
|-
| <code>01 00</code> or <code>03 00</code>
| One energy crystals
|-
| <code>02 00</code> or <code>04 00</code>
| One ore
|-
| <code>05 00</code> or <code>07 00</code>
| Three energy crystals
|-
| <code>06 00</code> or <code>08 00</code>
| Three ore
|-
| <code>09 00</code> or <code>0B 00</code>
| Five energy crystals
|-
| <code>0A 00</code> or <code>0C 00</code>
| Five ore
|-
| <code>0D 00</code> or <code>0F 00</code>
| Ten energy crystals
|-
| <code>0E 00</code> or <code>10 00</code>
| Ten ore
|-
| <code>11 00</code> or <code>13 00</code>
| Twenty-five energy crystals
|-
| <code>12 00</code> or <code>14 00</code>
| Twenty-five ore
|}


There are two things defined in the emerge map: trigger points and emerge points. All the trigger points of an identical number are tied to the emerge points of the number one above the trigger point's. When a [[Rock Raider]] walks over a trigger point, a monster will emerge from the emerge point tied to that trigger. The emerge point must be on a [[rock types|wall]] defined in the [[terrain map]] or no monster can be triggered; if all the walls located on an emerge points of the same number are mined or destroyed, the trigger point will cease to function. Emerge points can be on any wall except for [[Solid Rock]].
Values of <code>15 00</code> and higher will cause the game to crash when exposed. Odd values will cause the energy crystal notification message to play the instance the game freezes.


===Coding===
=== Emerge map ===
Like the [[block pointers map]], every emerge block is given a different number, in sequential order. Unlike the block pointers map, however, the numbers go up in increments of six instead of one, so that, for example, <code>02 00</code> and its trigger <code>01 00</code> are the first emerge in the map, but <code>08 00</code> and its trigger <code>07 00</code> will be the second, instead of <code>04 00</code> and <code>03 00</code>.
The '''Emerge map''', usually found as '''emrg.map''', is the map file type that designates the locations of trigger points and emerge points for emerging [[Rock Raiders creatures|creatures]]. All the trigger points of an identical value are tied to all the emerge points of the value one above that of the trigger point. When a [[Rock Raider]] walks or drives over a trigger point, a monster will emerge from the emerge point tied to that trigger.


<code>00 00</code> - ''No Emerging on this block''
The emerge point must be on a [[rock types|wall]] defined in the Terrain map, can be any wall type except for solid rock, and can't be on a corner or have water or lava directly in front of it (even if the designated monster can cross water or lava). If all the walls located on an emerge points of the same number are mined, [[reinforced wall|reinforced]], or made into corners via collapsing walls next to them, the trigger point will cease to function. Conversely, a hidden wall that becomes exposed will cause a non-functioning trigger point to start functioning.


<code>01 00 and higher in increments of 6</code> - ''Trigger on this block''
Like the Block Pointers map, every emerge block is given a different hexadecimal value in sequential order. Unlike the Block Pointers map, however, the values go up in increments of six instead of one, so that, for example, <code>02 00</code> and its trigger <code>01 00</code> are the first emerge in the map, but <code>08 00</code> and its trigger <code>07 00</code> will be the second, instead of <code>04 00</code> and <code>03 00</code>.


<code>02 00 and higher in increments of 6</code> - ''Emerging on this block''
Therefore, Emerge map files use the following hexadecimal values:
{| class="wikitable" border="1"
|-
! Value
! Function
|-
| <code>00 00</code>
| No Emerging on this block
|-
| <code>01 00</code> and higher in increments of <code>06</code>
| Trigger point on this block
|-
| <code>02 00</code> and higher in increments of <code>06</code>
| Emerging point on this block
|}


=== Erode Map ===
=== Erode map ===
{{Main|Erosion}}
{{Main|Erosion}}
The '''Erode map''', usually found as <tt>erod.map</tt>, is the map file that designates the locations of eroding lava and erosion paths. Like the [[surface map]], the Erode map is coded so that higher numbers represent more dangerous erosion.
The '''Erode map''', usually found as '''erod.map''', is the map file that designates the locations of eroding lava and erosion paths. Like the Fallin map, higher values represent more dangerous erosion.


Erode map files use only the following values:
Erode map files use only the following hexadecimal values:
* <code>00 00</code> - ''No erosion''
{| class="wikitable" border="1"
* <code>01 00</code>, <code>03 00</code>, <code>05 00</code>, <code>07 00</code>, <code>09 00</code> - ''Blocks that only erode on a space adjacent to lava, with <code>09 00</code> eroding the fastest and <code>01 00</code> eroding the slowest''
|-
* <code>02 00</code>, <code>04 00</code>, <code>06 00</code>, <code>08 00</code>, <code>0A 00</code> - ''Blocks that begin eroding at the start of the mission, regardless of whether they are next to [[lava]] or not, with <code>0A 00</code> eroding the fastest and <code>02 00</code> eroding the slowest''
! Value
! Function
|-
| {{nowrap|<code>00 00</code>}}
| No erosion
|-
| <code>01 00</code>  
|rowspan="5"| Blocks that only erode on a space adjacent to lava, with <code>09 00</code> eroding the fastest and <code>01 00</code> eroding the slowest
|-
| <code>03 00</code>
|-
| <code>05 00</code>
|-
| <code>07 00</code>
|-
| <code>09 00</code>
|-
| <code>02 00</code>
|rowspan="5"| Blocks that begin eroding at the start of the mission, regardless of whether they are next to lava or not, with <code>0A 00</code> eroding the fastest and <code>02 00</code> eroding the slowest
|-
|<code>04 00</code>
|-
| <code>06 00</code>
|-
| <code>08 00</code>
|-
| <code>0A 00</code>
|}
Odd numbers <code>0B 00</code> and higher have no effect. Even numbers <code>0C 00</code> and higher cause the erosion to progress backwards into the unused first stage, which it remains at until repaired.
Odd numbers <code>0B 00</code> and higher have no effect. Even numbers <code>0C 00</code> and higher cause the erosion to progress backwards into the unused first stage, which it remains at until repaired.


== Fallin Map ==
=== Fallin map ===
The '''fallin map''', usually found as ''fall.map'' is the [[.MAP file]] that designates the locations of [[cave-ins]].
The '''Fallin map''', usually found as '''fall.map''', is the map file type that designates the locations of [[cave-ins]]. Like the Erode map, higher values represent more dangerous or unstable cave-ins.
 
===Coding===
Like the [[Erod.map file]] and [[High.map file]], the higher the number, the more dangerous or unstable the cave-in.
 
<code>00 00</code> - ''No cave-ins''
 
<code>01 00, 02 00, 03 00, 04 00, 05 00, 06 00, 07 00, 08 00</code> - ''cave-ins, <code>01 00</code> being least dangerous, <code>08 00</code> being most dangerous.''


== Path Map ==
Fallin map files use only the following hexadecimal values{{Verify}}:
The '''path map''', found as ''path.MAP'' in [[LEGO Rock Raiders (PC video game)|LEGO Rock Raiders]], is the [[.MAP file]] that designates the locations of [[Power Paths]] and exposed [[rubble]].
{| class="wikitable" border="1"
|-
! Value
! Function
|-
| <code>00 00</code>
| No cave-ins
|-
| <code>01 00</code>, <code>02 00</code>, <code>03 00</code>, <code>04 00</code>, <code>05 00</code>, <code>06 00</code>, <code>07 00</code>, <code>08 00</code>
| Cave-ins, with <code>01 00</code> being least dangerous and <code>08 00</code> being most dangerous
|}


===Coding===
=== Path map ===
There are several known numbers used in this file:
The '''Path map''', usually found as '''path.map''', is the map file type that designates the locations of [[power path]]s and [[Surface types#Rubble|rubble]]. Path map items '''must''' be in conjunction with a Predug map value of <code>01 00</code>, meaning that power paths and  rubble placed in hidden caverns will not spawn.


<code>00 00</code> - ''No Power Paths or rubble''
Path map files use only the following hexadecimal values:
{| class="wikitable" border="1"
|-
! Value
! Function
|-
| {{nowrap|<code>00 00</code>}}
| No power paths or rubble
|-
| <code>01 00</code>
| Rubble
|-
| <code>02 00</code>
| Power path
|}


<code>01 00</code> - ''Rubble''
=== Predug map ===
The '''Predug map''', usually found as '''dugg.map''', is the map file type that designates whether blocks are walls or cavern terrain, whether a cavern is exposed or [[undiscovered cavern|hidden]], and the locations of [[slimy slug hole]]s.


<code>02 00</code> - ''Power Path''
Predug map files use only the following hexadecimal values:
{| class="wikitable" border="1"
|-
! Value
! Function
|-
| {{nowrap|<code>00 00</code>}}
| Wall
|-
| <code>01 00</code>
| Exposed cavern
|-
| <code>02 00</code>
| Hidden cavern
|-
| <code>03 00</code>
| Slimy slug hole
|-
| <code>04 00</code>
| Hidden slimy slug hole
|}


== Predug Map ==
=== Surface map ===
The '''predug map''', usually found as ''dugg.MAP'' in [[LEGO Rock Raiders (PC video game)|LEGO Rock Raiders]]'s files, is the [[.MAP file]] that designates the locations of [[undiscovered cavern|hidden]] or exposed caverns (as well as [[Slimy Slug hole]]s).
The '''Surface map''', usually found as '''high.map''' (and therefore often called the '''height map'''), is the map file type that designates the height of the [[surface types|terrain]] at each block in a level. Like the Erode map, higher values cause higher increments - in this case, the height of the northwest corner of a specific block<!--THIS SENTENCE NEEDS REWORDING-->. The exact difference between incremental height values is determined by each level's <tt>RoughLevel</tt> code, which by default is <tt>6</tt> in all levels. As the depth from the ground to the ceiling is a total of <tt>80</tt> in the unmodified game, 13 height units will nearly reach the ceiling{{verify}}.


 
Surface map files can use any values between <code>00 00</code> and <code>FF 00</code>, with the former being the lowest possible terrain and the latter being the highest possible. Most custom map tools only allow heights between <code>00 00</code>and <code>2F 00</code>, though manual hex editing allows for far greater values to be set. Such extreme height differences may cause mobile units and the game camera to move unusually. If the height difference is very sudden, sharp hills may disappear and be seen as fog holes in the ground and ceiling in eye and shoulder view, and moving the camera across such hills in top view can cause parts of low ground to disappear as they end up out of draw distance.
<code>00 00</code> - ''No cavern (wall)''
 
<code>01 00</code> - ''Exposed cavern''
 
<code>02 00</code> - ''Hidden cavern''
 
<code>03 00</code> - ''Exposed Slimy Slug hole''
 
<code>04 00</code> - ''Hidden Slimy Slug hole''
 
== Surface map ==
The '''Surface map''', usually found as <tt>high.map</tt> (and therefore often called the ''height map''), is the [[.MAP file]] which designates the height of the [[terrain types|terrain]] at various locations in a [[LEGO Rock Raiders missions|mission]].
 
===Coding===
Like the [[erode map]], the higher the number, the higher the incremented value - in this case, the higher a specific block is.  For reference, the height from floor to ceiling in the unmodified [[LEGO Rock Raiders (PC video game)|game]], with a rough depth of 40 and a ceiling height of 40, is 6 height units.
 
<code>00 00</code>, <code>01 00</code>, <code>02 00</code>, <code>03 00</code>, <code>04 00</code>, <code>05 00</code>, <code>06 00</code>, <code>07 00</code>, <code>08 00</code>, <code>09 00</code>, <code>0A 00</code> - ''Height, <code>00 00</code> is lowest, <code>0A 00</code> is highest.''
 
The file can also be edited directly with a hex editor for more extreme heights. The Map Tool allows a height of up to <code>40 00</code>, which can cause parts of low ground to disappear as they end up out of draw distance.


=== Terrain map ===
=== Terrain map ===
The '''Terrain map''', usually found as <tt>surf.map</tt> (not to be confused with the Surface map, which controls floor height), is the map file type that designates the locations of various [[rock types|walls]], as well as [[ground]], [[water]], and [[lava]]. The [[LEGO Rock Raiders (PlayStation game)|PlayStation version]] of the game also uses Terrain maps, found as <tt>terrain.map</tt>, though seams are not used in-game.
The '''Terrain map''', usually found as '''surf.map''' (not to be confused with the above Surface map), is the map file type that designates the locations of various walls, as well as [[surface types#Ground|ground]], [[surface types#Water|water]], and [[surface types#Lava|lava]]. The PlayStation version of the game also uses Terrain maps, found as '''terrain.map'''.
 
Terrain map files use only the following values:
* <code>00 00</code> - ''Some form of [[ground]]''
* <code>01 00</code> - ''[[Solid Rock]]''
* <code>02 00</code> - ''[[Hard Rock]]''
* <code>03 00</code> - ''[[Loose Rock]]''
* <code>04 00</code> - ''[[Dirt]]''
* <code>05 00</code> - ''Dirt'', was most likely once [[Soil]]
* <code>06 00</code> - ''Basic [[lava]]''
* <code>07 00</code> - ''unconfirmed''
* <code>08 00</code> - ''[[Ore Seam]]''
* <code>09 00</code> - ''[[Water]]''
* <code>0A 00</code> - ''[[Energy Crystal Seam]]''
* <code>0B 00</code> - ''[[Recharge Seam]]''
* <code>0C 00</code> - ''unconfirmed''
* <code>0D 00</code> - ''unconfirmed''
* <code>0E 00</code> - ''unconfirmed''
* <code>0F 00</code> - ''unconfirmed''
* <code>10 00</code> - ''unconfirmed''
* <code>11 00</code> - ''unconfirmed''
 
The code can continue up to <code>11 00</code> without the game crashing, though the results are very odd.
 
It is suspected that <code>05 00</code> may have originaly been [[soil]].


Terrain map files in the Windows version use only the following hexadecimal values:
{| class="wikitable" border="1"
|-
! Value
! Function
|-
| {{nowrap|<code>00 00</code>}}
| Null
|-
| <code>01 00</code>
| [[Solid rock]]
|-
| <code>02 00</code>
| [[Hard rock]]
|-
| <code>03 00</code>
| [[Loose rock]]
|-
| <code>04 00</code>
| [[Dirt]]
|-
| <code>05 00</code>
| Dirt, was most likely planned to be the unused [[soil]]
|-
| <code>06 00</code>
| [[surface types#Lava|Lava]]
|-
| <code>07 00</code>
| An unused form of water that displays as a blue sheet floating at the top of the wall. Empty tiles next to it will cause it to sink down to the ground, though it seems to behave differently in eye and shoulder view. It was possibly meant for some sort of flooding mechanic, but was never finished.
|-
| <code>08 00</code>
| [[Ore seam]]
|-
| <code>09 00</code>
| [[surface types#Water|Water]]
|-
| <code>0A 00</code>
| [[Energy crystal seam]]
|-
| <code>0B 00</code>
| [[Recharge seam]]
|}


* <code>01 00</code> - ''Ground''
Note that none of the values actually correspond to ground, as a Predug map value of <code>01 00</code> (exposed) or <code>02 00</code> (hidden) is what actually determines caverns, while any Terrain map value except for <code>06 00</code>, <code>07 00</code>{{verify}}, and <code>09 00</code> will default to ground when marked as such. Most default maps use dirt <code>04 00</code> everywhere that ground is designated; however, custom map tools tend to mark <code>00 00</code> where ground is designated.
* <code>02 00</code> - ''Dirt
* <code>03 00</code> - ''
* <code>04 00</code> - ''
* <code>05 00</code> - ''Solid Rock''
* <code>06 00</code> - ''Lava
* <code>07 00</code> - ''Water


==Other==
The following values are not used in map files and do not present correctly in levels (showing as ground stretching up to the ceiling and acting like a wall that can't be drilled but can cause landslides and emerges), but are used on the radar in map view:
{| class="wikitable" border="1"
|-
! Value
! Function
|-
| {{nowrap|<code>0C 00</code>}}
| Rubble
|-
| <code>0D 00</code>
| Reinforced wall
|-
| <code>0E 00</code>
| Power path
|-
| <code>0F 00</code>
| Slimy slug hole
|-
| <code>10 00</code>
| Undiscovered cavern
|-
| <code>11 00</code>
| Cavern floor
|}
Values of <code>12 00</code> and higher will crash the game when moused over.


There are also map files used for the [[Playstation Game]]:
Terrain map files in the PlayStation version use only the following hexadecimal values:
{| class="wikitable" border="1"
|-
! Value
! Function
|-
| {{nowrap|<code>01 00</code>}}
| Ground
|-
| <code>02 00</code>
| Dirt (loose rock in North American version)
|-
| <code>03 00</code>
| Loose rock (medium rock in North American version)
|-
| <code>04 00</code>
| Hard rock
|-
| <code>05 00</code>
| Solid rock
|-
| <code>06 00</code>
| Lava
|-
| <code>07 00</code>
| Water
|}


*The Terrain.map (was undocumented on the old wiki)
===AI map===
The '''AI map''' is an unused map type. Specifications are currently unknown.


Map files are encoded in '''Hexadecimal Code'''.  Every different kind of square in the level is designated a specific number in a specific map file.
== Modding ==
{{Todo|Write about various level editors and make articles for them when the forums are back up}}
All of these can either be opened using a [[hex-editing program]] or more preferably using the [[LRR Map Creator]] or the [[Map Tool]].


[[Category:LEGO Rock Raiders file formats]]
[[Category:File formats in LEGO Rock Raiders for Windows]]
[[Category:Documentations]]

Revision as of 16:14, 20 December 2018

A map file is a file format is used in LEGO Rock Raiders to store the layouts of levels and designate various types of markers used for a variety of functions in-game. Multiple map files are stored in every level's folder. They use the filename extension .map.

Default map files in the Windows version are paired with BLX files in every level's folder. There is speculation as to whether they are an older version of the map format or whether they were something used by the original level editor.

Format specifications

Map files are encoded in hexadecimal code. All numerical values in map files are stored in a little-endian byte order (meaning the least significant byte is stored first - for example, the hexadecimal number 3E8 would be stored as E8 03 instead of 03 E8). Every block in a level is designated by a 16-bit integer (example: 13 00), which the game reads to generate blocks from the leftmost side to the rightmost side, and then back to the leftmost side of the next row down.

Every map file has a file header comprised of four 32-bit integers (known as words) . The first word in every map file is always 4D 41 50 20, which in ASCII spells out MAP followed by a space. The second word records the number of bytes contained in the rest of the file, not counting the first eight bytes contained in the first two words. For instance, a 24x48 map would have a size value of 9A 09 00 00, which means the rest of the file contains 2458 bytes (99A in hexadecimal), and the file's total size would be 2466 bytes. The third and fourth words list the X and Y dimensions of the map respectively, letting the game know how many integers to read before completing a row and moving to the next one below it.

Interestingly, each stored dimensions value is always one greater than the number of blocks actually present in the level in-game - so for instance, a 24x48 map would have a dimensions value of 19 00 00 00 31 00 00 00, as 19 is hexadecimal for 25, and 31 is hexadecimal for 49. This may indicate that either that the vertices are counted rather than the blocks, or that there is an extra row and column of blocks on every map that does not generate in-game[verify]. Either possibility may be due to how the Surface map applies height values to the top left corner of a block rather than its center.

Map types

Nine different map types are used in the Windows version of LEGO Rock Raiders. Though they all use the same encoding, which type they're marked as will determine how they are used in a level. Because of this, not every level uses all map types, and some are used rarely by default. Every level at minimum requires a Predug, Surface, and Terrain map to function without crashing the game.

Block Pointers map

The Block Pointers map, usually found as tuto.map, is the map file type that designates the locations of tutorial blocks.

Tutorial blocks are markers or flags that are used in a level in cooperation with its NPL file. Depending on the objective scripting, flags can be used for a wide variety of functions, such as checking whether blocks are exposed or have been crossed, moving the camera to a specific location at a certain time, or pointing to a wall or floor block that the player needs to interact with. In special cases, it also tells an emerging creature where to travel, and can trigger a scripting function if they stop at a certain flag.

Block Pointers map files can use any hexadecimal values between 01 00 and FF 00 in sequence[verify] to designate tutorial blocks. Values of 00 00 are taken as null.

CryOre map

The CryOre map, usually found as cror.map, is the map file type that designates the locations and amounts of energy crystals and ore in a level (hence the name Crystals and Ore). Note that this only applies to materials found in walls defined in the Terrain map; materials found lying around in open caverns are defined in the Object List file, and materials dug up out of rubble is defined in the PTL file.

CryOre map files use only the following hexadecimal values:

Value Function
00 00 None
01 00 or 03 00 One energy crystals
02 00 or 04 00 One ore
05 00 or 07 00 Three energy crystals
06 00 or 08 00 Three ore
09 00 or 0B 00 Five energy crystals
0A 00 or 0C 00 Five ore
0D 00 or 0F 00 Ten energy crystals
0E 00 or 10 00 Ten ore
11 00 or 13 00 Twenty-five energy crystals
12 00 or 14 00 Twenty-five ore

Values of 15 00 and higher will cause the game to crash when exposed. Odd values will cause the energy crystal notification message to play the instance the game freezes.

Emerge map

The Emerge map, usually found as emrg.map, is the map file type that designates the locations of trigger points and emerge points for emerging creatures. All the trigger points of an identical value are tied to all the emerge points of the value one above that of the trigger point. When a Rock Raider walks or drives over a trigger point, a monster will emerge from the emerge point tied to that trigger.

The emerge point must be on a wall defined in the Terrain map, can be any wall type except for solid rock, and can't be on a corner or have water or lava directly in front of it (even if the designated monster can cross water or lava). If all the walls located on an emerge points of the same number are mined, reinforced, or made into corners via collapsing walls next to them, the trigger point will cease to function. Conversely, a hidden wall that becomes exposed will cause a non-functioning trigger point to start functioning.

Like the Block Pointers map, every emerge block is given a different hexadecimal value in sequential order. Unlike the Block Pointers map, however, the values go up in increments of six instead of one, so that, for example, 02 00 and its trigger 01 00 are the first emerge in the map, but 08 00 and its trigger 07 00 will be the second, instead of 04 00 and 03 00.

Therefore, Emerge map files use the following hexadecimal values:

Value Function
00 00 No Emerging on this block
01 00 and higher in increments of 06 Trigger point on this block
02 00 and higher in increments of 06 Emerging point on this block

Erode map

The Erode map, usually found as erod.map, is the map file that designates the locations of eroding lava and erosion paths. Like the Fallin map, higher values represent more dangerous erosion.

Erode map files use only the following hexadecimal values:

Value Function
00 00 No erosion
01 00 Blocks that only erode on a space adjacent to lava, with 09 00 eroding the fastest and 01 00 eroding the slowest
03 00
05 00
07 00
09 00
02 00 Blocks that begin eroding at the start of the mission, regardless of whether they are next to lava or not, with 0A 00 eroding the fastest and 02 00 eroding the slowest
04 00
06 00
08 00
0A 00

Odd numbers 0B 00 and higher have no effect. Even numbers 0C 00 and higher cause the erosion to progress backwards into the unused first stage, which it remains at until repaired.

Fallin map

The Fallin map, usually found as fall.map, is the map file type that designates the locations of cave-ins. Like the Erode map, higher values represent more dangerous or unstable cave-ins.

Fallin map files use only the following hexadecimal values[verify]:

Value Function
00 00 No cave-ins
01 00, 02 00, 03 00, 04 00, 05 00, 06 00, 07 00, 08 00 Cave-ins, with 01 00 being least dangerous and 08 00 being most dangerous

Path map

The Path map, usually found as path.map, is the map file type that designates the locations of power paths and rubble. Path map items must be in conjunction with a Predug map value of 01 00, meaning that power paths and rubble placed in hidden caverns will not spawn.

Path map files use only the following hexadecimal values:

Value Function
00 00 No power paths or rubble
01 00 Rubble
02 00 Power path

Predug map

The Predug map, usually found as dugg.map, is the map file type that designates whether blocks are walls or cavern terrain, whether a cavern is exposed or hidden, and the locations of slimy slug holes.

Predug map files use only the following hexadecimal values:

Value Function
00 00 Wall
01 00 Exposed cavern
02 00 Hidden cavern
03 00 Slimy slug hole
04 00 Hidden slimy slug hole

Surface map

The Surface map, usually found as high.map (and therefore often called the height map), is the map file type that designates the height of the terrain at each block in a level. Like the Erode map, higher values cause higher increments - in this case, the height of the northwest corner of a specific block. The exact difference between incremental height values is determined by each level's RoughLevel code, which by default is 6 in all levels. As the depth from the ground to the ceiling is a total of 80 in the unmodified game, 13 height units will nearly reach the ceiling[verify].

Surface map files can use any values between 00 00 and FF 00, with the former being the lowest possible terrain and the latter being the highest possible. Most custom map tools only allow heights between 00 00and 2F 00, though manual hex editing allows for far greater values to be set. Such extreme height differences may cause mobile units and the game camera to move unusually. If the height difference is very sudden, sharp hills may disappear and be seen as fog holes in the ground and ceiling in eye and shoulder view, and moving the camera across such hills in top view can cause parts of low ground to disappear as they end up out of draw distance.

Terrain map

The Terrain map, usually found as surf.map (not to be confused with the above Surface map), is the map file type that designates the locations of various walls, as well as ground, water, and lava. The PlayStation version of the game also uses Terrain maps, found as terrain.map.

Terrain map files in the Windows version use only the following hexadecimal values:

Value Function
00 00 Null
01 00 Solid rock
02 00 Hard rock
03 00 Loose rock
04 00 Dirt
05 00 Dirt, was most likely planned to be the unused soil
06 00 Lava
07 00 An unused form of water that displays as a blue sheet floating at the top of the wall. Empty tiles next to it will cause it to sink down to the ground, though it seems to behave differently in eye and shoulder view. It was possibly meant for some sort of flooding mechanic, but was never finished.
08 00 Ore seam
09 00 Water
0A 00 Energy crystal seam
0B 00 Recharge seam

Note that none of the values actually correspond to ground, as a Predug map value of 01 00 (exposed) or 02 00 (hidden) is what actually determines caverns, while any Terrain map value except for 06 00, 07 00[verify], and 09 00 will default to ground when marked as such. Most default maps use dirt 04 00 everywhere that ground is designated; however, custom map tools tend to mark 00 00 where ground is designated.

The following values are not used in map files and do not present correctly in levels (showing as ground stretching up to the ceiling and acting like a wall that can't be drilled but can cause landslides and emerges), but are used on the radar in map view:

Value Function
0C 00 Rubble
0D 00 Reinforced wall
0E 00 Power path
0F 00 Slimy slug hole
10 00 Undiscovered cavern
11 00 Cavern floor

Values of 12 00 and higher will crash the game when moused over.

Terrain map files in the PlayStation version use only the following hexadecimal values:

Value Function
01 00 Ground
02 00 Dirt (loose rock in North American version)
03 00 Loose rock (medium rock in North American version)
04 00 Hard rock
05 00 Solid rock
06 00 Lava
07 00 Water

AI map

The AI map is an unused map type. Specifications are currently unknown.

Modding

To do: Write about various level editors and make articles for them when the forums are back up

All of these can either be opened using a hex-editing program or more preferably using the LRR Map Creator or the Map Tool.