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

Mod Design and Discussion
Moderated by Sebastien, John the Late

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: New Ingame Tech Tree View
posted 04-16-16 04:58 AM CT (US)   


Introduction
This is a new implementation of the ingame tech tree view (F2) completely replacing the old one. It is much easier moddable, as there are absolutely no hardcoded elements. Basically each element only requires its ID, type, age and rendering mode. The positioning is done by the rendering algorithm completely.

The current renderer uses the vanilla tree node positioning, but the whole remaining design is completely customizable, including the change of background graphics, control positions and sizes, age count and much more.

A little warning at this place: The tech tree replacement seems to be pretty stable by now, but anyway there may still be random bugs difficult to spot. If you encounter a crash that was caused by the new tech tree, let me know. It will help if you can give a short description of the steps leading to the crash, as this will make it easier to fix it.

I tested the new tech tree with the UserPatch installed; as far as I know there shouldn't be any incompatibilities.


Download, installation infos and updates
See the blacksmith download page.


How do I patch an existing DAT file with the new tech tree information?
1. Load your DAT in the Editor (and specify some language DLLs).
2. Click "Import" and select the "age2_x1.techtreedata" from the "Editor" folder. This will put the tech tree data into the loaded DAT file.
3. Edit the tech tree data...
4. Save the edited DAT file.



I hope you like it! I'd appreciate any feedback and tips

[This message has been edited by Janworks (edited 09-05-2016 @ 04:14 AM).]

Replies:
posted 04-28-16 04:24 PM CT (US)     1 / 29  
So if my mod already has its own .exe, can I get this new tech tree to load with my mod as well?
posted 05-01-16 09:05 AM CT (US)     2 / 29  
Yes, surely you can!
Just use the installer ("NewTechTree\Install" folder) to patch your modded EXE. It relies on the big alignment area at offset 0x0022819C, so your modifications shouldn't touch this, else there will be conflicts. If you run into problems, let me know

[This message has been edited by Janworks (edited 05-01-2016 @ 09:05 AM).]

posted 06-16-16 07:42 PM CT (US)     3 / 29  
Hi, I only noticed this now. Sounds interesting, downloading now.
posted 06-18-16 00:35 AM CT (US)     4 / 29  
First impressions:

Couldn't install on custom exe - kind of expected. Hopefully I'll find someone who can patch it to load the dll for me.

Tested with UP 1.4 exe from then on.

I really like how units and techs can branch into more than one unit/tech.

However, I'd like it if the units and techs could be above/below another if there's space, so the tech tree doesn't get as wide (compare vanilla archery range tech tree skirmishers/HC below another, or the monastery, to the new one, for example.)

It's cool how things can show requirements from the same building, but I'd like it if there was a way to turn these off. (I.e. so the unit pikeman doesn't necessarily show the pikeman tech - but still other techs it could require.)

The hide if disabled option is amazing! I've been wishing for something like this for so long! (The tech tree of Age of Chivalry can really use this well, at least if you can edit the lack of "stacking" - otherwise, it'd probably explode in width. ) It even works on buildings! (Which are no longer hardcoded, so nice. )

Would it be possible to center buildings based on the units and techs that they have, but not the buildings linked to them? Asking because the blacksmith and the mill look particularly odd now.




Last but not least, a few very important questions: Does the new seperate tech tree data affect any of the actual data, like in terms of availability? I know you made a tech-tree focused editor earlier, that did this, which is why I'm asking.
And does this new data overwrite the old data? Or do they just coexist, and both can be used by the game, depending on whether it has the dll or not?
Also, is there any way for the tech tree to automatically check for availability, or does it have to be defined manually?




Edit: Do you think it would be possible to have technologies be attached to more than 1 immediate predecessor?

For the following situation: Tech A is available to European civs, Tech B to Arabian civs, Tech C to Asian civs, and either enables Techs 1-5. In this given case, they (A-C) would probably have the hidden if unavailable tag, but the following 5 techs would still have to somehow be attached to all three of them.

Similarly for units, if some mod has a choice between 2 units (like Tales of Middle Earth and its archer-line), but both then again upgrade to the same successor... i.e. Unit A is linked to both unit B and C, which then again link to the same unit D (kind of displaying a "Y" in line shape).

Needless to say, I'm pretty hyped. I hope you can "fix" the stacking of units and techs, then I think this would be a great, great addition to any mod that edits the tech tree past a certain extend. I can already imagine Age of Chivalry finally having a fully perfect tech tree instead of the "almost, but not quite" version of mine built with the limitations of vanilla!




