Convert BF2 maps to BF1942

By Apache Thunder

The heightmaps will need to be resized with Photoshop. As for the material maps, there is no easy way to do that one. The mat file is the same as the RAW files. Just change the extension to RAW and open it in photoshop. BF2 and later heightmaps/material maps have an extra pixel in the image size. (1025x1025 instead of 1024x1024 for example). Same goes for the material map.

The thing is, BF2 uses slightly different material numbers for the ground materials. The few ones that do match is the materials for rock/out of bounds. (material 7 for out of bounds doesn't appear to actually be used anywhere in the game however as BF2 and later games use a new combat area system in place of the old system that BF1842/BFV uses.

You can either change the ground materials in your mod's damage system to match BF2's or find a easy way of changing the materials in materials RAW file.

As for the GPO/StaticObjects, their positions are offset by a certain amount. Unlike BF1942/BFV, BF2 has the 0/0/0 position at the center of the map instead of the top corner (I think it's the top corner, if not, it's the bottom left corner).

My trick to fixing that is importing the statiobject positions into max via the old rexman scripts and offsetting them by 256 or more meters on both X/Y axis (vertical axis position does not need to be changed) and then reexporting them. However rexman's scripts will fail to import any object position that does not have the Object.rotation command present. So a quick fix to that is to open the con file with Editor42, adding a dummy object somewhere and re-saving. ED42 will add a 0/0/0 rotation value to any object that is missing one.

How much you have to offset them is determined by how large the map is. The setting that I refer to as a guideline is this command found in the hieghtdata.con file:

CODE:

heightmapcluster.setHeightmapSize 2048

That one is from Dalian Plant for example and all statics should be offset by 2048 in that case. The object offsetting only works correctly if you exported all the BF2 statics with their original center of mass that they had when you imported them. If you moved them up or changed their position prior to exporting them to BF1942 format, then this whole process will be rendered void and you would either have to make lots of corrections in Editor42/battlecraft or rebuild the map from scratch. So I'd recommend you preserve their position in the scene when you import them from BF2.

You can do the same method on control point positions and other things in the GPO. You just need to extract all the positions and put them in a separate file from that of the templates since BF2 put them all in one file and rexman scripts aren't designed for that. Also make sure they have the rotation values defined or else they won't import into max correctly.

The one last important thing to know is what yScale setting to use in BF1942.

The yScale setting can be found in BF2's hightdata.con file. It's the middle value in one of the secondary hieghtmap templates. NOT the primary!

heightmap.setScale 2/0.64/2

Oh and for terrain textures, the easiest way to port them over is to merge them to one file via TGAMerge (you may need to flip all the images vertically if they end up in the wrong order when merged to one image) then resplit them out to the correct amount of textures for your BF1942 map.

The skydome is stored in the same format as other BF2 objects and can be imported into max and exported for BF1942.

As for the light settings. Don't bother with them as BF2's system is too different to be ported directly. You might as well just set that up from scratch or port over the RGB values from BF2Editor when you go in to ligthmap the maps in 3DSMax.

The one thing you can port over code wise is the sun light direction. The vectors are reversed and just need a quick alteration for them to work in BF1942.

For example a BF2 setting of 0.5/-0.5/-0.5 would be converted to -0.5/0.5/0.5 for BF1942. Basically the negative numbers become positive numbers and visa versa for positive numbers.