Technology Modding GuideBy Magnum Pi
Well, recently I've been answering a fair amount of questions about technology modding or have dealt with complaints that could easily be resolved if only the person could have understood more about technologies.
And I was looking through the modding articals and various threads stickied around here and I haven't noticed one that deals specifically with technologies, especially one designed for newbies. So I decieded to put my knowledge to use and make this guide, I apologize if I only missed it and this has been done before.
To start, I should answer a few questions about technologies:
1. What can be accomplished with technology editing/adding?
Wow. I should begin by saying that for any regular modder, technology editing is almost as important as unit editing, if not more so! With technologies, you can modify almost any given attribute of any unit/building/other technology in an enormous number of ways.
Ever wondered how ES got the different cultures/major gods/minor gods to each have different attributes? That's through technologies! How about how units are upgrade through thier various stages of progression? Well, once you learn it, it's all easy to understand, and I'll be teaching it to you now.
2. How does technology editing tie in with unit editing?
Technology editing and unit editing are indeed closely related. Unit editing will control what qualities or statuses a unit has, technologies allow those statuses to be changed through the course of the game depending on certain conditions, for example villager gathering upgrades. If such techs did not exist, then you would have to spend your enitre game using the unupgraded villager gather rates, making it nearly impossible to support a mythic/titan age civilization.
However, because technology editing and unit editing are so closely connected, it is recommended that you have atleast moderate knowledge of unit editing. There is another modding guide on Proto (unit) editinghere or possiblyhere.
Hopefully, you are able to understand proto reasonably by now and are ready to start editing technologies. But before we begin, you will need the following programs in order to move on:
AoM Edit by Ykkrosh. This is the most important modding tool out there. It allows you to extract and convert almost all of AoM's data files into an editable form. Thank you, Ykkrosh!
Bar Explorer by Vachu. Quicker and easier to use than AoM ED's sustitute method. Needed to extract the nessecary files that are compiled inside various .bar files. Good job, Vachu.
Notepad/Wordpad. One or both of these come already available with nearly every system made today, so this shouldn't be a problem.
Now it's time to move on. The AoM file that controls technologies is called techtree, in the original AoM, but techtreex in the Titans Expansion. From now on I will be refering to them both as techtree(x). Just be sure you are editing the proper one depending on which game you have.
Unfortunately techtree(x) is hidden inside Data.bar, if you have vanilla AoM, or in Data2.bar if you have TT. So open Bar Explorer, and then specify the folder you want Bar Explorer to look into by double clicking on the correct folders until you reach "C:/Program Files/Microsoft Games/Age of Mythology/data/" once you see Data.bar and Data2.bar in this folder, double click on the one that is appropriate for your game (Data.bar for vanilla AoM, Data2.bar for TT).
Once you have Data(2).bar open with Bar Explorer, look for the file techtree(x).xmb, and then use the "edit - Extract to..." option and set the folder as "C:/Program Files/Microsoft Games/Age of Mythology/data/" And just to make things easier, do the same with proto(x).xmb.
Now, exit Bar Explorer, and open AoM Ed. Select the option "direct file conversion" then specify the "C:/Program Files.../Age of Mythology/data/" folder and select techtree(x).xmb and click open. A notice should pop up saying something like "converting to XML, select an output window" set it in the data folder. Then do the same process with proto(x).xmb.
Whew! You're almost ready to start editing techtree(x).xml, but before you do, open the data folder and delete the 2 files called techtree(x).xmb and proto(x).xmb. Do NOT delete the .xml files you just created! You can close AoM Ed now too.
Technology Editing At Last
The moment you've been waiting for, at last! Using notepad/wordpad open up the file techtree(x).xml, just ignore proto(x) for now.
The first technology you should see is "Age 1". Here is an explanation of what each of the lines in each technology mean (Note that I had to replace all the "<", that should be in your techtree(x).xml, with "[" so that the dumb forum won't delete my writing):
[tech name="*will vary*"
This simply the name that the data files will recognize the technology with, whenever it is being refered to at some other point. Just ignore this unless you want to add a technology, which I will come to later.
The two choices here are "Power" or "Normal". "Power" means that the tech in question is refering to a god power, which are all controled elsewhere. "Normal" simply means this is an "ordinary" technology, so unless you are creating a new god power, this should be set to "Normal" and ignored.
This seems to refer to the ID number of the tech. If you are adding a new technology, then your new tech should have it's dbid set to 1 more than the tech directly above it. If not, then leave this alone.
This specifies the string table number that holds the name that the technology will have in-game. In most cases that name is the same as the "tech name", but not always. Disregard this unless you are adding a new technology.
[cost resourcetype="*Food, Wood, Gold, Favor*">*quantity of resource cost, will vary*[/cost>
Abstract, editor-only techs will not even have this. This determines the cost of the technology. You simply type which resource you want in the quotations after resourcetype=. Be sure to spell the resource correctly and to capitalize only the first letter. If you want a technology to have more than one resource cost (i.e. food, gold, and favor) then you must have this line multiple times.
In number after the > and between the < is the amount. Be sure to just have the number in here, no spaces or other characters will be permitted. Feel free to change these if you so desire.
This determines how long the technology will take to be completed, in seconds. That's all there is to it. Go ahead and change this if you want. Just remember that higher numbers take more time, and vice versa.
Surprising though it may sound, this sets the status of the tech. The status available to use are:
OBTAINABLE - Means that the tech can be researched by all civs once the prerequisites have been met.
UNOBTAINABLE - This tech cannot be researched at all unless it is enabled with another technology. For example, only the egyptians can research Heavy Elephants. This is because the tech "Heavy Elephants" has a status of unobtainable, but the 3 techs age 1 isis, age 1 ra, and age 1 set all have one effect each that sets the tech status of "Heavy Elephants" to obtainable for them. This way, if you play as Isis, Ra, or Set (in other words, eggies) then "Heavy Elephants" will be available for you to research.
ACTIVE - This means that the technology will be active and in-effect for all players as soon as that he/she meets the prerequisites for this tech.
PERSISTENT - Used sparingly. This means the technology is being researched or activated indefinately. The only instances I can think of that use this status are with respawning units, like the Pharoah or Poseidon's Hippocampus. Those techs have an effect to create certain units near certain buildings (dock and TC) and have this status, that way the unit will create again if it is killed, which a prerequisite can detect.
The way that these statuses affect technologies, and given the fact that one technology can change the status of another technology, can lead to a huge and tangled web of reasoning which can get very complicated. If you find yourself needing to edit the statuses of a large number of interconnected techs, you may want to have a document or paper to keep track of what you do.
This just determines the icon the tech will have, it is entirely up to you. Don't forget that you can always look into proto(x).xml or at another technology and then copy the icon of another unit/tech into the one you are editing/creating. There is also a modding artical Here that will tell you how to create your own icons if you wish.
This is very important if you are creating your own technology, much less so if you are not. There is a string in the game's language dll for every technology in the game, the number in this line tells techtree which string contains the description for this technology. For example, the tech "Medium Archers" has a rollovertextid of 10751, and the game's language dll the string 10751 reads: Upgrades Archers to Medium Archers with extra attack and hitpoints. Follow?
[buttonpos row="*will vary*" column="*will vary*">[/buttonpos>
Many techs will not even have this. Supposedly, this tells the game in which position the slot to research this tech will appear. However, if your new tech is to appear at a unit/building, you must set this in proto(x).xml. So I'm pretty sure you can just ignore this completely.
Various "flag"s may be present in a technology, most of them are quite self-explanatory, i.e.[flag>HideFromDetailHelp[/flag> makes the technology not appear as an upgrade if you view a unit's encyclopedia. Just ignore the flags, by all probability you will not need them.
[prereqs>*will vary greatly*[/prereqs>
The prerequisites determine what conditions must be met before the technology's status (most often set to "obtainable") will take affect. These conditions vary enormously and would be impossible for one article to list. Here are some commonly used examples:
[specificage>*Classical Age, Heroic Age, Mythic Age*[/specificage>
If this is inside the prereq brackets, then the tech's status will only take affect once the given age is reached. Note that you do not need a "specificage" prereq if you want the age to be the Archaic Age. Also, if you want the Titan Age as a prereq, you cannot use this and must instead use: [techstatus status="Active">Secrets of the Titans[/techstatus>. Another common prereq is:
[culture> [culturename>*Greek, Norse, Egyptian, Atlantean*[/culturename> [/culture>
This means that only a certain culture can get the tech. Be sure to spell the word correctly an remove any spaces/illegal character's. If you want multiple cultures to be able to recieve this tech then, be sure to have one [culturename>[/culturename> for each civilization.
[typecount unit="*Unit's EXACT Proto Name/One of the 'Unittype's found under numerous unit's proto stats" count="*number of units required*" state="noneState aliveState " operator="*gte = greater than or equal to, lte = less than or equal to, gt = greater than, lt = less than, e = exactly equal to.">[/typecount>
A far less common prereq (found in age advances) requires you to have a certain amount of a certain type of unit, this one is used sparingly, but, if used, will require you to know a bit about proto(x).xml. Suppose I wanted atleast 5 infantry units to be required before my imaginary tech X would be available. I would use this prereq, set the "unit" to "AbstractInfantry" (because all infantry units have this in thier proto identity, thus making them be counted), set the "count" to 5, then set the operater to "gte" meaning greater than or equal to. If you didn't understand that, it's not critical, as this prereq is used very sparsely. The next possible prereq I'm about to show, however is used extensively, so it's imperative that you comprehend that.
[techstatus status="*will vary, see the tech statuses explained earlier*">*will vary*[/techstatus>
This is, by far the most common prerequisite found in all of techtree(x). It is saying that, in order for this tech to be obtainable/active/whatever-its-status-is, then another tech (the one written between ">" and "<") must have it's status be set to a certain one (most often this is "Active").
Here is an example, the reason you cannot reasearch Heavy Archers before researching Medium Archers, is because the Heavy Archers tech has one of its prereqs as: [techstatus status="Active">Medium Archers[/techstatus>. Meaning, Heavy Archers is not available for you until Medium Archers has its tech status as "Active". Active, as stated before, means the tech is researched and in-effect.
With this you can have it so that any technology, at any of the given statuses (obtainable, unobtainable, active, persistent...) be required as a prereq for any other technology. No doubt this can cause extreme logical headaches, but it gives you very powerful control over the requirements for your new/edited technology.
Now, you've made it through understanding (hopefully) the statuses, prereqs, costs, etc. that make up a technology, we must move on to the long-awaited effects themselves.
Remember the proto(x).xml I told you to save earlier? Now is when you're going to need it! So open it with notepad/wordpad now, and be prared to constantly be looking into it!
Firstly, listed after the prereqs for each tech, will be the line [effects>. Then at the bottom of the tech will be the line [/effects>. Between these, there will be sub-texts that began with [effect type=...> and end with [/effect>. Every one of those that is present, constitutes one effect that the tech will perform once researched.
The [effect type=...> that you set will determine, ironic though it may seem, what type of effect will occur. The four effect types are:
Text Output - The number for a text output effect refers to a string table in the language dll, what ever is present in the string specified will be displayed as a notification message i.e. "Iron Weapons improvement complete." You can make the text be displayed for all players, as is the case with capturing a relic, by using [effect all="true" type="TextOutput">*language dll string*[/effect>.
TechStatus - One of the more usefule, but relatively scarcely used effects. It allows one technology to set the staus of another (think back to the statuses I listed previously).
Set Name - The number put here corresponds to a string in the language dll. This simply changes a unit's name to something else. The unit's name listed as "proto name" must be spelled EXACTLY as it appears in proto(x).xml. The culture must be set to "none" so that the player with the tech will have his unit renamed, not just a certain civilization. And the string must be set the language dll string hold your unit's new name. Unless you have created your own, upgradable unit, don't worry about this.
Data - The most common effect type. This means that some attribute in proto(x).xml is being modified; attack, hp, line of sight, max velocity, whatever. If your new/modified technology is going to change some attribute of a unit/building, than you will be using this.
Since "Text Output" and "Set Name" have to with language dll editing and only become important if you need to create your own technology, I will focus on the "Data" effect type. Here we come to a super tricky part of editing, in which you must have a select goal you are trying to achieve. Guessing mindlessly, will not help you here.
Once you set the effect type as Data, there are numerous specifications that will come next, that vary greatly depending on what effect you are trying to achieve. Maximize proto now, use the "find" feature under "edit" to search for the unit you trying to change with a technology.
Once you have that, IF you trying to modify somthing that is listed under one of its "proto action"(s) (i.e. a units attack range) than the very next thing you put after [effect type="Data" will be action="*copy the name of the proto action you are modifying EXACTLY as it appears in proto(x).xml*" For example, suppose I was trying to give the Toxote +5 pierce damage when it attacks. So far my effect would look like this: [effect type="Data" action="RangedAttack" Because I want to give the Toxote the extra damage under its proto action called "RangedAttack"
IF, you are changing an attribute of your unit that is NOT listed under one of its proto action(s) (for example, it's hitpoints) then affter [effect type="Data" you'll need to add amount="x" and then replace the x I used used with the number you want. If you were changing an attribute of your unit that is controled under on of its proto actions, then still add an amount like how I just explained. In my Toxote example, my effect would thus far look like: [effect type="Data" action="RangedAttack" amount="5.00"
If the attribute you want to modify about your unit is not related to any of its actions, then you can skip all text written in purple. If it is, then read on. Now that you have the action name set (remember action="*the name of the proto action*") look at all the [param name=" that are present. Find the one you are trying to change, for me it is the one called [param name="Damage". Go back to your effect and add another quality after "amount" and call it "subtype". Then type the [param name EXACTLY as it appears in proto as subtype="...". For me, the [param name I want to change is called "Damage". So the line "Damage" would become my subtype. My imaginary effect would appear like this now:
[effect type="Data" action="RangedAttack" amount="5.00" subtype="Damage"
Unfortunately, every single [param name="Damage" has a damage type after it. For the Toxote it reads: [param name="Damage" type="Pierce" value1="6.5">[\param> So only if you are editing a unit's damage you need one more tag called "damagetype". for the Toxote, it is peirce damage, so my fictious effect that increases Toxote pierce damage by 5, would so far look like this:
[effect type="Data" action="RangedAttack" amount="5.00" subtype="Damage" damagetype="Pierce"
Only if you are modifying a unit's damage or damage bonus, however, do you need to have the extra tag damagetype="...". If you were changing a [param name (i.e. [param name="Accuracy") then you can ignore the "damagetype" tag I just told you about.
Wheather you are changing an attribute found under a unit's proto action, it's damage, or anything else, you need to read this paragraph. Before you close off the effect you've been creating, you have one more specification to make. And that is the relativity. The relativity tells techtree(x) how apply the number you put in "amount" to attribute you specified.
(Applying what I just said to my Toxote example: without a relativity, techtree(x) wouldn't know how the "5.00" I put in "amount" would affect the "pierce damage" of a Toxote's "RangedAttack". Does it multiply? ... Add?...) Techtree(x) uses four relativities that apply the amount to the attribut in different ways. The four relativities are:
Absolute - Used often. Adds the number found in "amount" to the value of the attribute specified at the time research. This is the relativity I would use so that techtree knew to add the 5.00 to the Toxote's pierce damage.
Assign - Used sparingly. This sets the attribute specified to the value given in "amount" regardless of what is found in proto, or what the value is at the time of research. If I used this relativity, Toxotes would do exactly 5.00 pierce damage upon this imaginary technology's complettion.
BasePercent - Used often. This takes the number in "amount" and looks in the proto to see what the unupgraded value of the attribute specified is, then multiplies. This disregards the value currently in play at the time of the techs research. If I used this relativity my Toxotes would have 5 * 6.5 (their base pierce attack) to give a whopping 32.5 attack per Toxote! If you use an amount of less than one (i.e. 0.80) than your unit will lose a percentage of the base value of the attribute you specified (i.e -20%).
Percent - Used Sparingly. This takes the amount and ignores what is in proto. Looking instead at the value of the attribute you specified is at the time of research, then multiplying. Economic improvements amoung others, do not use this and instead use BasePercent so that they do not compound on each other (like compound interest).
The final step in ending your effect then is to slose of the specifications with a relativity, and then set the targeted proto unit. My Toxote tech's effect would look like this:
[effect type="Data" action="RangedAttack" amount="5.00" subtype="Damage" damagetype="Pierce" relativity="Absolute">
Then I'd be sure all this data is affecting the Toxote so I'd finish the effect to look like:
[effect type="Data" action="RangedAttack" amount="5.00" subtype="Damage" damagetype="Pierce" relativity="Absolute">[target type="ProtoUnit">Toxotes[\target>
(Note that the ProtoUnit is set to "Toxotes" not "Toxote". This is because in proto(x).xml the Toxote unit has its name listed, infact, as "Toxotes". The target ProtoUnit must be spelled EXACTLY as it is in proto(x).xml.)
If I had been trying to modify another attribute about the Toxote that was still found in it's proto action(s), but was not "Damage" then the extra "damagetype" would have been eliminated. Suppose I were trying to give the Toxote an accuracy of 1.00 (100%) then my effect would look like this:
[effect type="Data" action="RangedAttack" amount="1.00" subtype="Accuracy" relativity="Assign"> [target type="ProtoUnit">Toxotes[\target>
Alright, now that we see that, pretend I were trying to modify an attribute of the Toxote that had nothing to do with its proto action(s). Say I intended to halve the Toxote's train points, which is not part of its RangedAttack action, then the tag "action" would be eliminated. And it would look like this:
[effect type="Data" subtype="TrainPoints" amount="0.50" relativity="BasePercent"> [target type="ProtoUnit">Toxotes[\target>
(In proto, "train points" is one word so don't add a space in between the "train" and "points" while setting "TrainPoints" as the subtype. But for some reason you need to capitalize the two words.)
This occur only rarely, but one last tag called "unittype" that must be added to any effect if, and only if:
1.The attribute you want your effect to modify is part of a proto action.
2.If the [param name in question (within the proto action, for example "DamageBonus" and "WorkRate") contains a "type" that the [param name applies to along with a value.
Hopefully this will clarify a little, imagine I wanted to give Jarls a +1 multiplier against myth units. Bonus Damage attacks are controled within a proto action ("HandAttack" in this case) so condition one is met. Bonus Damage is a [param name within the action and is one that contains a "type" (that controls what units will recieve the extra damage) as well as a "value" (which determines what the attack multiplier is) so condition two is met. Here is what the effect would look like, the color codes are for further explanation:
[effect type="Data" [c=orange]action="HandAttack" amount="1.00" subtype="DamageBonus" unittype="MythUnit" relativity="Absolute"> [target type="ProtoUnit">Jarl[\target>
Look at that carefully for a moment. The writing in blue is to show that the effect is something that will change the data, the orange text shows that the change will take place on an action - and the action is called "HandAttack". The green text gives the amount I wanted to be added, the red subtype is showing which [param name will be changed. The bold text is needed to because the [param name="DamageBonus" has an extra quality that states who the bonus damage will be applied to, so the bold unittype must also make it clear who the bonus damage is intended to be directed at. And the purple relativity was discussed earlier, this just makes sure that the 1.00 in "amount" was added to the value that was already present.
I hope you have, but in case you have not understood what I've been telling you about how to create your own data effects, there is always a work-around. Think of an already existing technology with an effect very close to the one you are looking for.
Example situation: You want the mythic age to increase villager gold mining by 10%. You could always open techtree(x).xml and find the tech "Plow" then copy+paste the effect of plow into the tech "Age 4" while changing the unittype="Farm" into unittype="Gold". That will work in most cases, but the drawback here is that you may inadventantly copy an effect that will not work due to some minor error (as in, imagine accidently trying to increase the "HandAttack" of an archer). Also, if you rely solely on copy+paste without understanding how to form the effect yourself, then there are some things (such as increasing a caravans trading rate) that you would never be able to do because there is no near-enough equivalent in another tech for you to copy+paste.
My advice, especially if you are new to this sort of thing, is that if you cannot comprehend how exactly to create your own effects, than don't worry too much for now, if you understand relativites and amounts well enough then you can use the copy+paste+edit method. But as you grow more experianced in techtree(x) editing, study that and try to learn it, you'd be surprised how much more you can do with tech effects when you can decrypt them yourself!
As you should be able to see by now, proto(x) and techtree(x) are very closely connected. The statuses, tags, and abilities that units have because of their proto identities, heavily influence the data that you will need to put in techtree(x). A few more abstract reminders about technology editing:
1. There have been several people who have claimed that the game's data files, such as proto(x) and techtree(x), have a tendancy to "round" or sometimes change the values you put into them, even if you put them in correctly. This is a widely circulated, but false, urban myth. It is always possible that another indirect factor could affect the outcome of a unit or tech's status, but if you program your effect correctly, then the numbers or percentages applied will not spontaneously change themselves. Studying the relativities will help you not to mess up here!
2. A technology cannot modify, in any way, an action on a unit if the action does not already exist in that unit's proto. Try setting a technology that will add 6.00 to regeneration rate of a Mountain Giant. Even if you set the effect correctly, your Mountain Giant will not regenerate. Here's why: You would be adding 6.00 to an action that does not exist, thus doing nothing. You have to edit the Mountain Giant's proto identity and add a regeneration action, like this:
[action name="Regenerate"> [param name="Persistent">[\param> [param name="Rate" type="All" value1="0">[\param> [\action>
You'd have to make the value of the action be "0" if you don't want anything to occur untill you research the tehcnology. In fact, this is the reason why the Titan can regenerate using Hekate's "Mythic Rejuvenation" technology, because ES so carelessly forgot to remove the regeneration action from the Titan. This principle applies not only to regeneration, but to healing, trading, gahtering, attacking, you name it! If you're wondering why I'm telling you this, it's because I want to be sure you won't become frustrated with setting up a perfectly valid technology only to find it doesn't work, the reason may be in the proto.
3. Here are some less-orthodox technology effects to keep in mind should you need them (effects that would be nearly impossible to deduct on one's own):
[effect type="Data" amount="1.00" subtype="Enable" relativity="Absolute"> [target type="ProtoUnit">*will vary*[\target> [\effect>
This effect is important if you ever need to enable a new unit you've created, or change the technology that enables a different unit. Remember that the target type must be your new unit's/the old unit's name spelled EXACTLY as it is in proto(x).xml.
[effect type="SetAge">*Archaic Age, Classical Age, Heroic Age, Mythic Age, Titan Age*[\effect>
This effect occurs only in the age advance techs. Only if you tried to create a new age your self would you ever need to bother with this, so just ignore it.
[effect type="Sound">*will vary*[\effect>
This effect means that the selected sound from Age of Mythology's "Sound" folder will play everytime this technology takes effect. The default click we hear when every technology is completed does NOT need to be specified here; that will occur automatically. I doubt this will be used much, but if you feel you have a neat sound you'd like to play once the tech is researched then be my guest!
To anyone who is new/very poor in their tech editing skills, the I hope you got enough out of this guide to make it worth the hours I spent typing it (seriously, even my fingers are sore now, which almost never happens). Remember, that reason, practice, and careful observation are critical in progressing your technology editing skills. Also, be sure to keep tabs on any changes you make until you've loaded the game and seen that everything works. A few misspellings or spacing errors could give you an "Initialization Failed" message before the game even starts, so be sharp!
If anyone has spotted an error, knows of something I missed, or has any overall comments or constructive criticisms on how to improve this guide, just post a reply and I'll be happy to investigate.
A guide on how to add entirely new technologies coming soon!
WARNING: Content Distribution is Prohibited
Copyright © 2001–2018 HeavenGames LLC. All Rights Reserved. HeavenGames LLC. The graphical images and content enclosed with this document are viewable for private use only. All other rights-including, but not limited to, distribution, duplication, and publish by any means - are retained by HeavenGames LLC. Federal law provides criminal and civil penalties for those found to be in violation. In addition, please read our Disclaimer & Privacy Statement.
AoM Heaven best viewed with a HTML 4.0 / CSS 1.0 compatible browser.