Edit 2 & 5: Often, it happens that the tech tree goes largely black and messed up, until I switched the civ. It often goes black again upon opening again, but the buttons stay in the correct place. Seems to be random - pressing F2 and esc a few times after another to repeatedly show the tech tree, it seems that it's random. This only happens in-game.

Also, the scrolling is much slower than in the vanilla tech tree, both when the cursor is moved to the sides and when the arrow buttons are clicked. The only currently bearable way to scroll are the arrow keys on the keyboard.




Edit 3: I'd like to request two features for the Tech Tree Editor.
1) Copy/pasting of nodes and children and 2) Setting paths like in AGE so that you don't have to navigate the folders on every startup.




Edit 4: Also, could you make it so that between each building, there is a little more space? The vanilla tech tree has this, while in yours, the units/techs of different buildings are adjacent.

Oh and I noticed that when I make the trade workshop visible, it is displayed in a different position than it would be in the vanilla tech tree, if allowed to display. In this case, the new position fits better than the old one, but I'm still wondering how this could be, with all the other buildings in the same positions.
Ah, it's based on the order in the data now - I'm stupid. This is very nice.

[This message has been edited by John the Late (edited 06-20-2016 @ 06:39 PM).]

posted 08-27-16 11:04 AM CT (US)     5 / 29  
Hi John,

first thank you for your kind and detailed feedback! I'm sorry that I did not answer for so many weeks, I had to spent the biggest part of my time learning for exams and writing a paper for an university seminar (still not done ).

But anyway I had some spare hours, so I managed to implement most of your wished features

I'll just go through your points and answer each of them.
I'd like it if the units and techs could be above/below another if there's space, so the tech tree doesn't get as wide
Implemented
Was a bit tricky, but now the renderer should put nodes with the same parent building and spare place into the same column. Note that I tried to keep the conditions for pushing together nodes as general and reasonable as possible, so the result may not be as minimal as the vanilla tree.
It's cool how things can show requirements from the same building, but I'd like it if there was a way to turn these off.
You can already achieve this by simply deleting the requirements in the editor. This won't have any influence on the real availability of the respective item, the requirement just won't show up in the tech tree.
Would it be possible to center buildings based on the units and techs that they have, but not the buildings linked to them? Asking because the blacksmith and the mill look particularly odd now.
Yes
Should be fixed now.
Does the new seperate tech tree data affect any of the actual data, like in terms of availability?
No, it doesn't.
And does this new data overwrite the old data? Or do they just coexist, and both can be used by the game, depending on whether it has the dll or not?
I have changed this in the new version I published today; now the old tech tree data persists, so unmodified executables will just show the old tech tree. The new data now is simply appended to the DAT file without any changes to the version number or other parts of the data.
Also, is there any way for the tech tree to automatically check for availability, or does it have to be defined manually?
The renderer checks for "researched" and "not researched", i.e. if the player already managed to research a technology or train/build a unit. Unfortunately, (because of the complicated relations of researches, units and civ bonuses) the theoretical availability of items can't be checked automatically.
Do you think it would be possible to have technologies be attached to more than 1 immediate predecessor?

For the following situation: Tech A is available to European civs, Tech B to Arabian civs, Tech C to Asian civs, and either enables Techs 1-5. In this given case, they (A-C) would probably have the hidden if unavailable tag, but the following 5 techs would still have to somehow be attached to all three of them.
No, that is not possible and would be very complicated to implement. In this case the simplest solution would be to just put techs 1-5 below each one of them.
Often, it happens that the tech tree goes largely black and messed up, until I switched the civ. It often goes black again upon opening again, but the buttons stay in the correct place. Seems to be random - pressing F2 and esc a few times after another to repeatedly show the tech tree, it seems that it's random. This only happens in-game.
Thanks for the detailed bug report! I was able to reproduce and fix this immediately. The bug was the civ selection field not setting the current civ properly.
Also, the scrolling is much slower than in the vanilla tech tree, both when the cursor is moved to the sides and when the arrow buttons are clicked.
As the tech tree design is now completely customizable, you can set these parameters on your own. :P
If you find some good values, I'll gladly put them into the default design file
Copy/pasting of nodes and children
Still a bit buggy, but should work now.
Setting paths like in AGE so that you don't have to navigate the folders on every startup.
Nice idea! Done.
Also, could you make it so that between each building, there is a little more space?
Unfortunately this one is quite difficult. This is because the node selection check is done using a very simple (and fast!) calculation based on the mouse coordinates. This won't work anymore if I put extra space between nodes. I'll see anyway whether I can change this in later versions.

[This message has been edited by Janworks (edited 08-27-2016 @ 11:05 AM).]

posted 08-27-16 07:31 PM CT (US)     6 / 29  
This is amazing news!

