PDA

View Full Version : In progress: Editing the campaign map



Duke John
11-15-2004, 14:44
Contributions:
Encaitar
JeromeGrasDyke
Midnight
MonocerosDragon
Myrddraal
Duke John

Setup
When you make a new campaignmap you start by copying the standard campaign:In \Data\world\maps\campaign\ copy/paste imperial_campaign and rename it to something appropiate, for the sake of this guide I have named it newmod.
Go to \Data\world\maps\base and copy the files. Paste the files in \Data\world\maps\campaign\NewMod
Delete map.rwm and map_heights.hgt. The last one is not needed while the first one is automatically generated when starting R:TW.
Delete descriptions.txt and versions of descriptions_factionname.txt. These are not used.
Go to \Data\text and copy/paste imperial_campaign_regions_and_settlement_names.txt and rename it to newmod_regions_and_settlement_names.txt.

When starting R:TW you should now be able to select your campaign in the Provincial Campaign menu.

Campaign files

Text files:

descr_disasters.txt
Contains a list of the possible disasters e.g. earthquakes and floods.

descr_events.txt
This contains a list of pre-defined events that happen in game.

descr_mercenaries.txt
This is where the availability of mercenaries in certain regions is determined.

descr_regions.txt
This file contains a variety of region information, in this format:

region tag
- This is one of the most important files. When we later edit the file map_regions.txt, we will define the areas of the provinces using certain RGB values. In this text file, there is a list of all the provinces on the map. This list also contains info like the name of the region (no spaces but you can use _), the name of the settlement, the default cultures, the RGB value used to define this region in map_regions.tga, the resources available in that province, the triumph point value and the basic farm level. We will be editing this a lot.

descr_regions_and_settlement_name_lookup.txt
- This should contain a list of all the names of provinces and towns as they are called in descr_regions.txt These aren’t the actual names as they will appear on the map, these are just references for the program.

descr_strat.txt
- This is also one of the most important files. In this file, we choose the factions, set the start/end dates, position 3D models on the campmap (e.g. wonders and resources), allocate settlements to factions, set the buildings and place armies and family members. I go into the format of this a bit later.

descr_terrain.txt
- This contains the info about the dimensions of the map.


Tga files:

disasters.tga
- Contains the locations on the map for the different disasters. This should be the same size as map_regions.tga, which should have the dimensions stated in terrain.txt

leader_pic_FACTION.tga
- Where FACTION is the faction name. This is the portrait for the first leader of that faction.

Map_FACTION.tga
- Where FACTION is the faction name. This is the image that appears when you select a faction to show what sections of the world it owns.

map_climates.tga
- This is where you set the different climates for the world. There are 12 different climates some of which will become snowed during winter.

The 12 different climates are:
Sub-Arctic - Dark Green RGB(0, 166, 81)
Alpine - Green RGB(57, 181, 74)
Highland - Light Green RGB(141, 198, 63)
Swamp - Yellow RGB(255, 242, 0)
Deep Temperate Forest - Light Orange RGB(247, 148, 29)
Light Temperate Forest - Orange RGB(242, 101, 34)
Infertile Temperate Grassland - Red RGB(237, 28, 36)
Fertile Temperate Grassland - Dark Pink RGB(237, 20, 91)
Mediterranean - Pink RGB(236, 0, 140)
Semi-Arid - Blue RGB(0, 114, 188)
Sandy Desert - Dark Purple RGB(102, 45, 145)
Rocky Desert - Mauve RGB(146, 39, 143)

The dimensions of this file should be twice the size of map_regions.tga + 1 pixel

map_FE.tga
- I’m not sure what this does, it appears to be a map of the world, but it doesn’t look like any of the radar screens.

map_features.tga
- This is where you give the position of rivers volcanoes and cliffs. For rivers you define the source, the river and the crossings using different RGB values. Cliffs are just lines you cannot cross. This should be the same size as map_regions.tga, which should have the dimensions stated in terrain.txt

Here are the RGB values:
River - Blue (0,0,255)
Volcano - Red (255,0,0)
Cliff - Yellow (255,255,0)
River Crossing - Light Blue (0,255,255)
River Source - White (255,255,255)

Rivers cannot go diagonally (i.e. from one pixel to the pixel down and to the right). They must go in steps (i.e. from one pixel, down one pixel, across one pixel). You cannot have a square of river (i.e. 2 by 2 pixels) and a river must have a source. You can have a river that splits, but it cannot re-join itself.

