SP Tutorial World Map Strategic Map creation

Users who are viewing this thread

Abhuva

Knight at Arms
M&B Strategic Map Creation

In this tutorial i will try to describe my workflow for making a strategic map.
Its a rather unusual approach using a lot of different 3rd party software.

Note: This will be a big tutorial and i will need some time to finish it, so be patient with me =)


Overview :
I) Software Pipeline
II) Design Map in L3DT
III) Mesh reduction with Meshlab
IV) Cleaning and expanding the mesh with Wings3D
V) Texturing, party and border relocation with Thorgrims Editor
VI) Last steps for getting the map to work in Warband



I) Software Pipeline


I will be using several free / open-source software so first of here is a list of what we need:
- L3DT - http://www.bundysoft.com/L3DT/
download the L3DT standard edition (free to use)

- Meshlab - http://meshlab.sourceforge.net/

- Wings3D (or any other 3d modeling program)

- Obj2Map and Map2Obj
http://www.mbrepository.com/file.php?id=2635
http://www.mbrepository.com/file.php?id=1793

- Thorgrims Editor (not entirely neccesarry, but i used it for its ability to give a good fast preview of the ingame rendering)

The general software pipeline i used is the following:
[list type=decimal]
[*] Create a highpoly terrain mesh with L3DT
[*] Reduce and repair the mesh with Meshlab
[*] Expand the borders, cleanup and texturing with Wings3D
[*] Convert the Obj file into Map.txt
[*] Use Thorgrims Editor to further texture and check the map
[*] Convert the Map.txt into Obj – go back to step 3 (do this till the final result is satisfying)
[*] Relocate the parties and borders in Thorgrims Editor
[*] Convert parties.txt into parties.py to get access to the source code
[*] make sure module.ini and parties.py of Warband is updated and compile the module system
[/list]

done…



II) Design map in L3DT
First i got a rough design map on paper to get me an idea of the scale and overall terrain aspects.

Getting this design into L3DT – using the design map approach:
L3DT gives you the ability to create heightmaps via a so-called design-map, thats a very low-resolution overview map which contains informations like altitude, erosion, peaks, climate etc..
I wont be getting into too much detail how to use L3DT, for a good beginner tutorial check this site:
http://www.bundysoft.com/wiki/doku.php?id=tutorials%3Al3dt%3Afjord

I used the biggest heightmap resolution available while creating the fresh design-map:
2048x2048 width&height
2.000 horizontal scale
no edge wrapping

This resamples roughly an area of 4x4 km (or 16 square km). You may wonder why i choose this so low. Basicly you can also choose more "real-life" numbers - you just have to try around a bit what altitude fits best then while designing.
In the first tests i just made different terrain-sizes and altitudes, exported this fast to mount&blade and checked ingame if the height fits. After tweaking around a lot i ended with the above numbers.

The altitude i used for designing was between 0 and 80 meters, with the most terrain around 20 (rather flat) and 40 (rather hilly) meters. If you change your scale for the inital design map you will end up with other numbers...
The M&B engine seems to use height, slope and texture to calculate the battlefield-terrain. This means that we need to make sure that the terrain we create isnt too high and too rough.
While I designed the map i was really often exporting the map to obj, quickly reducing polycount with meshlab, exported to map.txt, quickly textured (only base texture, no details) and checked this ingame to see if any problems arise (mainly with battle-field generation cause this can really screw you mod later if you dont pay attention at this step)

My HF/DM (heightfield/designmap) ratio was 16... this means i end up with 128x128 pixel design map. This is the highest resolution and only neccesary if you really need control over the finer details. Using a lower resolution will save you a lot of work.

Its important to already plan a border area (which won´t get used by the player) so you have it more simpler later when expanding the map. One mistake i made was making that border too small (visible at the right border of my design map) which really made me headaches later. Its also good not to use high mountains directly at this border, rather have very low and flat terrain there.
(at the left and upper side in my design map this was actually good)

To get you an idea how a possible design map may look like i will show the last stage of mine:
The altitude map:
altedit.jpg
This is defining the overall height of the terrain. The heighest height i was using was around 70-80.
Take care to not make the terrain too height in general as this will result in strange looking/very hilly battlefields later.
Most terrain was around 5-20, the more hilly terrain around 30-40.

The peak map
peakedit.jpg
This will define overall peaks. Like rolling hills / plains.
I used a very low peak on most of the walkable terrain, and a mid to high peak at the mountain areas.

The fractal map
fracedit.jpg
This is somewhat similar to the peaks, but making the terrain overall more rough. Mostly used this on the big mountains.

