Mapmaking Tutorial.

Develop, collaborate, test and share new maps
Post Reply
User avatar
Jancsika
Posts: 921
Joined: Thu Nov 02, 2006 3:40 pm
Location: Maryland

Mapmaking Tutorial.

Post by Jancsika » Tue Jun 29, 2010 12:24 am

Mapmaking Tutorial.

The following tutorial is based on the article from the Wiki. Originally it was created by Dr.Frag. If you wish to add to it or expand it, you are more then welcome.
Just let WarII or myself know.
Jancsika

User avatar
Jancsika
Posts: 921
Joined: Thu Nov 02, 2006 3:40 pm
Location: Maryland

Re: Mapmaking Tutorial.

Post by Jancsika » Tue Jun 29, 2010 12:27 am

How to make custom maps and scenarios:
These instructions are adopted from the Wiki article that was created by Dr.Frag
and from Mike Kennelly’s page for Editing User Maps.
Using The In-Game Terrain Editor
To enable the in-game Terrain Editor you must add a line to your Settings.ini file found in your user data folder which by default is C:\Documents and Settings\<username>\My Documents\My Games\Sid Meier's Railroads!. Open Settings.ini in your favorite text editor and add EditorEnabled = 1 on a new line in the [User Settings] section.
Map Building TGA Style
Note: A lot of the information in this article comes from Mike Kennelly's excellent tutorials and Dr,Frag’s outstanding Wiki article.We are grateful to them for doing the research that enabled us to forge ahead with this effort.
Overview
While building a map in the Terrain Editor is fine for most people some of us like to do things the hard way. Actually if you're building something from scratch the Terrain Editor is a good place to be but this section talks about creating/modifying the Targa image file the game engine uses to create the physical map and terrain details. Why would you want to manually edit the .tga file you ask? The main reason, I believe, is so that you can use real world data to create your maps or if you are a graphic artist you might feel more comfortable doing it this way. Most graphics programs can Open and Save TGA files.
Anatomy of a Terrain Map
The file we will be working with is stored in the specific Scenario folder usually located in C:\Documents and Settings\<username>\My Documents\My Games\Sid Meier's Railroads!\UserMaps\<scenarioname>\ and is in the format map_<scenarioname>.tga .
There are 6 different size maps you can make in the Terrain Editor. Here is a table that equates your available choices to the map size in the image file.
Page01_Map Area.jpg
This table represents maps that are 10x10 units up to 15x15 units but it is possible to make maps that are bigger. We have done some testing and I have successfully loaded maps that are 25x25 units which equals 625 sq. units and a map image size of 1501x1501 pixels. While the game may load the map it probably takes a heck of a system to run a full Scenario in a map this big. I am building a map of Australia at 17x17 units (289 sq. units & 1021 pixels) and the Terrain Editor is perfectly happy modifying it once you have created the .tga file manually.

User avatar
Jancsika
Posts: 921
Joined: Thu Nov 02, 2006 3:40 pm
Location: Maryland

Re: Mapmaking Tutorial.

Post by Jancsika » Tue Jun 29, 2010 12:43 am

Page 02
Terrain Map 'Tiles'

Let's take a look at the .tga file for the US_Southwest map in
detail.
Page02_map_US_Southwest.jpg
The image file is comprised of 8 tiles that tell the game engine how to draw the Scenario world. This map is 100 sq. units so each tile is 601x601 pixels bringing the whole image file size to 601x4808 pixels.

The top tile is the grayscale Height Map that tells the game engine how to draw the physical landscape.

The second tile is the Terrain Map that tells the game engine to apply various textures to the physical landscape.

The third tile is the Tint map that allows you to paint on top of the Terrain Map. I have not noticed if there are any special colors that will have certain effects. It appears to be just an overlay to allow you to add details on top of the Terrain Map. White is transparent and the default color of the Tint Map.

The fourth tile is the Blend Map which I believe allows you to blend physical height features as well as terrain textures.

The purpose of the fifth tile is not known at this point and is considered to be unused.

The sixth tile is the Shoreline Map and possibly depicts certain water effects.

The seventh tile is the Tree Map that tells the game engine where to place . . . wait for it . . . trees!

The eighth tile is the Rock Map which tells the game engine where to place things other than trees like rocks, shrubs & cacti.

Now let's take a look at each tile in a little more detail.
The Grayscale Height Map
The Height Map can contain 256 various shades of gray from 0(zero) being black, to 255 being white. From a physical standpoint black would be the lowest level of ground and white would be the tip top of the highest mountain. In your paint program, since this is a full color image overall, this will be represented by equal Red, Green & Blue values such as R:0,G:0,B:0 for black, R:128,G:128,B:128 for middle gray and R:255,G:255,B:255 for white. If you take a look in the lower left of the Height Map below you will see where I have marked the end of the 0(zero) value in the ocean. Everything to the left of the white line is R:0,G:0,B:0 and then it gradually gets lighter toward the right(land). A nice gradual change will equate to a gentle slope out of the water and onto dry land like a nice beach area. As opposed to the area on the right in the red oval where you can see obvious banding and you will end up with noticable stair-stepping of your landscape as you can see in the image on right the
Page02_Terrain_Grayscale.jpg