map_ground_types.tga
- This is where you set the textures for your campaign map (i.e. Fertile, desert etc). There are 14 different ground types defined using different RGB values. The dimensions of this file should be twice the size of map_regions.tga + 1 pixel

The RGB values are:
Fertile Low - Grey-Blue (0, 128, 128)
Fertile Medium - Light Green (96, 160, 64)
Fertile High - Olive (101, 124, 0)
Wilderness - Black (0, 0, 0)
Mountains High - Light Brown (196, 128, 128)
Mountains Low - Brown (98, 65, 65)
Hills - Olive-Brown (128, 128, 64)
Forest Dense - Dark Green (0, 64, 0)
Forest Sparse - Green (0, 128, 0)
Swamp - Bright Green (0, 255, 128)
Ocean - Dark Maroon (64, 0, 0)
Sea Deep - Dark Red (128, 0, 0)
Sea Shallow - Red (196, 0, 0)
Beach - White (0, 0, 0)

map_heights.tga
- This is where the 3D aspect of the campmap is determined.

Ground must be shades of gray (Red = Green = Blue i.e. RGB(100 100 100)). The lighter the shade of gray, the higher the point on the campmap.

Sea must be shades of blue (Blue = anything, Green = Red = 0). I think it is possible to use any shade of blue, but the existing campaign maps use RGB(0 0 253) so that’s a safe bet.

map_regions.tga
- Probably the most important file. It should be the size shown in desr_terrain.txt

This is where the regions are defined. Each region has a different RGB value which is then stated in descry_regions.txt as I said earlier. Each province must have a town shown by a single black pixel RGB(0 0 0). This pixel must not touch another province. Ports are shows as a single white pixel RGB(255 255 255). These must be in contact with the sea. Ports are not necessary for the game to run.

Each province must at least a city. This pixel may not touch or corner a different province.
single pixel with R:0 G:0 B:0

Ports are not necessary, even for coast provinces.
single pixel with R:255 G:255 B:255

When making your map, remember these requirements.

Required landmass
The engine requires a certain amount of landmass that is relative to the size of the campaign map. If that amount is not present than the campaign will crash before loading.

Jerome posted:

A few other caveats about regions:
- they should be 'convex' (one landmass, no inaccessible areas)*
- they should have only one settlement and only one port
- all land tiles should be part of a known region
- each non-sea region should contain at least some fertile tiles
- continuous sea surfaces should form one region
- the maximum number of regions supported is 200
- the distance between the centres of any two adjacent regions should not exceed 50 tiles*


*: not doing these things shouldn't cause a crash, but it may cause the AI to mess up.

map_roughness
- When it comes to this file, I am ignorant as to what it does, someone could help me out to finish this guide? I know that it has to be twice the size as map_regions.tga.

map_trade_routes.tga
- Again, not sure what this does. It should be the same size as map_regions.tga


radar_map1.tga
- This is the minimap for the campaign. It should be the same size as map_regions.tga

radar_map2.tga
- This is the map shown during faction selection. It should be twice the size as regions.tga

water_surface.tga
- This is a texture for the surface of the water, you won’t need to edit this.

Tutorial: adding a small island
This tutorial is not ground breaking, but it should you a little insight about how
Step 1
Make a backup copy of the sons_of_mars folder. In the original folder delete:
[indent]map.rwm
map_heights.hgt
If the RWM file does not exist it will be automatically generated as soon you start a campaign. Since we make changes, we want it to be generated. Always restart R:TW when you have edited the campaign.

Step 2
To add a simple island edit the following:

map_ground_types.tga
map_heights.tga
map_regions.tga
Use the existing colours and common sense. Use temporary layers to get the island at exactly the same spot for all images. Resize a layer if necessary. Delete the layers before saving.

Step 3
Start the campaign and you might see something like this:
http://chronicles.metw.net/dungeon/smile.jpg

#.# Bug hunting

Steep coast tiles
Avoid greyscaling the sea when altering heights_map.tga. You might get a result like this:
http://chronicles.metw.net/org/guides/campaign_steep_coast.jpg
When you see such steep coasts ingame, then look for greyscaled pixels in heights_map.tga. Fix them with painting them with the correct sea colour.

Crash to Desktop
There are numerous bugs that you can introduce, but below are some that I have come across:
Settlement in map_regions.tga does not have the black colour: R:0 G:0 B:0.
Ports in map_regions.tga does not have the white colour: R:256 G:256 B:256 (this one haunted Myrddraal for a looong time)

