You must be logged in to post messages.
Please login or register

The University
Moderated by Popeychops, Leif Ericson

Hop to:    
Welcome! You are not logged in. Please Login or Register.33 replies
Age of Kings Heaven » Forums » The University » Adding Units and Researches to the ingame Tech Tree (Approved)
Bottom
Topic Subject:Adding Units and Researches to the ingame Tech Tree (Approved)
Vardamir
Huskarl
posted 01-19-16 07:56 PM CT (US)         
This article has been approved and can also be read at the University. - Leif Ericson

For quite some time, ingame Tech trees were believed to be an uneditable, hardcoded part of the game. While they do have several hardcoded behaviors, adding units and researches is a fairly straightforward process, though completely different then adding them to the game itself.

You'll need Advanced Genie Editor and a unit or research to add. There are four subtabs in AGE's Tech Tree tab. You'll need to access three of them in order for changes to work. To begin, select the Tech Tree tab, where the Age subtab should be open. Find the appropriate Age (green), add new item (red), then change the ID to match the unit or research ID (blue).

Age Tab


Buildings work almost exactly the same way:

Building Tab


Additionally, the ordering in these list sets the left-to-right priority for units and researches. When multiple items are in a building, the lower IDs will appear on the left side. This is only within the same list: all units will be farther to the left than any research.


Unit are more complicated, and work a little differently depending on if they are the first/only unit in their line (Villagers, nonelite Huskarls, Battering Rams) or are an upgrade. In either case, the first step is switching to the Unit subtab and adding a new unit (red). As with most edits in AGE, it is highly recommended to copy a similar existing entry rather then create new one from scratch. Once that's done match the new entry's ID to the unit you want (blue). Note that this is the ID in the Main unit tab, not the ID in the list you see here. Also set the Upper Building, (where it is trained) shown in green. Again the ID in the unit list, not in the building subtab. Finally, make sure the age is set properly, (orange) to 1 for a Dark Age unit, 2 for a unit first available in Feudal, 3 for Castle age, and 4 for Imperial Age.



For a unit that is not an upgrade, set the Enabling Research (green) to the research that enables the unit. Leave it as -1 if the unit is availiable without research, like the militia. If it has upgrades, go to the Connected units section, (blue) and add the unit you want to appear directly below it. Further upgrades are not required, hence no paladin here:



For an upgraded unit, Set the Required Research (blue) to the relevant unit upgrade. Alter a slot in Connected items (green) to the preceding unit in the chain. Set the second box (red) to the preceding unit ID and the first (orange) to 2, which represents units rather Ages, buildings, or researches. Finally, set the Connected Units to the next unit in the chain if it exists. If it doesn't, don't put any entries in Connected Units at all.



For researches, add a new research and copy a similar one to it. Set the Research number (green) to the research ID, the Upper building (blue) to the building where the tech is researched, Age and prerequisite upgrades in Connected Items, (black) and subsequent researches in Connected Researches (orange).



Be sure to edit all connected entries for each change you make. Generally, the object just won't show up if you forget one, but some missing changes can cause the game to crash when you view the tech tree. I spent a lot of time learning this the hard way when I added a second upgrade to the Scorpion without adding a Connecting unit to the Heavy Scorpion.


Finally, there a few important limitations to keep in mind when editing the Tech Tree:

·Unique units and techs that appear in the tree for only one civ can only be added to the castle. Otherwise, they will be appear for all civs. To activate this behavior, use researches that are civ specific for the Research ID, Enabling Research, or Required Research.
·You cannot add new buildings without exe editing
·The Dock and Monastery have a hardcoded connection number: If you add new units or techs, older ones will vanish, and if you take any away, lines that go nowhere in particular will appear.
·Units must have no more than one enabling technology to appear correctly. More complicated setups, as in Age of Chivalry, must be accomplished with duplicate units.
·The red X is placed on items disabled by the Technology tree of a civ. Disabling tems with another tech will not cause it to appear.

AoK: Realms
Adds Armenians, Balts, Bamars, Bohemians, Bulgars, Burgundians, Chimus, Dutch, Helvetians, Jurchens, Khmers, Malays, Mandinkas, Moors, Muisca, Tamils, Tufans, Turcomans, and Viets

Genie Converter - an AKX installer for modern times

[This message has been edited by Vardamir (edited 08-08-2017 @ 12:30 PM).]

AuthorReplies:
danielpereira
Squire
posted 01-19-16 09:32 PM CT (US)     1 / 33       
Nice work you have done Vardamir! It was about time for someone to do an article like this one! I hope this helps many new modders!

The Portuguese Civ Mod III - Download at the Blacksmith
A mod that adds new civilizations, a new age, a new resource and introduces new gameplay features!
2nd place as Best Mod Pack in AoKH GOTY 2013 (PCM I) | 1st place as Best Mod Pack in AoKH GOTY 2015 (PCM II) | 2nd place as Best Mod Pack in AoKH GOTY 2017 (PCM III)