Would love to try it out right now but I'm moving tomorrow so I have already disassembled my computer and won't be back on it for a couple of days.
posted 08-28-16 08:22 AM CT (US)     7 / 29  
Hei Jan,
I try the Editor and Load the .dat file.
But I get an error "Error Loading DAT file:Non-negative number required. Parameter name: capacity"
What this mean?

posted 08-28-16 09:48 AM CT (US)     8 / 29  
@John: Good Timing
No hurry, after ten weeks of waiting a few days more or less shouldn't make a difference

@Bala Arizalu: Hmm, that's a strange error, that should not have happened
I understand what the error means, but can't find the exact position in my code, as it can occur in many places. May you send me your DAT file (via Dropbox, or something similar) so I can test it myself? I only need your DAT file, no DRS or DLL resource files.

[This message has been edited by Janworks (edited 08-28-2016 @ 09:49 AM).]

posted 01-24-17 06:44 AM CT (US)     9 / 29  
I've send you email Jan.

[This message has been edited by Bala Arizalu (edited 01-26-2017 @ 06:15 PM).]

posted 01-27-17 01:45 PM CT (US)     10 / 29  
Thank you for the test DAT, I finally managed to track down the error. You seem to use 42 terrains, while all DATs I have edited with this tool just use 41. I built a temporary fix so your DAT can be loaded - I hope that this applies to all 42-terrain DATs, else I'll need to built a proper implementation for all terrain data, and I currently don't have time for that unfortunately.

I'll upload the fixed version in a few hours, after I've solved another issue.


EDIT: File is updated.

[This message has been edited by Janworks (edited 01-27-2017 @ 03:13 PM).]

posted 01-27-17 11:44 PM CT (US)     11 / 29  
Thank you Jan for your information about my DAT.
Is the program can load the custome tech tree, I mean your program is automatically drawn the tech tree line (based on unit, building, technology connection on Advanced Genie Editor), so the User doesn't need to load tech tree data. It will save more time, rather than to draw the tech tree from the original The Conquerors one by one.

[This message has been edited by Bala Arizalu (edited 01-28-2017 @ 02:23 AM).]

posted 01-29-17 05:13 PM CT (US)     12 / 29  
The ZIP archive from the blacksmith contains a pre-built *.techtreedata file, containing the original The Conquerors tech tree. You can use it as a start, so you don't have to build the whole tech tree from scratch.

To answer your question in the email you sent me: Yes, you can add as many new buildings as you want, the new tech tree format has nearly no limitations

[This message has been edited by Janworks (edited 01-29-2017 @ 05:14 PM).]

posted 02-19-17 05:40 AM CT (US)     13 / 29  
Hey Jan
Do you get my replied via email?
And Jan, how to make the Bombard Cannon located under the Keep Tower, like original version?

posted 02-19-17 07:24 AM CT (US)     14 / 29  
Hi Bala Arizalu,

yes, I've received your mail. I hadn't yet time for further research of your bug (learning for an exam next tuesday...), but it is on my todo list

To your question about the positioning of the bombard tower: As the tower is a "parent" element, it is always placed next to another parent element. As I wanted to keep the rendering algorithm as universal and simple as possible, I had to make a few assumptions about how parent elements are placed. If I changed this behaviour, suddenly *all* parent elements would get merged as much as possible, leading to rather strange results. Maybe I will add a switch for that in the future; but currently the rendering algorithm is working very well, and I don't want to mess with it again
posted 02-19-17 07:39 AM CT (US)     15 / 29  
Thanks Jan for your answer. Good luck for your exam

posted 02-19-17 01:43 PM CT (US)     16 / 29  
I understood that this utility can be used as standalone file, outside the game database (DAT). What is the purpose of injecting the data into DAT file? Both install and inject methods seem to utilize customized game executable.

Advanced Genie Editor
Follow coding here and here.

[This message has been edited by Keisari Tapsa (edited 02-19-2017 @ 01:47 PM).]

posted 03-06-17 08:26 AM CT (US)     17 / 29  
@Keisari Tapsa:
Yes, the installer injects some code into the EXE file to load a DLL containing the new tech tree renderer.

I have had many reasons to put the data into the DAT file instead of a standalone file, but the two most important ones are:

1. Locality of related data:
As the tree data directly depends on unit and research IDs (and some other data), it sounded just logical to put it next to that data such that one never forgets to update the tree data when doing any changes.

2. Simplicity of implementation:
I had to write quite complicated injection routines to make sure that the tree renderer code is called in all the right places - and the simplest way to achieve that was hooking into the DAT loading code, which already gives me a handle to the uncompressed data stream. This way I hadn't to design additional file loading code, which probably would have introduced a lot of extra problems.

