Original Thread: Editing Worldterrain Files (IWTE)
Editing Worldterrain Files (IWTE)
Editing worldterrain files
The following information should help modders understand the basics of modding the worldterrain files.This allows you to change the landscape of any .world map without actually changing any of the .world/collision/animations. So you can position the ‘settlement’ on a hill, in a valley etc but still retain everything about the settlement (if you wish).
Essentially you should think of the worldterrain file as containing four items :
The worldterrain Vertex – these are all exactly 8m apart. You can only adjust the height The worldterrain merge factor associated with each vector – value 1.0 to 0.0 identifying whether this vector shows fully or becomes more merged until it has no effect on the original landscape The Landscape merge mask – merges the original landscape towards an average 0.0 height The mask TGA paths – the texture masks applied to the world terrain file. There are 4 masks with a macro and micro mask for each
To try and explain this better :
The worldterrain vertexes
The vertexes are all 8m apart. All you can do is add new rows or columns and amend their height.
The normal battlemap is approx. 221 vertexes square.
Milkshape can only handle 181 vertexes square.
The worldterrain should be variations of height from a 0.0 average height.
It should be noted that the triangles that then make up the mesh do not have a uniform direction. They follow a basic pattern (which isn't a single bottom left to top right split as an example). However when the vertex meets water the pattern gets broken and the triangles are formed connecting to the lowest vertex.
The worldterrain merge factor
This factor says what the vertex weighting is versus the underlying landscape. A value of 1.0 implies the vertex shows 100% and the underlying terrain is completely hidden whereas a value of 0.0 means the underlying landscape is showing completely and the vertex has no effect. Obviously you should have values of 1.0 under the settlement (ie any vertexes associated with the .world file) and then should merge to a 0.0 value for the outer edges of the world terrain. This will then blend the worldterrain into the underlying landscape.
The Landscape merge mask
This is a fixed size (256*256) and is either present or not (IWTE tool doesn’t allow you to delete it if you don’t want it – in that case just select a starting file that doesn’t have one. It will allow you to add though). Its purpose is to merge the surrounding landscape towards an average height which is 0.0 in .world/.worldterrain terms. In this case the fully merged means the landscape value is 0.0 whereas the unmerged shows the true landscape (based around an average 0.0 height).
The merge mask also covers the same area regardless of changes to the world terrain vertex mesh (it’s a few metres bigger than the 121 size maybe fitting to a 128 size)
The mask TGA paths
OK these are really textures but are internally referred to as TGA. There are 4 masks which can be called whatever you like but start normally as mud, path, farm1 and farm2. Each has 2 files associated with it representing the macro file and the micro file. Each file then has a size associated with it (in metres) over which the TGA is stretched.
Please note that the masks ONLY use their alpha channels to determine how much of the associated Macro and Micro files show.
Order of sequence
You should think of the order of sequence for building the battlemap as :
Obtain height and feature information from stratmap.
- Also apply climate, geography and vegetation information. Apply landscape merge mask – to merge landscape towards a central average height deemed to be 0.0 in .world terms Apply the Worldterrain vertexes merging according to the vertex world terrain factor
- Applies rock values to cliffs and also applies the terrain TGA masks (other underlying geography still applies).
How do you change them using IWTE?
The features for changing the world terrain are all under tab Terrain1 in the IWTE tool.
Amend WT Mask TGA paths
This option brings up a table where you can overwrite the TGA names and change the size associated with the macro and micro files.
Create Terrain base TGA
This option creates a TGA of the vertexes (The terrain TGA) and (if it exists) a TGA of the Landscape merge mask. It asks for 3 parameters which only affect the Terrain TGA.
Greyscale control point – is a grey scale value which controls the conversion of the height to greyscale.
Height assigned to GCP – This is the height associated with the greyscale value.
Greyscale increments per height – This is the number of greyscale values per metre height change.
OK this normally confuses me but what it means is if you use greyscale height 150 has Height assigned 0.0 and greyscale increments is 3.0 then a height of 1.0metres would be greyscale 153 and 2.0 would be greyscale 156 etc
Always note the values down as you need to enter the same values when you replace the terrain TGA.
If the height exceeds the parameter settings i.e. requires greyscale above 255 then the colour is changed to blue and if it required a value less than zero it is changed to red.
The worldterrain merge factor is stored in the alpha channel of this TGA.
For the TGA of the landscape merge mask this just uses a greyscale value representing the merge. It doesn’t use the alpha channel.
Replace with Terrain TGA
This replaces only the Terrain TGA file (the one with the vertex heights and the world terrain merge). You should enter the same parameters as used to create the file in the first place. One thing to note, if a pixel is NOT greyscale it does NOT replace the existing value. This then allows you to concentrate on editing a small piece in detail and leaves the remainder as it was.
Please remember the TGA is a 32 bit TGA and expects an alpha channel.
Replace with WT merge TGA
This replaces the existing Landscape merge mask values with the values from the TGA (Note it doesn’t check for greyscale it simply uses one of the values). It also adds it in if the worldterrain file doesn’t currently contain one.
Please remember the TGA is a 32 bit TGA and expects an alpha channel even though not used.
Create Terrain ms3d
This creates a milkshape file which you can then edit in milkshape. However it only works for sizes up to a maximum of 181 by 181 vertexes after which the milkshape limit is exceeded.
This file doesn’t allow you adjust the world terrain merge factor.
The mask TGA path information is held in the model comments. You can amend that (provided you keep the right format) or you can delete it completely.
Replace with terrain .ms3d
This replaces the vertex height information with an ms3d file. Like all the read backs it must match the expected file size. Model comments are read back if present but if the format is not correct this will crash. Best to remove the model comment COMPLETELY.
Amend Terrain in 2D window
This checks to see if a world file is already held in memory. It displays the height and location of the vertex in the 2d window. You then can drag and select vertexes and set them to specific heights or add a height increment (ie move them up/down x metres). It allows very precise changes and you can view the world file at the same time. It also allows you to set the vertex merge values.
You need to press OK at the end to save the change.
Resize world terrain
This asks for a number of parameters.
You can set the number of vertexes in each direction (most .world settlements are square but tech trees are often rectangular).
There is then a flag to decide whether to apply any default merge values. If you set this to on then the default merge values will be generated based on the 4 entries. These 4 entries identify the distance in vertices from that edge over which to generate merge values moving from 0.0 to 1.0.
You should also always resize the worldvegetation file or the game will crash. There is no need to resize the world pathfinding but its probably best to.
OK that’s all there is to it.
So a few tips we find useful
Create the right size world terrain, pathfinding and vegetation first. We prefer editing generally via the TGA’s. So copy in a general TGA merge alpha and also a standard landscape merge if needed (not needed for tech trees). TGA blur effects can quickly smooth off terrain if that’s what's needed once basic heights are set. For fine tuning we use the amend terrain in 2D window It’s a good idea to think of the placement of settlement shapes from the .world in relation to the vertex positions of the world terrain. You cannot join reflective planes to other water a gap needs to be maintained eg of approx 8m. If you try it the reflective planes will disappear.
Link to IWTE tool thread :
There are currently 1 users browsing this thread. (0 members and 1 guests)