PDA

View Full Version : Map Modding Help



Heledir
01-21-2007, 04:30
I'm looking for instructions on how to mod the campaign map. Can somebody help me please.:help:

Jerek Kruger
01-28-2007, 01:59
I realise I've already posted a question about this but no answer has really been given. Is there anyone who can list which files need to be edited to change (or make a completely new) campaign map?

Ilsamir Lord
01-29-2007, 01:09
Myrddral wrote a very good tutorial for mapping in Rome, which is basically identical to mapping in Medieval II.

I can't find a link (I'm copying the following from a word-document I made of the tutorial a while ago), but if you look in the Rome modding section you should stumble across it eventually).

I'll post the list of files and descriptions he gave, though some of them (usually quite obviously) won't be applicable to MII:


Text files:

descr_disasters.txt
- contains a list of the possible disasters e.g. earthquakes and floods. We don’t need to edit this.

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

descr_mercenaries.txt
- This is where the availability of mercs in certain regions is determined. The pool is the overall area, the regions are the regions in this area, and the units are the units available in the pool. We will need to edit this later.

descr_regions.txt
- 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.

After this, one of the best ways to mod the map would be to look at the files in vanilla MII (data/world/map/base etc.) to see how things are done. If you have doubts about whether something will be compatible, just check to see if there is a precedent set in the files in vanilla.

You'll also need a program which can view and edit .tga files (of course).

Jerek Kruger
01-29-2007, 01:36
I actually found it. It's https://forums.totalwar.org/vb/showthread.php?t=50437

It pretty much tells you what you need to know although there are a few differences and you'll need a strings.bin converter.

What I basically did to add another province was to go through all the text files in the data\world\maps\base and data\world\maps\campaign\imperial_campaign and data\text\imperial_campaign_regions_and_settlement_names.txt.strings and look for reference to a similiar province (in my case I was adding another town in England and so looked for all references to Nottingham) then make similiar duplicate reference with suitable changes for the town I was adding. It worked so I guess I did it right.

Have to say it feels pretty good to do this as I think I have the basic knowledge to create a complete campaign map now. I'll have to learn how to deal with events etc. but to me the campaign map itself is the first step.

Ilsamir Lord
01-29-2007, 03:21
Glad you found it and I look forward to seeing your work in the future.

Heledir
02-03-2007, 05:24
Thanks This really helps me a lot.:2thumbsup: