Cinematic Texture Modification
From AgeofWiki
Author: King Jared
Summary : Guide to change the cinematic textures of units without replacing the originals in gameplay.
As I've now been informed, this, apparently, is not a new discovery, but what the hell. For those of you, like me, who didn't know, there is a way to change the cinematic textures of units without replacing the originals in gameplay. Dnas, a gifted AOM modder, turned me onto the process which he theorized, but never did try himself. So, I followed his instructions, and, lo and behold, the process worked. Now, the solution is a little intense, but, as I said, it works. So, without further ado....
| Table of contents |
The Guide
Section 1 : What You Need
- Knowledge of modding in general, such as anim and texture editing
- Vachu's BAR Explorer (http://aom.heavengames.com/downloads/showfile.php?fileid=97)
- Edited cinematic textures
- A hex editing program, like Programmer's Notepad (http://www.pnotepad.org/)
I'm going to move fast, so you'll especially have to have the first one in order to keep up.
Section 2: Getting Started
To begin, you need to have all the components involved in the process, such as the textures, anim files, GRN models, and so forth. As an example, we'll use the Arkantos unit. Keep in mind, though, that the process can be adapted to any unit with cinematic models.
First, as I said, you'll need to have edited cinematic textures prepared. If you don't know how to do that, then you'll have to look elsewhere first; I'm not going into it here. For the purpose of the example, I have three edited and converted cinematic textures which have the original names: cine a arkantos map.ddt, cine a arkantos shoulder map.ddt, and cine spear map.ddt.
Second, you'll need to have the unit's anim file. For the example, we'll need the Arkantos unit's anim file, arkantos_anim.txt. This, as well as the textures and GRN models, can be extracted using Vachu's BAR explorer. It is located in the anim.bar for AOM, anim2.bar for AOM:TT.
Third, you'll need to have at least two GRN files from the models.bar. For the example, we'll use ark.grn and ark_idlea.grn.
That's more or less all you need for now. Now things get slightly more complicated.
Section 3: The Base Granny Model
Before we get into it, a little background information. The cinematic models in AOM are different from the standard models. Cinematic models are in a format called GRN, short for Granny, while standard models are in a format called BRG, short for who the hell knows. Now, BRG models define everything right in them; the vertices and vertex positions, the textures, the movement frames, everything. The GRN models, however, according to Dnas, are different. For GRN animations, a base model defines the structure, bone positions, and textures, whereas separate animation models define how the model moves, referring back to the base model. In summary, a lot of complicated gibberish for novice modellers, I'm sure, but you don't really need to understand it in order to edit it.
To begin, open up your hex editing program. Now, open up the ark.grn file you extracted. In Programmer's Notepad, you have to select All Files {*.*} in the Files of Type dropdown box. Once opened, the file will still look much like non-sensical gibberish. Hitting the little H key for hexadecimal mode will fix that, though.
Now, scroll down the document until you come to a series of words and symbols along the right-hand side. This is where the textures are defined, and where you'll be editing.
The thing you'll need to edit here will consist of any text that matches the name of the DDT texture files you edited, namely cine a arkantos map.ddt, cine a arkantos shoulder map.ddt, and cine spear map.ddt.
Note that you won't find the DDT extension in the text. Rather, you'll find a TGA extension at times; leave it as such. The part you want to change is the actual texture name anywhere you find it. Be careful, though, and remember what the textures are called, because you'll also find that at times the text will be "Cine A Arkantos", without "Map"; leave that as it is.
Regarding the actual editing, you want to simply replace any instances of the original texture names with your own texture names. However, and this is important, you have to rename your textures so that they contain the same number of characters as the original, including spaces. For example, "Cine A Arkantos Map" has 19 characters. Thus, in our example, we'll replace it with a name 19 characters long, "Cine Levied Man Map". The others must be the same number of characters as well; we'll use "Cine Levied Man Shoulder Map" and "Cine Hasta Map" for our purposes.
Once that's done, go to your edited textures and rename them to whatever name you chose to put in the GRN file. So, for example, cine a arkantos map.ddt would become cine a levied man map.ddt.
Once all the texture names have been altered, simply save and close the GRN file.
Section 4: Referencing the Base Model
Now that the textures have been set in the base model, it's a comparatively simple but arduous task of referencing the base model. The process here is deceptively easy; you simply have to rename the GRN files. But there's a trick to it.
First, the base GRN file must be renamed, otherwise it'll simply be loaded in place of the original. Remember, the name of the base GRN model must be at the start of every animation name. For example, we'll name our base model levy.grn. Now, we have to reference that base in our idle animation. Therefore, we have to name it levy_idlea.grn (the "a" is not necessary, but can come in handy if there is more than one idle animation). Essentially, the formula for naming is: base animation name_animation name.grn.
Easy, right? Not so much. Keep in mind that we're only modifying one animation in this example; the Arkantos unit, however, has well over 50 cinematic animations. That's a lot of GRN files to rename if you want to use them all for your new unit.
Section 5: Wrapping Up
Once the GRN file editing and renaming is complete, there's still the matter of actually implementing it into the game.
First, a shadow and selection shape must be defined. This is a simple task; open up the models.bar, find a file called ark.dcl, extract it, and rename it to match whatever your base model is. For our example, we would rename it to levy.dcl. This file simply defines the size of the shadow and selection shape for the unit; it can be opened and modified with a program like Notepad.
Second, the anim file must be edited. Open up arkantos_anim.txt with Notepad or some similar text editing program. If you've added a new unit to the proto(x), or modified another unit, then you would open the anim file for that unit instead. Now, scroll down to the animation defines sections. For our example, since we've edited the cinematic idle animation, we'll scroll to the "anim Idle" section for the Arkantos unit. At the bottom of this section, you'll see a line of text that has "VisualGranny Ark_idleA". This is where the cinematic animation is defined. Now it's a simple matter of changing the "Ark_idleA" to "Levy_idleA", to match the filename of the animation you've edited, less the GRN extension.
After that, simply save and close the file. What you're basically doing in the anim file is changing the names of the cinematic animations to match the filenames you've given the edited GRN files, whether they be standard animations like walking or attacking, or the actual cinematic actions, such as talking or sleeping.
Finally, you basically just have to put the files into the Age of Mythology folder. The modified GRN and DCL files go into the C:\ .... Age of Mythology\models\ folder. The rest should be obvious.
And that, for all intents and purposes, is how to change the cinematic textures without replacing the originals during gameplay. Now, behold! The fruits of your labour!
Both the original and the modified texture simultaneously. Is that not a glorious sight?
Post any questions or commentary you might have. And remember, though this isn't a "discovery", all praise for figuring out this particular process is to be directed at Dnas; I was but the worker bee. If you want to praise me for the guide, however, I'm cool with that.