And here is the answer to a question presented on the Forum. It appears that sea level ends at R:48,G:48,B:48 and land begins at R:49,G:49,B:49. I made a grayscale gradiant from R:0,G:0,B:0 to R:255,G:255,B:255 and placed a gray line every 10 levels starting at R:10,G:10,B:10 and ending at R:100,G:100,B:100. You can also see that a smooth even gradiant gives a nice gentle slope.
Attachments
Page02_Slope.jpg

User avatar
Jancsika
Posts: 921
Joined: Thu Nov 02, 2006 3:40 pm
Location: Maryland

Re: Mapmaking Tutorial.

Post by Jancsika » Tue Jun 29, 2010 1:11 am

Page 03
How to create a new map
The goal here is to modify the TGA file that is used to generate the game map.As it was pointed out earlier, the Height map is Grayscale map, where 0 – 48 is water and 49 – 256 is land. 256 (white) is the highest point, 0 (black) is the lowest.
You can use the terrain editor, free hand with a graphic editor, Digital Elevation Data from the US Government. I am Using the “Mapmaker” program, that came with Railroad Tycoon 3. (It works perfectly!)

Creating The Base File Set

Oversized Maps
As mentioned above you can create maps larger than 225 sq. units. Larger maps have been created, the largest being 24x24 Borneo map. But be aware of that these maps need a system powerful enough to handle them. You will need extra RAM in Windows 7, or have the 3 GB Enabler activated in Vista and XP. .
That being said here is how you go about breaking the rules. Create a 225 sq. unit base file set as described above and quit Railroads!. Now launch your favorite text editor or XML editor preferably and load the RRT_Scenario_User_<scenarioname>.xml file and scroll to the part that says <MapSize>15</MapSize> and change the number to the value that corresponds to the size of map you want to make. Here's a table with some values to help you figure it out. My Australia map is 289 sq. units so I entered a value of 17. Save the file.

The first thing you'll want to do, if you haven't already, is create a base set of files to work with.
To do this launch Railroads! and open the Terrain Editor from the main menu. You may get a Warning prompt about the Editor being an unsupported tool so if you're brave you can click Yes to proceed.
Page03-01.jpg
From there you will be presented with the Terrain Editor menu. Click the Create a new map button and you will asked to pick the size of your map.
Page03-02.jpg
All the regular game maps are 100 square units. You will probably want to pick a map size that fits the amount of terrain that you are trying to cover as well as the amount of 'stuff' that you want to put on the map. For example if you are going to map a county or state you can probably use the 100, 121 or 144 sq. unit maps but if you're looking to map a whole country then you will probably want to go with the 225 sq. unit map size.
Page03-03.jpg
Now launch your graphics program and load the map_<scenarioname>.tga file. Using the Resize function enlarge the image to the proper width using the above table and the height should be set at 8 times the width. If you have the image aspect locked this should happen automatically. I also chose a resample setting of Pixel Resize (Paint Shop Pro) as that will prevent any anti-aliasing or smoothing at the edge of each tile. Now save this file back out overwriting the original. You should be able to launch Railroads and load your map into the Terrain Editor by using the Load a saved map.
Page03-04.jpg

User avatar
Jancsika
Posts: 921
Joined: Thu Nov 02, 2006 3:40 pm
Location: Maryland

Re: Mapmaking Tutorial.

Post by Jancsika » Mon Sep 13, 2010 11:49 pm

Page 04
Stock Goods and Industries:
Stock goods.jpg

Traindude
Posts: 2
Joined: Mon Jun 02, 2014 7:26 pm

Re: Mapmaking Tutorial.

Post by Traindude » Mon Jun 09, 2014 9:06 pm

Hi

I'm sorry for resurrect this thread even though it is really great and well written.

This might be a stupid question but I'll ask anyway:

Is it the terrain map (terrain map = splat map) which tells the game what type of ground is it when the player lay tracks ?

If the terrain map isn't responsible for this then could some please tell how the game know what type of ground the player is laying track on.

User avatar
karsten
Posts: 643
Joined: Sun Dec 17, 2006 8:49 pm

Re: Mapmaking Tutorial.

Post by karsten » Thu Jun 12, 2014 7:40 am

Yes, it is the Terrain Map. Try it :D

Traindude
Posts: 2
Joined: Mon Jun 02, 2014 7:26 pm

Re: Mapmaking Tutorial.

Post by Traindude » Thu Jun 19, 2014 10:10 pm

karsten wrote:Yes, it is the Terrain Map. Try it :D
Thank you for answering even though this is an old thread.

I have an additional question:

Where can I change the construction cost when I'm laying track on a particular ground type ? - I can't seem to find an xml file with these values !

User avatar
karsten
Posts: 643
Joined: Sun Dec 17, 2006 8:49 pm

Re: Mapmaking Tutorial.

Post by karsten » Mon Jun 23, 2014 3:37 pm

AFAIK this cost depends on the earthworks plus tunnels/bridges the player uses - the formula cannot be changed, but the cost of tunnels and bridges can. :D

Jediron
Posts: 10
Joined: Fri Jan 21, 2011 3:52 am

Re: Mapmaking Tutorial.

Post by Jediron » Wed Aug 27, 2014 11:39 am

Ty for this nice tutorial. Have made a new map with the help of this article.

My problem? Have great difficulty to add goods into the map/xml files. There are some guides, but mostly they say only where you need to add lines, in which xml file but not exactly what to put there and no example how to add a working good like food, with all the details of the lines you must add into multiple .xml files.

Nvm, i solved my issue ;)

Post Reply