Duke John
12-15-2004, 10:07
Making a new campaign map
This guide is meant as an addition to the rest of the campaign editing guide. Before using this template you should have read and understood the entire guide.

Download location: modding_campaign_template.zip (http://www.3ddownloads.com/totalwar/RTW/Tools/modding_campaign_template.zip;jsessionid=55332571FED146C030AE98C09DC70147#)

Necessary tools: Paint Shop Pro (another graphics program may also work, but in this guide I will refer to PSP so you will have to find equivalent commands yourself).

Contents
I have created a campaign that is stripped to the bare minimum:
All the original provinces, but without any buildings. The settlements of Brittania and the Senate are necessary to make the campaign run.
The only factions present are the Britons and the Senate (required or else the game will CTD)
Various map_TYPE.tgas are empty. The game will run fine, but the map will be featureless. This will quicken the progress considerably as you only need to edit map_regions.tga and map_heights.tga.

map_regions.tga
http://chronicles.metw.net/org/guides/campaign/template_regions.jpg
The topleft regions are owned by the Britons and the Senate. The Senate and the Latium region should always be included. When ingame you will see 6 or so extra generals. While you did not create them these are created by R:TW to fill the Senate offices.

map_heights.tga
http://chronicles.metw.net/org/guides/campaign/template_heights.jpg
Twice the size of map_regions +1 pixel.

Shortcut to campaign
I have also included a shortcut which will allow you to immediately load the campaign in a window. To edit the shortcut right-click on it. You should see:
"E:\Kopie van Rome - Total War Backup\RomeTW.exe" -show_err -ne -nm -strat:mod
and
"E:\Kopie van Rome - Total War Backup"
In both entries change E:\Kopie van Rome - Total War Backup to your own installation directory.
The -show_err will give you error messages unless a CTD occurs. If at any time you are sent back to the main menu, exit the game and you should see a message box that explains why the game got an error.

How to change regions
Always backup!
Always make alterations in small steps!

Some general remarks:
The engine does not care where provinces are located, you can freely move around provinces that do not have a settlement or army located in them (check this in descr_strat.txt). Always make sure that map_heights.tga corresponds with map_regions.tga.
A settlement (black dot R:0 G:0 B:0) of a certain region may not touch another region.
There is a big green rectangle in the middle of map_regions.tga. The form of this can be freely altered as long as you make sure that both map_regions and map_heights correspond.

When I made my own campaignmap I got the feeling that the engine requires a minimum amount of landmass. If at any time the campaign doesn't load and you are sure that you have done everything right, then the total landmass might be too small.

Once you are done making the form of the map, you can move the little rectangles onto the new landmass. Although I would advise to keep the Britons and Senate as long as possible on their own rectangles. If you do move them remember to move the generals in descr_strat.txt.

When done with shaping up the landmass(es) and placing the regions you can start detailing: adding height, ground type, weather types, more factions, settlements, etc.

How to make map_heights.tga correspond with map_regions.tga
Do this entire procedure without changing even a single pixel. If the campaign still runs you have understood it.

Open both images.

Select map_regions.tga, resize it to twice the size +1 pixel ; the template image is 255x156, this will be resize to (255*2 + 1)x(156*2 + 1)=511x313. Make sure that 'Resize type' is set to 'pixel resize'.

http://chronicles.metw.net/org/guides/campaign/template_resize.jpg

With the dropper tool (shortcut 'y') get the colour of the sea (R:41 G:140 B:233) as your foreground colour. Then select all ('Ctrl + a'). Go to Selections -> Modify -> Transparent Colour or just press 'Ctrl + t'. Set 'Transparent Colour' to 'Foreground Colour' and 'Tolerance' to 0. 'OK'

http://chronicles.metw.net/org/guides/campaign/template_transparent.jpg

Everything but the sea is now selected. Delete the selection by pressing 'Delete'.

Now replace the sea colour with the sea colour from map_heights.tga. Do this by using the dropper and right-click on the map_regions sea colour, your background colour should be now be changed. This is the colour that is going to be replaced. Left-click with the dropper on the map_heights sea colour. Then double-left-click in the edited map_regions image. You should see a change in colour.

Do the same for the landmass, but make sure that you left-click an almost black colour (for example R:9 G:9 B:9).

The result should be a black (R:x G:x B:x) and blue (R:0 G:0 B:253) image. Save this image as map_heights.tga.