6.1 If you want to mod non graphic terrains, you first have to understand how these graphics are implemented.
All graphics are implemented in a drs file. For now we'll stick to graphics.drs, ui graphics are in another file.
These drs files you can find in your game\data folder.
A drs file can contain images (bmp), sounds (wav) and scripts.
The graphics are organized in slp files, that contain all images for a specific animation. So a unit for example has several slp files as it has several animations like standing, walking or attacking. A buildings image is a one-frame animation. Objects like trees have one animation for every forest type, choosing one frame for each tile randomly.
In the file empires2_x1_p1.dat there is a graphic object defined, pointing at a specific graphic entry in the drs file using the numeric id the slp has.
You now could change the bmps contained in a slp file contained in the drs file directly. That way you would simply upload that one file and that's it.
But that way you could only use one graphical mod, as every file can only be changed by one mod.
HiddenPath implemented a different system, using it themselve for the new HD cliffs and flames.
(So the originals are still in the drs file, you just installed fix mods they implemented for these graphics.)
The game checks your game\data\slp folder for seperate slp files. If it finds a file with the same name a graphic object in the dat file has, this graphic will be replaced ingame.
You will find there the files clf01_NN.slp - clf10_NN.slp and 'flm' ones. That are the new HD mods HiddenPath implemented.
Just in generall, files ending with '_NN' are main graphics, files ending with '_0N' are shadow graphics (some objects have a seperate shadows, showing up ingame as semi-transparent (buildings for example), others have their shadow in their main graphic, showing up as completelly black (units for example)).
6.2 To edit these graphics, I recommend two free tools I'm using:
1. Advanced Genie Editor[aok.heavengames.com]
2. Turtle Pack[aok.heavengames.com]
Both of them are fan made as there exist no official modding tools for AoE 2.
Turtle Pack can be used for everything regarding drs and slp files beside actually drawing.
(I'll only cover the most important functions here.)
With the Genie Editor you can edit the empires2_x1_p1.dat in your game\data folder and change the games mechanic. If you want to do this - there are a lot of tutorials out there.
For now the interesting thing is to get the slp names, for extracted slps are named with their numeric id, that is used as a pointer by AoE. But HiddenPaths modding system needs them to be named with their objects name.
6.2.1 Use Genie Editor
to get the right name for a slp do the following:
Open Advanced Genie Editor. You'll get a dialog where to choose/set general file locations.
You can choose from several path presets if you want to.
Important is the location of the dat file you want to open.
If you want you can also type in the path to your language files, then several unit texts will be shown as set in them in the editor.
Click on OK and the editor will open the dat file. For me the dialog shows up two times as well as the editor window. Just close/cancel the second one.
The editor looks like this:
Now select 'SLP' as the first filter, type in your slps id (in this example the Knights attacking animation) and apply the filter by checking it:
As a result you get the corresponding graphic object entry and it's name (without the file extension of course).
6.2.2 To get in contact with the graphics you want to change, just open the graphics.drs using turtle pack.
In the example I searched for 'Knight' to find the attacking animation (and as you can see on the id, the Knight is not the Knight. There are several units that have different names as a slp or in the dat file:
Now we can extract the slp file. It opens a folder dialog where you can set the right one:
Now you have a slp file. Open it with Turtle Pack:
- A) AoE has no real collision system. Each object blocks an amount of tiles. The 'X' in the center is the center for the objects graphic. That one can be positioned where you want. Theoretically the graphic could show up 3 tiles away. It would still block its building tiles, but be shown somewhere else with no actual collision at the graphic. You can change the position by using the arrows or 'STRG + Arrow Keys'. This has/can not to be done on the graphic itself!
- B) With this Button you can select all frames on the right. It also works with 'STRG + A' when you already have one selected. The Default is no selected frame.
- C) All selected frames will be extracted as seperate bmps to the folder you will choose in the opening dialog.
- D) AoE uses an indexed color palette. This means it uses no colors, but pointers to a color for every pixel. That color is defined in the palette. Therefore each image you want to import should be converted to the right palette first (It works without, but you WANT to convert it!).
As you can see this works independant of the actual frames. You can convert whatever you want. Just choose the files by hitting the 'Add' button and choose a directory the converted bmps will be saved in. Hit start and then close the dialog (this doesn't work automatically).
After doing so, you should replace the frames (you can do a complete new slp, add or delete frames, but the used frame count is defind in the dat file, so additional frames doesn't show and missing ones will result in empty frames beeing played. So for just changing existing visuals, just replace existing ones.):
For the replacement, choose the new frame and set player color and transparency.
The transparency defines which color of your bmpy shall be changed to the transparent one.
The player color means which color you used in your bmp as player color. This is important as the AoE palette has 8 exactly defined values for every players color shades. When extracting a bmp, every pixel that is supposed to change it's color according to players color will be colored in the chosen player color (default is blue). To convert a real color back to the undefined player color one, you have to set this. If you choose red for example, no red pixel - even if it matches a red player color value - will be interpreted as player color but shown as red - for every player.
On the other hand, every pixel that changed to a color shade of the chosen player color while converting - even if it wasn't meant to have players color - will have it ingame. And every pixel supposed to have the players color but doesn't have the right color value after converting - will not change its color ingame.
- E) You can verify if a pixel has the right color by changing the player color on the left side of the editor. This changes all pixels marked as player color to the right color shade of the chosen player color. The chosen color is also the color used as player color when extracting a bmp.