Back to Mechstorm.

Mechstorm's Complete Map Making Tutorial or MCM for Short. Covering Mechwarrior4, Mechwarrior4:BK and Mechwarrior4:Mercs. If you have any questions feel free to drop by our Mechstorm Editor/Scripting help Forum after you have registered on our forums.

Back to MCM Menu

How to use multiplae detail textures on your mays.

By Thorgrim Skinhood

All the graphics for that map were done with PSP5.

Multiple Detail Textures

Each map zone ie AA, AB, AC etc. is made up of 64 tiles. (see \content\textures\Maps\mapname\AA\ etc. for .tgas of these sections). These are the tiles that are shown by the show tile bounds button in the editor. This method of adding multiple detail textures will allow you to specify what detail texture is shown by each tile.

When a map is created the MapCreator gives the option to set the detail ratio of the detail texture. Set to 16 the detail texture will repeat 4 times in each tile, set to 8 it will repeat once only in the tile. The first step in creating a map with multiple detail textures arises when the MapCreator program is run. At this point you will have to decide if you want the detail textures to repeat once (ratio set to 8) or 4 times per tile (ratio set to 16).

A setting of 8 is probably best as this gives 1 detail texture per tile.

A setting of 16 might work well in some situations, such as a terrain where you want one texture for grassy areas, one for rocky areas and one for bare soil areas. But the same texture will always be in repeated 4 times in every tile.

It is also a good idea to decide what you want to be the most common detail texture at this point, and use this as the one used by the MapCreator -less editing later on.

Create your multiple detail textures for your map, I would advise naming them something like groundG001, groundC001, GroundX123, or something similar, keep the names the same length (not sure if this is critical but it keeps typing to a minimum ) to add the detail textures to your maps resources you need to edit the textures.hint file in \content\textures\Maps\mapname\. Open textures.hint with a text editor and you should find something like-

[maps\ts_test2\bb\ts_test2_bb_1_0000]

..........loads of these............

[maps\ts_test2\aa\ts_test2_aa_0_0000]

[maps\ts_test2\ts_test2]

[maps\ts_test2\ts groundd014]

[maps\ts_test2\tswaterd1]

[maps\ts_test2\tsunderwater4]

[maps\ts_test2\tswaterdetaild1]

Just add in the names for your new detail textures ie-

[maps\ts_test2\ts groundd015]

[maps\ts_test2\ts groundd016]

and save the file again. The new detail textures .tgas need to be in the folder with the original detail texture in \content\textures\Maps\mapname\.
Now the editor will add the new textures to the map resources when it rebuilds the map files.

When you have used the MapCreator for the LAST time on your map is the time to begin altering the detail texture information. You will need to Hex edit the AA.erf, AB.erf etc and these are rebuilt EVERY time the MapCreator program is run. Using different files and settings with the map creator generates an .erf file with new and different data in it. (It may be possible to make a backup and restore it if you use all the same settings and filenames in the map creator but have only altered the map texture .tga but then again it might not)

If you need to change the map terrain texture remember you can do this by directly editing the _AA_0_0000.tga type files then deleting your mapname.dep and mapname.mw4 files from \resource\maps and reopen the editor to rebuild them, the same is true for the minimap.

Look in \content\Maps\mapname\AA or \AB and you will see some .erf files AA.erf, AB.erf etc. Open up the AA.erf in a hex editor and look for the first reference of your detail texture. This will show up as some clear ASCII that reads something like "maps\ts_test2\ts groundd014" change this to the detail texture you want to show up - ie ts groundd015. After you have edited the AA.erf file you will need to delete your mapname.dep and mapname.mw4 files from \resource\maps and reopen the editor to rebuild them. You will need to do this every time you change the .erf files. Failure to do this causes an error.

There are usually more than 64 references to the detail texture in an .erf file, this appears to be due to rough terrain requiring more information for the texture mapping. Be prepared to edit several entries to get the detail texture on 1 tile changed over completely. Flat terrain usually has only 1 reference per tile. The tile references listed in the .erf refer to tiles starting in the bottom right and ending top left of the zone, from the right to left on each row. You will almost certainly have to edit a bit, then delete the mapname.dep and mapname.mw4map files, open the editor to rebuild and check the results several times to make sure you are editing the info for the right tiles.

For a whole zone you will need to edit a lot of entries and I would recomend making back up copies of the .erf file you are editing as you go. Using Find-replace in the hex editor is handy if you are changing more than a few as well.

File sizes and Detail Texture resolutions

A 256x256 .tga is 257k, if you use a lot of different ones on a map it will increase the file size of the mapname.mw4 a lot. I would suggest decreasing the size of the
_AA_1_0000.tga, _AA_1_0001.tga, _AA_1_0100.tga and _AA_1_0101.tga (and the AB... etc) to 128x128 resolution. This gives sizes of 49k instead of 193k to save a total of 576k per zone. this would give a 2x2 map room for 8 more 256x256 detail textures without increasing the file size of the finished map. Alternatively 128x128 sized detail textures can be used. Which at only 65k would allow about 35 more detail textures to be used on a 2x2 map without increasing the file size. Mixing 256x256 and 128x128 sized detail textures might also be used to good effect.

Thanks Thorgrim.