The erosion map
erosionedit.jpg
This is the "cool" function which will make our mountains look way more realistic. Mostly used with mid to high values at the big mountains.

Generating a heightmap from this design map got me the following:
heightfield.jpg
Note that generating the heightmap (and all the other maps) may take quite a while (on average it was around 5 mins for me)

I also calculated all the other maps (water-map, texture map, light map etc.) -> a good texture map will help us later to texture the terrain properly.

A render of the final result looked like this:
finalrenderl3dt.jpg

After i was satisfied with the final result in L3DT i exported the map as OBJ file (note – i didnt used any reduction so the file was about 150 mb and had around 2.5 million tris).
Time to get to the next step...

II ) Reduction of the Mesh via Meshlab

Meshlab is an open-source software designed to handle real highpoly meshes. It have a lot of features and might look overhelming at first. We will only use the very good quadric mesh reduction function... so no need to worry about all those other features.

First we load our mesh into Meshlab:
File-> Import Mesh  or Ctrl-I

Once its loaded (this may take a little while), we use the quadric edge decimation tool.
Filters -> Remeshing, simplification and reconstruction -> Quadric edge collapse decimation (with texture)
meshlab1.jpg

I reduced the mesh to 60k (60.000) polys. This is a reasonable size - original native map has around 45k polys.
Its important to use the one with the texture - this way the texture is still applied and will help us later to texture the map easier.



III) Cleaning and expanding and quick texturing the mesh via Wings3D


This will be the most time-consuming step. We make intensive use of the two converters (obj2map and map2obj) so make sure you have them installed. For the sake of simplicity i made a new directory and put both programs in it.
Obj2map will always take a "map.obj" file and convert it into a "map.txt" in the same directory.
Map2Obj will always take a "map.txt" and convert it into a "map2obj.obj" file.

The good thing is that we can switch between a map.txt readable for example by Thorgrims Editor and an Obj file usable by any 3d-modelling software like Wings3D. The converters will keep the material information which enables us to texture in both programs and switch between them like we want.


The first thing we wanna do is checking all the borders and merge unneccesary vertices (using weld function).
If you prepared the design map carefully this shouldnt take too long. (in my case i spend hours on the right side cause the mountain area gave me a lot of vertices which needed to be welded).

After this we expand the borders and reduce the overall faces in each step (using extrude function and weld function).
Note that in Wings3d you also need to take care of the downside faces and apply the "hole" material there.

Here you see the final map with expanded borders.
wingsborder.jpg

The playable area will be like 1/9 of the overall mesh-size. This is mostly to make sure that you never see the borders ingame.

Adding roads:
First i quickly textured the area i want the roads in.
road01.jpg

Then i delete the diagonal edges and select the vertical ones.
road02.jpg

Using cut and connect i create new faces (normally 2 should be enough, but i rather went for 3 so i can smooth the road better)

road03.jpg

The last step is to move the vertices/edges around to make the road thinner... (i also lowered the middle face a tiny bit - mostly to get some shadow casting in the roads and so a better visibility ingame.

Note that you need to triangulate the whole mesh when modifying it in this way as last step.

IV) Texturing, party and border relocation with Thorgrims Editor

Note: to properly use Thorgrims editor you need an install of M&B (the old one) cause Thorgrims dont work really with Warband.

I won´t write about the use of Thorgrims Editor here, there are several good tutorials how you setup and use this program.
Instead i just point out for what i actually used it.
Like most people know, Thorgrims Editor crashes very often when trying to change geometry (like adding vertices for example). But it seems very stable for texturing.
In most cases i only used it to quickly texture a map and get an idea how it renders ingame without actually need to start M&B.

To be able to test your map in M&B you also need to make sure that no party (aka towns/castles/spawnpoints etc.) is placed on impassable terrain. The easiest method (but defintly not bugfree) is to relocate those parties in Thorgrim´s till it let you save without any error-messages.
Assuming you want to test your map in Warband you now need to copy the map.txt and parties.txt from your M&B test folder to your M&B WB test folder.
If you changed borders you also need to copy the information from module.ini (dont just copy this file, instead modify the Warband module.ini with the correct informations)

We will get several bugs when really playing cause we just used the parties.txt from original M&B in M&B Warband, but for now it is enough to start the map ingame and see how it looks. Later we need to properly port the information into the Warband module system but for now its way faster to do it this way...


V) Getting all info into Warband

Note: During the next weeks i will add more detail to this tutorial
 
Back
Top Bottom