"And he that sat upon the throne said, Behold, I make all things new. And he said unto me, Write: for these words are true and faithful." - Revelation 21:5 (KJV)
Keisari Tapsa
Smith
posted 01-20-16 03:09 PM CT (US)     2 / 33       
Nice guide

Advanced Genie Editor
Follow coding here and here.
TriRem
Huskarl
posted 01-20-16 04:05 PM CT (US)     3 / 33       
Great article Vardamir ! Much needed too, it will definitely be useful to many modders (starting with me ).

It's nice to see articles like that being created recently, we now pretty much have a complete AGE guide that covers all the basic aspects of data editing.

Fluctuat nec mergitur.
rageofempires
Squire
posted 01-20-16 08:59 PM CT (US)     4 / 33       
Vardamir, I love you so much. #VardamirForPresident2020

Hey I'm back
MrMew
Huskarl
posted 01-24-16 00:58 AM CT (US)     5 / 33       


What on Earth have I done here?

I tried adding a building to the tree, and three units. One of which to the Town Centre.

Time of Tea
Still in the Dark Age
Don't be a melodramatic clown. ~Mr Wednesday
Vardamir
Huskarl
posted 01-24-16 08:32 AM CT (US)     6 / 33       
The lines to nowhere? That happens when a building has more connections than connected items. Are your new units showing up? You can't add new buildings without hex edits, though.

AoK: Realms
Adds Armenians, Balts, Bamars, Bohemians, Bulgars, Burgundians, Chimus, Dutch, Helvetians, Jurchens, Khmers, Malays, Mandinkas, Moors, Muisca, Tamils, Tufans, Turcomans, and Viets

Genie Converter - an AKX installer for modern times
John the Late
Knight
posted 01-26-16 02:21 AM CT (US)     7 / 33       
I meant to write a guide for this for over 2 years but never got to it. :/

Good work!
Knaber
Squire
posted 01-26-16 07:34 AM CT (US)     8 / 33       
You cannot add new buildings without exe editing
Darn, that explains why it doesnt work... ;-;
And exe editing is pretty complicated, right?

[This message has been edited by Knaber (edited 01-26-2016 @ 07:41 AM).]

Vardamir
Huskarl
posted 01-26-16 01:12 PM CT (US)     9 / 33       
It's certainly up there. If you only want to add one, there is a Sea Gate enabled for use on the tech tree but not actually used.

AoK: Realms
Adds Armenians, Balts, Bamars, Bohemians, Bulgars, Burgundians, Chimus, Dutch, Helvetians, Jurchens, Khmers, Malays, Mandinkas, Moors, Muisca, Tamils, Tufans, Turcomans, and Viets

Genie Converter - an AKX installer for modern times
gag2000
Squire
posted 01-26-16 09:32 PM CT (US)     10 / 33       
does the sea gate also works on cd version ? iirc i was just able to add the sea gate icon into the age 2 hd version, because they included it for the forgotten.

edit: ok tried it out and it works, good to know seems they planed to include palisade gates into the game, strange why they didnt do it.

[This message has been edited by gag2000 (edited 01-26-2016 @ 09:38 PM).]

NEHT
Squire
posted 07-07-16 05:10 PM CT (US)     11 / 33       
I enabled Slingers and Imperial Camels to all civs (by giving any civilization as requirement in their techs)(in part of my personal noob/cheat/unbalancing full-tech mod*), they are buildable but do not show in tech tree. I also added new level of Handcart and Blacksmith's upgrades, they also are researchable and working, and also do not appear in the tech tree. I added all of these in tech tree in AGE editor as shown in this thread.

The case of Slingers and Imperial Camels causes me to thing that tech trees could be after all hard-coded.

I play on AoE2:HD with both expansions and use AGE 2016.3.13.

What extactly does "Total units and techs by age" and "Total units and techs at first by age"? Maybe there problem lies, but i changed this for blacksmith with no effect.

EDIT: I've done with my new researches, but not with units.

*Aside note: I also add some pretty unbalancing additions to some team bonuses and buff Huskarl and Japanese. I also moved Huskarl and Slinger recruit icons to not block Eagle Warriors in Barracks and Hand Cannoners in Archery Range.

[This message has been edited by NEHT (edited 07-07-2016 @ 05:51 PM).]

Vardamir
Huskarl
posted 07-07-16 06:30 PM CT (US)     12 / 33       
What extactly does "Total units and techs by age" and "Total units and techs at first by age"?
I'm not sure if this does anything, actually.

I haven't done any tech tree work on the HD edition, but I would assume it's the same or a similar issue as Missionaries and unique ships in the base game. The Monastery and Dock have a hardcoded number of connections, with the higher number for Spanish/Vikings/Koreans... hardcoded for that particular civ.

