0% found this document useful (0 votes)
33 views17 pages

AB Map Making Tutorial Small

This document is a tutorial by Dmitry on creating custom maps for a game, detailing the necessary files and their purposes, such as map.xlm, defaults.xml, and terrain.bmp. It also explains the process of obtaining and processing height maps using QGIS and other tools, including steps for cutting and converting the maps into the required formats. The tutorial aims to assist users in understanding the complexities of map creation while encouraging community contributions for improvements.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views17 pages

AB Map Making Tutorial Small

This document is a tutorial by Dmitry on creating custom maps for a game, detailing the necessary files and their purposes, such as map.xlm, defaults.xml, and terrain.bmp. It also explains the process of obtaining and processing height maps using QGIS and other tools, including steps for cutting and converting the maps into the required formats. The tutorial aims to assist users in understanding the complexities of map creation while encouraging community contributions for improvements.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

by Dmitry ( Veitikka Studios)

Map files

For each map there is a set of files that the game understands:
Hello, my name is Dmitry and I drew maps for AB and by numerous requests
I will tell you how I did that and how to make your own map. • map.xlm - file where the name of the map is recorded and which files are
First of all, I would like to briefly tell you about the main points: used for display. If you copy it from another map, then I think by the attri-
Unfortunately, English is not my first language, so I could be mistaken in some bute names you figure out where you need to enter the necessary data.
formulations due to translation difficulties and make punctuation errors. But
I will try to convey thoughts as easy as possible. • defaults.xml - the file where the day length, temperature and season type
This tutorial is based on my experience, so it may well be somewhat incon- values are recorded depending on the month. Later I will write in more
venient in some places, so if you know the solutions better, please write it in detail how to configure it and what each of the meanings mean, so while
the comments. I think we all will be grateful to you. I will try to complement temporary you can copy this file for example from the Fulda map for
the best decisions and some changes in the process in the first post. example.
If the tutorial is incomprehensible in some places, then I will try to add more
detailed descriptions in order to get intelligible material in the end. • locations.xml - the file where all the names of settlements on the map,
The maps in the game are quite large. At a resolution of 30m per pixel and the coordinates of the inscription, its size, font type and size are recorded.
2048 pixels wide and high, we get 61440x61440 sq m, i.e. just over 60 km These inscriptions are created in the map editor of the game, but if you
in all directions. Technically, the game also supports large sizes, but here it REALLY want, you can do it manually in the table immediately.
should be think in mind that as the scale increases, the influence of the cur-
vature of the Earth increases, which means that errors accumulate. Never- • terrain.bmp - file with settings for tiles on the map, each pixel has its own
theless, errors on such scales can be “acceptable”. And I don’t speak about color, which belongs to a specific type of tiles. They can be created both
the time what it could take.) in-game editor and in the graphic editor also.
The map for scenarios is limited to 15x15 km, which is also not the limit and
everything depends on the power of the computer (on my relatively power- • height.bmp - file with a relief on the map, below we will consider how to
ful computer I was able to run the scenario in the size of 27x27 km until the create it.
game crashed at biggest size).
The game uses a system of tiles in the form of squares, and therefore it is • preview.png - file used to display the entire map on the farthest zoom
quite difficult to display correctly directions that are slightly different from
the axes and diagonals (i.e., the road going under 6.3 degrees will be relati- • preview_small.png - the file used in the battle editor only, when you se-
vely problematic to display without assumptions). Therefore, the roads in the lect a sector.
game are made with some conventionality of ease of use and display. With
100% geographically correct mapping of roads, huge amounts of artifacts • info.png - file with the name of settlements, which is used only in the
arise and the network of roads becomes rather unattractive (I would even editor of battles.
say “inconvenient to reading”)
The maps use a real height map, but their extraction and preparation for the • lights, png - file with lighting during the night. It is created at the very end,
game have some difficulty (I would even say trickness), but in general, if you in a rather tricky way, but on the whole is not difficult.
figure it out, the main difficulty will be to have enough free time and great
desire. • background.png - a file with a picture that is used when loading a map.
But more on that below. You can use any image to your taste.
Relief
Like many realistic simulators, where there is a real height map, as far as I
know, they now use the Shuttle Radar Topography Mission (SRTM) dataset
that covers about 80% of the land on earth (from 56 ° S to 60 ° N .).

The mission itself looked something like this

Unfortunately from this site you can download the elevation map in a fairly
low resolution, so that it does not really help, but still.

So. It seems to have dealt with the sector, but where can I get a map?
To do this, you can use this site
You can read about this in Wikipedia By registering on this site, you will be able to download elevation maps from
different sources, it all depends on the search filter.
But back to the game. This site has tutorials, but we can look at a specific example:

First of all, you need to understand which region will be of interest to you. On the left you can see the main panel with tabs, and on the right the map
For an approximate understanding and “guessing” of the sector, I used this itself.
site (real relief maps for Cities: Skylines) We will consider in stages.
On this site, you can visualize the sector at 60x60km (or less) and approxi-
mately check if all that you might find interesting will fit into it.Thanks to this, Search criteria tab
you can easily plan exactly what place you want. First we need to decide on the coordinates by which the site will look for
For example, a sector might look something like this (this is just an example) height maps. Clicking on the map you put points on which you can select a
region (or you can use the selection by holding down the left mouse but-
ton). You can roughly “by eye” highlight a square sector based on what you
selected on the previous site.
Photos will be large enough and will
cover a fairly large area, but do not be
afraid, we would cut out the sector of
this piece.
Push “Download” near each pho-
to and download each image preferably
in GeoTIFF format.

Highlighting the sectors, go to the next tab “Data sets” there you need to
select: Digital Elevation/SRTM/SRTM 1 arc-second Global

And so now you have data on the sector of your interest, let’s process it.

I used the QGiS program and it seemed to me quite simple and effective.
First, download it from this site and install it.
Now clicking on the Results you can see
a list of available data for this criterion.
After installation, run the program and create a new project
Project -> New
Now add our downloaded height maps using
Layer> Add New Layer> Add Raster layer...
Click Raster> Miscellaneous> Merge... and a dialog box opens in which you
need to select our files in the “Input” section

Highlight the downloaded files and click Add

Now our files look like this. Now clicking Run will start the merge process. As a result, you get one layer
Merged in which all sectors are merged into one. By the way, at below the
layer you can notice the values of the minimum and maximum height in the
sector, in this case -43m - 437m (you will need it)

Do not be afraid that the maps look strange, this is because each sector
has different values of the minimum / maximum heights, so now we need to
merge them into one big picture.
Now let’s find the coordinates of the meridians and parallels to cut the de- Cutting
sired sector. And so your map now looks flat and much more correct.
Let’s cut out the sector we need now.
Projections.
Now we need to deal with the projection. The correct image of a spherical First, install the QuickMapServices plugin
map on the plane was an eternal problem of cartographers, and we are also Go to Plugins> Manage and install Plugins
faced with this now. In order to avoid this, it is necessary to translate the map In the search bar, find quicmapservices and select the found file from the list.
into a UTM projection relative to time zones. Install it by clicking Install plugin

Go to Project> Properties> CRS


enter in the line Filter UTM and in the Coordinate reference system of the
world, find WGS 84 / UTM zone 32 N at the end of the list.

Plugin installed.
Now you can call it through the menu Web> QuickMapService
Let’s now add an Open Street Maps Map to our height map.
To do this, select OSM>OSM standard

** To see what other projections are in the world and how they looks you
can use that site
Now we have a height map and an online OSM map (in fact, it can be any
other) as a reference.

Now let’s find our sector and cut out what we need. I used a fairly simple
guide system to calculate the sector of the desired size and save it separately.
There are other options (maybe you have better?)

Guides.
Go to View> Decorations> Grid... and customize the guides with specific pa-
rameters. Our sector will be 61440x61440m in size and therefore we need
guides of the same scale.

Use Offset Axes and the Update button to visually adjust the region of in-
terest.

And in the end we got something

Click on Add and guides will appear on the map. Now every square is a sec-
tor that we need in the right size.

Please note that the guides are set in their coordinate system, and we need
them to cut a certain sector.
If we are satisfied with everything, then proceed to the next step - cutting. Do the same with another point.

We need 2 points of the sector (upper left and lower right). Now we have the coordinates of the parallels and meridians along each edge
of the sector.
460080, 5878800
521520, 5817360

Let’s cut our sector to a separate file.


In the Layers tab at the bottom left, select the merged layer and right-click
on it and select Export> Save As

Approaching close enough to one of them, we need to move the cursor over
the crosshairs and write down the coordinate values at that point. In the window that appears, select Raw data, GeoTIFF format
• in the file name, choose where to save it and how name it (the browse to a file for the game and why it is so red and with gradients.
button on the right) If we take the color and divide it into 3 parts, we get the RGB color: red, gre-
• CRS choose our UTM from the dropdown list. en, blue. Each color has a range from 0 to 255, and the receipt of a particular
• click the Add saved file to map checkbox so that after cutting it is also color will be a unique combination of values for each color.
added to our layers. Gradient - a smooth transition from one color to another. For relief, the
• enter our coordinates game use the value of red and uses blue as a counter between the levels (in
• In the “Resolution” tab, select the “columns” and enter our 2048x2048 fact, no, the game does not use blue, but I use it for convenience).
Suppose that the value at 0 meters is Red: 0, Blue: 0, then for 72 meters of
Now, clicking on the Ok button, we will get the cut out sector from the large height it will be Red: 0, Blue: 0. Knowing that red cannot be more than 255,
image in the size we need. then at 256m of height the value of red will be reset to 0 and blue to the
next counter, i.e. Red: 0, Blue: 1 and so on. This results in such ring-shaped
gradients, the red color goes up by each meter until it reaches the peak and
is not reset to the next stage.

