Terrain Modding Basics
From AgeofWiki
| Table of contents |
Introduction
Although the standard terrain set for Age of Mythology: The Titans covers most designers needs, sometimes it is necessary to create something new. That is what this guide is for. Here, you can find out all the basic things you need to know and have to make terrain mods for AoM and AOMTT.
What you need
AOMEd0.6 –0.5: This program is a slightly altered version of the normal release of AOMEd. It is optimized for converting AOMTT textures that are paletted, like terrains. It is a modified version, and should only be used for paletted texture conversion; unless otherwise noted, use the standard version of AOMEd to convert files (like xmb to xml).
Vachu’s Bar Explorer: This little program is useful for extracting singular files from BAR archives.
a painting or photo editing program: This you use to actually create the BMP file that will end up as a DDT file for use in AOMTT. see Programs for more information
Specific files you will be working with
terraintypes.xml/xmb: xml file that defines what texture files to use and the properties different terrains will have in-game
blends.txt: plain text file that tells the engine in what order to layer terrain textures and what edge blends to use between them
Outline
Basically, you will have to:
1) create a tiling texture and save it as a BMP
2) convert it to a DDT with AOMEd
3) extract and edit terraintypes.xml to include your texture
4) extract and edit blends.txt to include your texture
Step 1: Creating a Base Texture
This is the hardest part of modding textures. Advice is hard to give in this area, but we will begin with the standards that the textures must use in order for AOMTT to use them.
Size
The texture must be square, and use dimensions in pixels that are powers of 2 (2, 4, 8, 16, 32, etc.). This is practical for sizes up to 512 X 512, which is pretty much as big as you’ll ever need a terrain to be. Most of AOMTT terrains use 256 X 256. This is a good resolution; its not too big, and offers enough space to create a texture that will not look too repetitive in-game, especially when mixed with other terrains. 128 X 128 is a good size for terrains that have smaller-scale purposes, such as the standard Hades terrains which are meant to be used sparingly and heavily mixed. The smallest standard textures are 32 X 32, which is perfect for especially specific tasks, such as the standard submerged citytiles that are used as small canals.
Essentially, the size of your texture should be dictated by how you are intending it should be used in-game. The more specific its use, and the smaller and more varied area it will cover, the smaller it should be. Grassa is 256 X 256 because it is meant to cover larger, sweeping areas, while the citytile canals are supposed to be used sparingly and in very small, local areas inside the bustle of cities.
Format
Like all picture files to be converted with AOMEd, your texture base must be saved as a 24-bit BMP. If you try to convert a BMP that is not formated as 24-bit, you will get an error.
Tiling
The texture must tile properly, i.e., it must repeat endlessly with no visible seams.
This is one of the harder requirements of a good texture. Although you will not get an error or anything like that when you load a non-tiling terrain into AOMTT, it will lose much of its appeal if it does not tile. Tiling is especially hard to achieve in Microsoft Paint, and you are far better off with a higher-end program like Adobe (http://www.adobe.com)’s Photopaint. Photopaint and GIMP (http://www.gimp.org) are both free downloads. see Advanced Terrain Modding for more information on tiling
Miscellaneous Notes
Because of the difficulty beginners will have with tiling, they should start with a few tile terrains, like citytiles. You don’t have to worry about making it tile like an organic texture, like grassa, because the tile seams are on the entire terrain’s seams.
As for ideas, the sky is the limit. Try whatever you wish, and the most important thing to do if you want to make good terrains is do it a lot. Make several versions of the same terrain ideas; they will get better and better the more you make them. And don’t be afraid to experiment.
Step 2: Conversion
This is the easiest part of terrain modding. Open up AOMEd, and click Direct File Conversion, and browse for the base texture file you’ve created. Double click on it, and say OK to the prompt that tells you you are converting a texture. On the next window, where it asks you where to save your new DDT, go to your Age of Mythology directory (it should be in C:\Program Files\Microsoft Games\Age of Mythology). Save the DDT in Age of Mythology\textures\terrain. If terrain does not exist, create it.
In the next two windows, you must select 16-bit paletted and then 2 mipmaps. Terrains can only be of this format.
Notes
The standard AOMEd (version b) will convert paletted textures, but it will take a lot longer, up to five minutes. If you are using this version, then do not despair when AOMEd seizes up and doesn’t do anything visual for a while; just wait it out. The rest of your programs will run fine while it is converting.
Step 3: terraintypes.xml/xmb
Extraction
Terraintypes can be found in textures2.bar. Open the bar archive with Bar Explorer, and scroll down to the section for terrains. Terraintypes will be near the end of this section, in the XMB format. Extract it to a safe folder in your modding directory. While you are at it, extract blends.txt as well to save time. Makes sure you do not put this copy in the terrain folder of Age of Mythology; XMBs take precedence over XMLs, and your new terrains will not show up.
Conversion
Open AOMEd and click Direct File Conversion. Browse for terraintypes.xmb, convert it to an xml and save it in the same folder as it started in.
Editing terraintypes
For example purposes, we will show how to add a new grass terrain.
Open Wordpad or Programer’s Notepad, and then open terraintypes through the file menu. You must load it manually because simply double clicking on it will load it into Internet Explorer. When you open it, it will look something like this:
<terraintypes version="1" edgetype="Crust" edgedensity="8">
<type name="PassableLand" uiname="Land" mapcolor="183 206 220" impassablewater="">
<uiclass uiname="Grass">
<subtype mapcolor="123 159 46">GrassA</subtype>
<subtype mapcolor="123 159 46">GrassB</subtype>
<subtype mapcolor="123 159 46">GrassDirt25</subtype>
<subtype mapcolor="123 159 46">GrassDirt50</subtype>
<subtype mapcolor="123 159 46">GrassDirt75</subtype>
<subtype mapcolor="123 159 46">CliffGreekB</subtype>
<subtype mapcolor="123 159 46">SavannahA</subtype>
<subtype mapcolor="123 159 46">SavannahB</subtype>
<subtype mapcolor="123 159 46">SavannahC</subtype>
<subtype mapcolor="123 159 46">SavannahD</subtype>
</uiclass>
Before you add something, think about what properties you want your new terrain to have. Is it passable to land units? Can you build on it? Answer question like those, and when you figure out what you want, look around terraintypes to find the name of a texture like the one you are adding. We are suing a grass like texture example, but you can do whatever you want. Take special care to put your texture in a uiclass that makes sense. Tiles go in Citytiles, nonpasable rock goes in Cliff.
Now, add a line at the end of the uiclass that you have chosen, like:
<subtype mapcolor="123 159 46">SavannahD</subtype>
new line
</uiclass>
Then copy the subtype tag above it and paste it in the new line:
<subtype mapcolor="123 159 46">SavannahD</subtype>
<subtype mapcolor="123 159 46">SavannahD</subtype>
</uiclass>
Change the name of the texture to name of the DDT you created:
<subtype mapcolor="123 159 46">SavannahD</subtype>
<subtype mapcolor="123 159 46">YourLandTexture</subtype>
</uiclass>
And (if you want) cange mapcolor modifier. This is the value of the color the texture will appear on the in-game minimap. It is in RGB values.
Save
Save the modified terraitypes in your terrain directory of Age of Mythology\textures. Make sure you type in "terraintypes.xml" as the file name, otherwise you may end up with a plain text file.
Step 4: blends.txt
Blends can be found in the same place as terraintypes. It requires no conversion as it is already a plain text file, so just open it in Notepad. There are instructions in it on how to add terrains, so just follow them and add your new terrain. If you do not edit this, AOMTT will not display your textures.
Save the modified version in the terrain directory with terraintypes.xml.
Step 5: Load
The last and best step. After double checking all your files are in the same place, close everything and start up AOMTT. Go to the editor, scroll through the terrains in the terrain paint tool, and find your texture. See if it paints correctly, and mess around with it and other textures to see if they work well together. If problems arrise, or AOMTT crashes, go back and double check everything.