AoK: Realms
Adds Armenians, Balts, Bamars, Bohemians, Bulgars, Burgundians, Chimus, Dutch, Helvetians, Jurchens, Khmers, Malays, Mandinkas, Moors, Muisca, Tamils, Tufans, Turcomans, and Viets

Genie Converter - an AKX installer for modern times
Achesun
Squire
posted 11-20-16 11:00 PM CT (US)     13 / 33       
I tried to move the hand cannoneer to the siege workshop by changing the "Upper Building" to siege workshop, but in the tech tree it still appears in the Archery Range. Is there anything else I need to do?
Vardamir
Huskarl
posted 11-21-16 07:41 AM CT (US)     14 / 33       
You'll also need to add the hand cannoneer to the list of units available at the siege workshop and remove it from the Archery Ranges' list.

AoK: Realms
Adds Armenians, Balts, Bamars, Bohemians, Bulgars, Burgundians, Chimus, Dutch, Helvetians, Jurchens, Khmers, Malays, Mandinkas, Moors, Muisca, Tamils, Tufans, Turcomans, and Viets

Genie Converter - an AKX installer for modern times
Achesun
Squire
posted 11-22-16 08:35 PM CT (US)     15 / 33       
Thanks, Vardamir! It's working!
Tocaraca
Squire
posted 02-19-17 06:50 PM CT (US)     16 / 33       
The Monastery and Dock have a hardcoded number of connections, with the higher number for Spanish/Vikings/Koreans... hardcoded for that particular civ.
Is this the same thing for the Goths with Anarchy? Because if it wasn't the case then Anarchy would be shown on everyone else's tech trees as well because there's nothing else filling that slot for that civ.
Also, I can get a unique tech to show up on the tech tree, however when I hover over it, just a blank white box appears. How do I fix this?
Never mind, I fixed this by matching up the Help Converter by +21000 of the Language File Name in the language.dll.

[This message has been edited by Tocaraca (edited 02-19-2017 @ 07:57 PM).]

Jineapple
Squire
posted 02-22-17 11:23 AM CT (US)     17 / 33       
Is there any way to change in which vertical line a unit appears? There is such a value in the genie editor, but changing it doesn't seem to do anything. It seems pretty arbitrary where they are placed (and which units/techs are connected with a line while others are place underneath a different unit/tech)

Example:



As you can see, the Caravels obscure the Shipwright tech, while Fire Ship and Fire Galley are in different lines. Any way to change the order of things around here?
Vardamir
Huskarl
posted 02-22-17 10:17 PM CT (US)     18 / 33       
The arrangement is affected by the ordering the of the Connected Unit list for the dock.

Caravels obscuring shipwright is a different issue, though. The Dock and Monastery have a hardcoded number of connections. If you add new units or techs, older ones will vanish, and if you take any away, lines that go nowhere in particular will appear.

AoK: Realms
Adds Armenians, Balts, Bamars, Bohemians, Bulgars, Burgundians, Chimus, Dutch, Helvetians, Jurchens, Khmers, Malays, Mandinkas, Moors, Muisca, Tamils, Tufans, Turcomans, and Viets

Genie Converter - an AKX installer for modern times
Jineapple
Squire
posted 02-23-17 10:29 AM CT (US)     19 / 33       
It seems that for the dock there's more hardcoded than just the number of connections. Editing the order of units/techs in the list didn't work in this case, though it does work in other instances. I've been able to fix the fire galley problem by switching the IDs of fire galley and fire Ship in the Data File completely.
I've also moved the Caravel to the Castle - not entirely accurate but at least this way it only shows up for the Portugese and doesn't obscure shipwright. Thanks for the guide and the help!
John the Late
Knight
posted 02-23-17 10:51 AM CT (US)     20 / 33       
Take care, it might block out something different at the castle then, since that building has a hardcoded amount (7) of lines, too. Might be better at the dock despite shipwright, since the Portuguese don't get that tech anyway.
Jineapple
Squire
posted 02-23-17 05:12 PM CT (US)     21 / 33       
Indeed, but placed in the dock it appears for all civilizations, not just portuguese.

This way, for portuguese, it obstructs spies but I think that's not too bad.

[This message has been edited by Jineapple (edited 02-24-2017 @ 03:08 AM).]

Vardamir
Huskarl
posted 02-23-17 06:31 PM CT (US)     22 / 33       
Putting them at the castle's a pretty good idea. If you sill want spies to show up, you can not show the elite version.

Alternatively, it just clicked that the number of connections only matters at the age with the most of them. If you lie and put the elite upgrade in the Castle Age, everything can fit:


