This object is actually the map file save by the map editor. There could be some reason to actually hack directly the map file if the map editor lack of editing features.
Any XML file located under "Elemental/Data/Maps"
XML <TerrainType>: The property <TerrainTypeInfo> links to <TerrainType>
XML <MapType>: Many information here is defined by the map generator if the map was generated randomly. The map generator parameters can be found in the map type.
XML <ForestType>: The <ForestData> property refers to the <ForestType> objects.
<DisplayName>: This is the name of the map that will be displayed to the user.
<MapTileWidth> & <MapTileHeight>: This is the final size of the map in squares.
<MapSectorWidth> & <MapSectorHeight>: This is the final size of the map in sectors. I am not sure why they need both measurements.
<SectorTileWidth> & <SectorTileHeight>: This is the size of a map sector. By default it's 16x16.
<RandomizeStartLocations>: This value is set to 1 if you check randomize starting location when saving the map. I'll have to make more test, but the starting locations does not seem as random as they seem. So even if you set this value to 1, you could start all game at the same location. Look below for more details.
<RandStartLoc>: This is a player starting location that is allocated randomly. Look below for more information about how the randomness does not work. Two values must be entered here which are the X,Y coordinates of the location. Like this:
<StartLoc>: This is a prefixed starting location. Useful if you want to make a story based map. 3 values are required here, the X,Y coordinates and the number of the player ranging from 0 to 7. You are always player 0. Here is an example:
<TerrainTypeInfo>: This property defines the various terrains available on the map and set a unique number that will be used afterward by the <TileData> Properties. 2 information needs to be written: A unique reference key number, and the internal name of <TerrainType>.
<TileData>: This is the content of the map. Now you must understand that there is not a <TileData> for every square of the map. The technique used here is like the .PCX file "Run Length Encoding" method. It converts the map as 1 line of square. Then it count the number of square of the same type and write an <TileData> entry for it. For example, it could say "the next 12 squares are made of 'forest' terrain". There are 6 values to setup separated by comas. I do not know the meaning of each value yet.
- 1: Number of squares : This the the number of squares that will have the same terrain.
- 2: Unknown
- 3: Unknown: but always 0 in the maps I designed.
- 4: Height: This is the height of the terrain.
- 5: Unknown: but always 0 in the maps I designed.
- 6: Terrain: This is the terrain reference number previously defined in <TerrainTypeInfo>
<ForestData>: This is used to determine which square contains forests. There is 6 values to set up:
- 1: X coordinate: X position of the square.
- 2: Y coordinate: Y position of the square.
- 3: Forest Name: In the maps I made, the name are generated randomly, but in other maps, sometimes there is a unique name here.
- 4: Forest Type: This is the internal of the <ForestType> that will be used.
- 5: Unknown: This value is always the same in the map I design.
- 6: Texture Weight: This is the weight of the texture defined in the <TerrainType>:<TerrainTypeEnvData>:<TextureWeight> property.
<MapObjectData>: This is used to insert special map objects. It seems to be possible to insert many types of objects, especially shards and special resources. There are 8 values to define, here are some sample entries:
<MapObjectData>78,34,0,ElementalShard 2,WaterShard,7,0,-1</MapObjectData> <MapObjectData>55,24,3,ResourceHoard 2,Wheat,6,0,-1</MapObjectData> <MapObjectData>66,53,2,Lost Battleground,Notable_AncientBattlefield,2,0,-1</MapObjectData>
- 1: X Coordinate: for the location of the feature.
- 2: Y Coordinate: for the location of the feature.
- 3: Unknown
- 4: Name: It seems to be a unique name for the object. On my maps, they are generated randomly.
- 5: Type: This seems to be the internal name of the object to insert.
- 6: Unknown
- 7: Unknown
- 8: Unknown
Tricks and Tips
No preset Starting location: If you do not set any starting location on the map, it seems that the game will create starting location randomly. Same thing if you are missing starting locations. But beware, they are probably using always the same random seed which means that the "random" starting location for that map will always be at the same place. You also get the problem explained below where the starting location never changes from a game to another.
Randomization of Starting Location: Using Random starting location and setting <RandomizeStartLocation> does not seems to randomize the starting locations. The only thing that will make you start on a different place on the map is the number of player in the game. If you add or remove players, the starting location will change but not all the time. I also tried with fixed starting location and of course, they does not get randomized even if <RandomizeStartLocation> is set.
Replacing cliff by beaches: I hate cliffs and since there is no way to control the amount of cliff I want to appear in the game, I decided to replace the cliff manually. This can be done with any text editor that has string replace features. First you need to find what are your cliff and beaches reference key number. You can find it in the <TerrainTypeInfo> at the beginning of the file.
So now we need to replace all the <TileData> where the terrain type is of type 11 to type 10. But since the cliff have a predefine height, all their height is set a 0. So we need to set the same height than other beaches. By default it's 50. So to replace the information in the <TileData>, you simply need to search for this string:
and replace it for this string:
Voila, all your cliffs are now beaches.
Back to XML editing