1) Build a map using QGIS.

I have already tried to make these gradients in a separate style so you can
download THIS style file and apply it to your sector.

• download file
• go to the settings of your layer with the relief
• select “Load style ...” in the bottom menu and select the file with the style

now you know the height value in this sector (from -4m to 92m)

Now it is necessary to make the game understand this map of heights. At the
moment there are 2 ways to do it:
• using QGIS
• using a utility written for this

Before this, a brief explanation of the principle of converting elevation maps


• wala! your sector is repainted. • -sca - the number of transitions of the red channel, that is, how many ti-
• now you need to save it using the Export command and instead of RAW mes the height will pass the mark of 255 meters.To find out, then subtract
data you need to use the Render image the minimum height from the maximum height and divide by 255.
• -min - the minimum height in the sector to correctly display the height
reference point
• -smo - level of relief smoothing. SRTM data is often quite noisy, so to get
rid of this point, you can add smoothnes.Very useful option
• download your sector-relief image in bmp format to the program root
folder.
• now we need to add data and the command will look something like this:
C:\1\convertheight.exe file1.bmp height.bmp -sca 7 -min 215 -smo 1

Clicking on Enter you start the process and the final file will appear in the
folder where the program is located.

• now remains to convert that file to the .bmp format in any graphic editor Preview
that can open the tiff file.
Now you need to make a picture for the map preview. This file will be used
when selecting a sector and in the game on the most distant zoom.
2) using software But the most important thing for mapmakers is that this file can be very
conveniently used for drawing real data immediately in in-game editor.
This program was made by Juha so that you can quickly convert the elevation
map in the correct format.The only difficulty is that it is launched through the First you need to create it.
Windows command line, so if you are not experienced in this matter, then Here is a couple ways:
you may have very minor difficulties.
A. I used a map with data from the OSM, therefore, since we have already
• First you need to download it HERE created a map in the file, then we can cut out from it the piece we need in
• copy into something like C:\1 to some simple folder a fairly large size.
• now to launch it, click Win + R and the launch window will open and enter - Choose a layer with an OSM map
the command “cmd” there so the command line will be launched - Click Export - Save As ...
• now enter the command C: \1\convertheight.exe or simply drag the - in the settings select Render image
downloaded .exe file into the command window - select CRS to “Project CRS:...”
• if you press enter, then most likely the program will give an error - to cut the region we need then in Calculate from layer select your layer
• Invalid arguments, should be <input> <output>. Optional: -sca <scale> with a sector.
-min <minimum> -smo <smooth>
• This means that after the command you need to add the name of the file
that is the source, the name of the file that will be in the end and you can
also add the necessary optional attributes:
Similar way but more convenient.

Now that you have a file with a preview,


In in-game editor you can use the T key to switch between the map in the
game and the preview file in the game map editor.Very comfortably.

You can also download maps from other services (here you can find a tuto-
rial on how to do this in section No plugin required)

Filling data.
• in the Columns, you can set an arbitrary (but equal) value. As far as I know There are several scenarios:
the game can open the file in any size and it all depends on the power of
your computer. My relatively average computer was able to open a file in 1. export data directly from the OSM and use it in its original form:
the size of 6000x6000 pixels and this helped a lot when creating maps. So + real data
experiment and be able to choose the right size for you. + export process is quickly enough
• after that you will get a file on the output (for the game, .png is needed, so - quite a large number of errors
you should convert that with the help of a graphical editor) - does not work well with the tile system (we call it susages-roads)
- The data depends on the occupancy in the OSM. If there is emptiness, then
B. Suggestion by Af1352pasha nothing to do with that.
- quite a difficult way but still.
Project(menu)-->Import/Export--> Export Map to Image
2. Draw over other cards with your hands.
+ you can use any existing map of a specific time
+ great detail control
+ the result is the most beautiful for such a system After you click the Run query, you will see an array of data of different types
+ you can do only in-game editor (points, lines, areas). What type of data you can choose in Advanced so be
+ - works best with the tile system, but sometimes there are errors with a guided by what comes out of it.
discrepancy with the relief in favor of readability
- takes a LOT of time
- requires a very large perseverance and attention

3. combination of methods
+ - here are the pros and cons mixed together depending on the proportion
of each method.

1. Export data.

So far there is an opportunity to use OSM so we use QuickOSM plugin


Opening it you will see something like this.

** If you have an error, then perhaps it is related to the complexity of access


to the server. To do this, change the settings in the parameters API and try
to use different until it works.

Now we need to export them to raster. The problem is that the program
sees these lines as vector objects and it has no idea in what resolution they
need to be made.
For this, we will be helped by a layer with a relief that has the resolution we
need.

Key - here we select the type of data we are interested in (roads, forests, First we give the lines a thickness. To do this, use the command Vector - Geo-
lakes, etc.) processing Tools – Buffer
Value - here we select a data subtype (or do not select anything, then it
downloads the entire array under one type.
Instead of In we put the Layer Extend and select our layer with the relief.
Thus, the data is loaded within this layer and nothing more.
We have to cut it from relief map to
get raster lines on the same scale as
we need.
Use the menu Raster - Extraction - Clip
Raster by mask layer

Input layer - choose our layer with re-


lief
Mask layer - choose our layer with
vector roads

In the Distance field, I used the value 0.00015 and this was enough for me for
a single-pixel line, but you can experiment on something that will be more
convenient for you.
Click Run and wait for the process to end.

You may notice how all the lines


have become thick, but at the
same time they consist of many
segments. Let’s combine them all
into one.

Use the Vector - Geoprocessing Tools You now have a raster image of roads.
- Dissolve.
Select our buffed road layer and
click Run.
Now all roads are combined into
one vector layer.

**
** As you noticed, the lines are interrupted, this is the back side of cutting, scenario\development.cfg file and set
when the line was between pixels and the program could not recognize whi-
ch of the pixels should be taken. Therefore, a small program was developed mapEditMode=1
to close such lines. Here you can read about it.
Now if you generate a scenario in the game, you will be taken to the map
If you go into the settings of the masked mask, then the symbology and chan- editor.
ge the Render type to Singleband pseudocolor, then you can repaint the layer
to the desired color. You can also use any graphics editor and draw there by using pixel brushes
(or a pencil). Just open the terrain.bmp map file, and you can use graphic edi-
tors for drawing, if you feel comfortable with them. The terrain type colors
can be found in the docs\terrain_palette.png file.

Info.png
After preparing all of this files the game would requre info.png (its the labels
of cities on the battle generator menu), so you can use that info.png as a
placeholder before you finish the map and you’ll think about a such cosmetic
thing.

Tips, tricks, features.

• I used the fence as a border between Germany, so it displays a rather


bright red line. I hope in the future we will introduce a separate group
of the fence to make some kind of fencing (although this is more likely a
cosmetic type of tile)
• There is a trick when drawing railways. The game automatically draws
the connection of the railways when crossing the asphalt road, but if you
immediately make a diagonal turn after crossing, the game will break the
railway.

In order for the game to understand who needs which color, the color codes
for each type of surface in the next paragraph.

In the same way, download all the categories you need and in the end you can
achieve the map what you need in a rather difficult way.

2. Drawing by hand.

To start the in-game editor, you need to make changes to the game’s \data\
Therefore, you should draw an additional pixel forward and only then draw
the turn.

Try to avoid such situations. But if such situations occur quite a lot, then we
will need to add a separate color for a separate bridge. Tell me if there are
difficulties with this.

• Dense building has a bad effect on the movement of units in cities. Some
• There is also some difficulty with bridges. If you draw 2 bridges nearby, houses can be built in a tile from the road and most likely will block routes
then unfortunately they will unite that would help overcome obstacles. Heavy units unfortunately can’t break
through the houses. Try to avoid such things.
Using the F2 key - change the text style; F3 - change font size; F4 - change
text color.
Here are the principles I used:
• Large text size I used on the largest cities in the region. It appears on any
zoom level.
• The average size I used in settlements that are regional or district centers
• small size I used on very small villages
• I used italics on sights (some artificial places, forest, mountain, lake)
• used colors for the intended purpose (white - artificial places; green - fo-
rest, field; blue - lake, river, etc.)

• The principle of building an autobahn.


Their 3 colors, but they themselves are the same. This amount is necessary
so that you can make a road that runs parallel to the other and does not
intersect with the next. So you can use all kinds and connect them

To be beautiful, I connected different colors of the autobahn somewhere on


a straight part of line.

That is much better (you can also add the trees and bushes for example)

• Use text. I used different sizes of labels to designate villages/cities or some


local sights.
When you press the L button in in-game editor, you will enter the text assi-
gnment mode. Clicking on the desired tile opens a window in which you will
need to enter the name of the place.
Thus, the player does not see the difference, but the game sees that this is a
road and it continues.

• Roads are automatically tied to neighboring tiles; on this, some roads may
have a rather strange error. For example, such a connection

In game it will look like this If it suits you, leave as is. If I think while such subtleties
not, then you can manually are enough to make a map
clean up from errors of your dreams!

That’s all FOR NOW. I will add new information as communication and sug-
gestions and difficulties.

Thanks to all!

You might also like