AoK: Realms
Adds Armenians, Balts, Bamars, Bohemians, Bulgars, Burgundians, Chimus, Dutch, Helvetians, Jurchens, Khmers, Malays, Mandinkas, Moors, Muisca, Tamils, Tufans, Turcomans, and Viets

Genie Converter - an AKX installer for modern times
Bala Arizalu
Squire
posted 02-24-17 08:20 PM CT (US)     23 / 33       


Hi Jan, I recommend you to use Tech Tree View Editor to edit the tech tree.
Or you can relocate the Fire and Demolition Ship ID, and then edit some hex at EXE.

Leif Ericson
Seraph Emeritus
posted 02-25-17 10:08 AM CT (US)     24 / 33       
Just adding an obligatory warning that such edited .exe files cannot be released directly at AoKH. However, having an installer for the mod that adds modifications to a preexisting .exe like Userpatch does is fine.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
withmorten
Squire
posted 05-03-17 11:32 AM CT (US)     25 / 33       
Yeah, uh, userpatch has the full, decrypted age2_x1.exe inside its SetupAOC.exe ... it's stored in the database section and is the same 2.6MB the AoC binary is.

While it is checking for an existing age2_x1.exe, it's not using the preexisting exe, that would be a nightmare when updating an existing userpatch installation.

It is also nocd patching it, otherwise it would ask for a CD when you click on SinglePlayer. The function checking for the CD is modified compared to the untouched binary, and probably only returns 1.

Just wanted to clear that up. It's been bugging me for a while that people don't really know how UP installs.

Some more info on hardcoded stuff, anyway, the game has hardcoded checks to hide the Trebuchet (Packed) unit from the Castle, the Missionary from every Monastery except the Spanish, the (Elite Longboat) from every Dock but the Vikings and the (Elite) Turtleship from every Dock but the Koreans.

For this reason the Slinger shows up in everyone's techtree on Forgotten 2.2

I hacked around a bit by injecting into the game using a ddraw.dll hack, jumping to that specific part, adding an extra check for the Slingers, and while the Slingers are now hidden the lines are completely messed up and the space is still there.

In that same function for the techtree the Dock and Monastery also get built completely hardcoded, probably because of the unique units there ... haven't been able to quite understand what's happening there.

See here:

http://screenshotcomparison.com/comparison/208710

[This message has been edited by withmorten (edited 05-03-2017 @ 03:19 PM).]

Leif Ericson
Seraph Emeritus
posted 05-03-17 11:01 PM CT (US)     26 / 33       
Ah, thanks for clearing the Userpatch stuff up. I'm probably the main person mistakenly spreading that information.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
withmorten
Squire
posted 05-03-17 11:14 PM CT (US)     27 / 33       
To be fair, I wasn't completely sure until today either, I just decided to finally check and confirm my suspicions after finding this topic while googling for techtree stuff.

[This message has been edited by withmorten (edited 05-03-2017 @ 11:17 PM).]

karacazade
Squire
posted 12-18-17 12:15 PM CT (US)     28 / 33       
İs edit Aokhd tech tree possible?
Jineapple
Squire
posted 12-22-17 01:02 PM CT (US)     29 / 33       
It's the same system as the aoc tech tree, so yes.
hiwatari117
Squire
posted 09-16-18 07:41 AM CT (US)     30 / 33       
hi, really new to modding so its all a bit confusing. Im a scenario creator and im currently needing to make one civ have all techs even when not using full tech tree.

how will I go about doing this? also, will it break my game if I attempt this?

really appreciate if anyone can help me out with this, along with how to get that onto the live game.
Leif Ericson
Seraph Emeritus
posted 09-16-18 09:45 AM CT (US)     31 / 33       
I would recommend installing Userpatch. Among many improvements, it makes many triggers more useful. My understanding is that you can enable any techs you want for any single player. To do this, make a Research Technology trigger, select the player number, select the technology, and set the Number field to 1.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
hiwatari117
Squire
posted 09-16-18 03:09 PM CT (US)     32 / 33       
what is userpatch? So if I download that I can just use the ingame scenario editor triggers to research techs that are normally not available for a specific civ?
Leif Ericson
Seraph Emeritus
posted 09-18-18 11:28 PM CT (US)     33 / 33       
Userpatch is a huge community patch to the game. It has numerous multiplayer improvements, scenario design improvements, and AI improvements. One of the improvements does what you're looking for. However, there are some extra steps.

First, create a Research Technology effect for the tech and player and set the Number box on the right side to 5 (not 1 like I said earlier). This enables the tech for the player. Then create another Research Technology effect for the same tech and player and leave the Number box at 0. This will actually research the enabled tech. Let me know if it works for you.

Anyone playing your scenario will have to install Userpatch for the scenario to work for them, but it's really worth the install.

Also, Userpatch doesn't work on the Steam version.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Kings Heaven | HeavenGames