[R-CON]Wilkinson requested this tutorial so here it comes:
1.Introduction
2.Getting started (here you most likly have to read )
3."The right Map"
4.Editing the Heightmap
5.Editing the Codefiles
1.Introduction:
This tutorial is about expanding a map from scale 2 to scale 4. i will do it with "Daqing Oilfields" which is a 1024x2 =>2x2km map. it should be also possible to do it with a 512x2 => 1x1km map, but i will expand now Daqing Oilfields" to a 1024x4 => 4x4km map.
This way of doing it you can keep a your statics, ambiente objects, sounds, overgrowth etc...
But there is one problem: if you expand your map its pretty much work (as far as i know) to keep your color + light + detailmaps. so make a back up of your map before you do anything to them!!!
2.Getting started:
Make sure you have read those tutorials:
https://www.realitymod.com/forum/f189-m ... dding.html
and this:
How To Make A Scale 4 Map - Official BF Editor Forums
Now you should have a working pr_edit mod and know that you always have to edit your terrain.con to make your 1024x4 => 4x4km map working ingame. (
![Laughing :lol:](./images/smilies/icon_lol.gif)
3."The right Map"
I will do it with Daqing Oilfields, but what is the perfect map for you? As i said earlier you should take a 1024x2 => 2x2 km map (size of Ramiel, Qwai). if your unsure about this, just take a look in the "Heightdata.con" located in the server.zip of your map or if you already extract your map or if its a custom map than it should be just in the *mapname* folder. Open it with notepad and read the first few lines of code:
This is my code from Daqing Oilfields
Code: Select all
heightmapcluster.create HeighmapCluster
heightmapcluster.setClusterSize 3
heightmapcluster.setHeightmapSize [color=Red]2048[/color]
rem --- primary ---
heightmapcluster.addHeightmap Heightmap 0 0
heightmap.setSize [color=Red]1025 1025[/color]
heightmap.setScale [color=Red]2[/color]/0.00762939/[color=Red]2[/color]
heightmap.setBitResolution 16
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapPrimary.raw
heightmap.setMaterialScale 1
heightmap.loadMaterialData Levels/Daqing_oilfields/HeightmapPrimary.mat
rem --- secondary ---
heightmapcluster.addHeightmap Heightmap -1 -1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_L1U1.raw
heightmapcluster.addHeightmap Heightmap 0 -1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_U1.raw
heightmapcluster.addHeightmap Heightmap 1 -1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_R1U1.raw
heightmapcluster.addHeightmap Heightmap -1 0
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_L1.raw
heightmapcluster.addHeightmap Heightmap 1 0
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_R1.raw
heightmapcluster.addHeightmap Heightmap -1 1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_L1D1.raw
heightmapcluster.addHeightmap Heightmap 0 1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_D1.raw
heightmapcluster.addHeightmap Heightmap 1 1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_R1D1.raw
heightmapcluster.setSeaWaterLevel 130
heightmapcluster.setHeightmapSize 2048 [This tells you about the whole size of the map, here it is a 2048 => 2km map]
heightmap.setSize 1025 1025 [This tells you how big your heightmap is, so we have a 1024x2 => 2x2km map here][Note: it will always add 1 more so for 256 => 257, 512 => 513, 1024 => 1025]
heightmap.setScale 2/0.00762939/2 [This is about the scale, the scale is the factor on the heightmap, so the first and the last number should be the same as there are just for the flat and the number in the middle is the scale of the height, but we will get into this a bit more soon.]
so if your heightmap.con looks simular to my, than we can start editing the map
![Smile :)](./images/smilies/icon_e_smile.gif)
4.Editing the Heightmap (with Photoshop)
First off you need to unzip the client.zip and server.zip of your map if your making a custom map you wont need to do it cos your map is already unpacked
![Smile :)](./images/smilies/icon_e_smile.gif)
Make sure they are not "read-only"!
Than make a copy of "HeightmapPrimary.raw" and call it lets say "4x4km.raw".
Now we will edit the heightmap with PS (you can also pick up another programm that reads and writes raw files. i think GIMP does that as well.).
Open "HeightmapPrimary.raw" and "4x4km.raw" with PS.
Now resize the "HeightmapPrimary.raw" to 50% of the orinial size.
Than paint the "4x4km.raw" with a paint tool the channel "alpha 1" comlpett black and channel "alpha 2" with 75% grey (you can also change the settings but for your first try this will be the guidelines
![Smile :)](./images/smilies/icon_e_smile.gif)
After that copy and paste the 2 channels form "HeightmapPrimary.raw" to the matching channels of "4x4km.raw". The copied patches should right in the middle of "4x4km.raw".
Alpha channel 1:
![Image](http://img33.imageshack.us/img33/5486/screenshot2205200913203.jpg)
Alpha channel 2:
![Image](http://img34.imageshack.us/img34/6650/screenshot2205200913204.jpg)
Than we´re done and can save "4x4km.raw" as new "HeightmapPrimary.raw" and overwrite the old one. [no special saving settings, just let it as there are default and dont care about "losing data", its fine this way]
now delete the old unneeded "4x4km.raw".
5.Editing the Codefiles
So lets just get the codes line up and we´re toally done
![Smile :)](./images/smilies/icon_e_smile.gif)
Open "Heightdata.con" with Notepad (under Vista it could be called "Editor").
Make sure they are not "read-only"!
Now this is my form "Daqing Oilfields":
Code: Select all
heightmapcluster.create HeighmapCluster
heightmapcluster.setClusterSize 3
heightmapcluster.setHeightmapSize 2048
rem --- primary ---
heightmapcluster.addHeightmap Heightmap 0 0
heightmap.setSize 1025 1025
heightmap.setScale 2/0.00762939/2
heightmap.setBitResolution 16
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapPrimary.raw
heightmap.setMaterialScale 1
heightmap.loadMaterialData Levels/Daqing_oilfields/HeightmapPrimary.mat
rem --- secondary ---
heightmapcluster.addHeightmap Heightmap -1 -1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_L1U1.raw
heightmapcluster.addHeightmap Heightmap 0 -1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_U1.raw
heightmapcluster.addHeightmap Heightmap 1 -1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_R1U1.raw
heightmapcluster.addHeightmap Heightmap -1 0
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_L1.raw
heightmapcluster.addHeightmap Heightmap 1 0
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_R1.raw
heightmapcluster.addHeightmap Heightmap -1 1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_L1D1.raw
heightmapcluster.addHeightmap Heightmap 0 1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_D1.raw
heightmapcluster.addHeightmap Heightmap 1 1
heightmap.setSize 257 257
heightmap.setScale 8/1.95312/8
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_R1D1.raw
heightmapcluster.setSeaWaterLevel 130
Code: Select all
heightmapcluster.create HeighmapCluster
heightmapcluster.setClusterSize 3
heightmapcluster.setHeightmapSize [color=Red]4096[/color]
rem --- primary ---
heightmapcluster.addHeightmap Heightmap 0 0
heightmap.setSize 1025 1025
heightmap.setScale [color=Red]4[/color]/0.00762939/[color=Red]4[/color]
heightmap.setBitResolution 16
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapPrimary.raw
heightmap.setMaterialScale 1
heightmap.loadMaterialData Levels/Daqing_oilfields/HeightmapPrimary.mat
rem --- secondary ---
heightmapcluster.addHeightmap Heightmap -1 -1
heightmap.setSize 257 257
heightmap.setScale [color=Red]16[/color]/1.95312/[color=Red]16[/color]
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_L1U1.raw
heightmapcluster.addHeightmap Heightmap 0 -1
heightmap.setSize 257 257
heightmap.setScale [color=Red]16[/color]/1.95312/[color=Red]16[/color]
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_U1.raw
heightmapcluster.addHeightmap Heightmap 1 -1
heightmap.setSize 257 257
heightmap.setScale [color=Red]16[/color]/1.95312/[color=Red]16[/color]
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_R1U1.raw
heightmapcluster.addHeightmap Heightmap -1 0
heightmap.setSize 257 257
heightmap.setScale [color=Red]16[/color]/1.95312/[color=Red]16[/color]
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_L1.raw
heightmapcluster.addHeightmap Heightmap 1 0
heightmap.setSize 257 257
heightmap.setScale [color=Red]16[/color]/1.95312/[color=Red]16[/color]
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_R1.raw
heightmapcluster.addHeightmap Heightmap -1 1
heightmap.setSize 257 257
heightmap.setScale [color=Red]16[/color]/1.95312/[color=Red]16[/color]
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_L1D1.raw
heightmapcluster.addHeightmap Heightmap 0 1
heightmap.setSize 257 257
heightmap.setScale [color=Red]16[/color]/1.95312/[color=Red]16[/color]
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_D1.raw
heightmapcluster.addHeightmap Heightmap 1 1
heightmap.setSize 257 257
heightmap.setScale [color=Red]16[/color]/1.95312/[color=Red]16[/color]
heightmap.setBitResolution 8
heightmap.setModified 1
heightmap.loadHeightData Levels/Daqing_oilfields/HeightmapSecondary_R1D1.raw
heightmapcluster.setSeaWaterLevel 130
(Red markered things are changes)
I changed:
-the "whole" map size to 4096 [heightmapcluster.setHeightmapSize 4096]
-the scale of the "flat" terrian, i have not touched the height! [heightmap.setScale 4/0.00762939/4]
-and the scale of the secondary heightmaps [heightmap.setScale 16/1.95312/16]
Now we´re should be finished,...so lets check the result
![Smile :)](./images/smilies/icon_e_smile.gif)
You might be a bit shocked now,... because of the expanded scale of your map you will need to smooth everything out.
And now its your turn, grab the editor tools and map like there is no tomorrow and show us your expanded maps
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Notes:
-This tutorial might not work with 512x2 => 1x1km maps, cos there are some problems with 512x4 => 2x2km maps
-no guarantee that this is turns out as you thought
-there is a way to keep your light + color + detailmaps! but i am too lazy to explane it
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
And here are some of my new 4x4km Daqing Oilfields:
![Image](http://img32.imageshack.us/img32/3340/screenshot2205200913450.jpg)
![Image](http://img193.imageshack.us/img193/4697/screenshot2205200913454.jpg)
![Image](http://img195.imageshack.us/img195/2468/screenshot2205200913455.jpg)
![Image](http://img194.imageshack.us/img194/1986/screenshot2205200913474.jpg)
![Image](http://img196.imageshack.us/img196/3284/screenshot2205200913480.jpg)
as a result of increasing the scale we have some weird terrain spots, but with a bit love from the smooth and modify tool we can work that out
![Smile :)](./images/smilies/icon_e_smile.gif)
hope you can understand much/everything maybe learned a bit and hopfully it works for you and you are lucky with the result.
cheers J.F.Leusch69