The new tree data is just appended to the DAT file without any further changes. It starts with a 4-byte version marker (currently "NTT1" for "New Tech Tree Version 1") and is then followed by the tree data.

The simplest way to handle that would probably be to just copy the remaining bytes of a parsed DAT file into a buffer and then append it again when saving. Or do you have a better idea? It would be great (and really convenient) if AGE kept the tree data while editing a DAT file


@Bala Arizalu:
I've sent you an e-mail

[This message has been edited by Janworks (edited 03-06-2017 @ 08:34 AM).]

posted 03-07-17 00:02 AM CT (US)     18 / 29  
Contained in DAT made users need to import trees every time after editing in AGE.
posted 03-07-17 08:25 AM CT (US)     19 / 29  
I've sent you an e-mail

Thanks Jan, now I can change civilization at Tech Tree without crash.
And sorry Jan I've sent you wrong email, ignore it.

posted 04-07-17 05:49 AM CT (US)     20 / 29  
Hai Jan.
I want to report a problem. So I've edited an unit with ID 942 (only change the Collison size using Advanced Genie Editor) and then save it.
After that I open The Tech Tree Editor, load the dat, but it can't.
I try to load the previous dat file it can be opened normally.
Please can you check this problem?
And can you add "Search" feature in the editor?

posted 04-07-17 08:03 AM CT (US)     21 / 29  
As explained above, this problem is caused by AGE, that simply discards all additional data on saving. The current solution is:

1. Save tech tree data into *.techtreedata file,
2. Do editing in AGE,
3. Open the tech tree tool again and load the previously saved *.techtreedata file.


What kind of search function do you mean?
posted 04-09-17 03:01 AM CT (US)     22 / 29  
What kind of search function do you mean?
I mean with the "search" or "find" is when I type the word "Stronghold" it will automatically lead to the Unit / Building / Technology named "Stronghold" by the string table of .dll. Yes briefly similar to the search function on the Advanced Genie Editor.

And for the error issue, I've sent you an e-mail Jan.

posted 04-11-17 06:47 AM CT (US)     23 / 29  
I've uploaded a new release to the blacksmith. This should fix your problem, although it doesn't change the issue with AGE removing the whole tree data.

Thanks for your proposal regarding a search function. I'll have a look into it
posted 04-16-17 07:51 AM CT (US)     24 / 29  
Hey Jan, Thank you for approve my request.
Just little bug report, the button "Import Design Data" is doesn't work.
I realized when your software was able to add new nodes background, it's wonderful. A bit of advice, it would be nice if the background information of the node can be customized. For more details, I will send you an email.

posted 08-15-17 11:05 AM CT (US)     25 / 29  
Hi, I finally found time to implement the customizable legend entries you proposed in your e-mail. You can find the new version 1.2.2 in the blacksmith as usual
posted 08-15-17 01:37 PM CT (US)     26 / 29  
I haven't had chance to check this out properly yet, but essentially it's like a custom tech tree extension, where by you can put icons wherever you like and do whatever you like, but it only uses the data as a base for initial information. Then we can use this, which replaces/overrides the original tech tree in game?

[This message has been edited by Tatsuo (edited 08-15-2017 @ 01:38 PM).]

posted 08-16-17 07:32 AM CT (US)     27 / 29  
Wow Fantastic Jan,
Just little bug:
1. The value of members 0,1,2,3,"Node type label rectangle" can't be save when the "Edit design data" window is closed.
2. When add member "4" at "Node type label rectangle", it will make the member "3" and "4" disappear from the list.

Thanks for your hard work.

posted 08-17-17 08:29 AM CT (US)     28 / 29  
@Bala Arizalu:
1) Thank you for the report, I fixed it. See version 1.2.3 in the blacksmith
2) I cannot reproduce this behaviour, but maybe it is fixed in 1.2.3 anyway?

This release also finally adds support for DAT files with a modified terrain section. Thanks to TriRem for the bug report and test data!

@Tatsuo:
Yes, this overrides the whole ingame tech tree with an own implementation, while keeping the same look and feel. The old tech tree section in the DAT isn't touched (for compatibility to AGE), but ignored completely. Instead the editor tool appends the new tech tree data to the end of the DAT file, where it causes no harm to other tools or unmodded game versions. The new data format is much simpler and allows nearly arbitrary trees, as I tried to make as little assumptions on the tree structure as possible.

[This message has been edited by Janworks (edited 08-17-2017 @ 08:37 AM).]

posted 04-24-18 09:20 AM CT (US)     29 / 29  
Hi Jan
Could you add custome civilization description ID on the future updates?

Age of Kings Heaven » Forums » Mod Design and Discussion » New Ingame Tech Tree View
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames