Reordering Techs?

Hello, let's say I have tech N and tech L, both of which have tech A as a required tech.

It might show up in the Technology Tree as:

A - N

  \ L

 

How can I reverse the order so they show up as:

A - L

  \ N

 

I've eliminated the following possibilities:

* Order within the race-specific Tech Tree XML file (I haven't tried changing the order in the default Tech Tree XML file, but I wouldn't expect this to matter since I'm unable to change the order even if L and N were both race-specific techs)

* Alphabetical order

* Branch Name (Propulsion, Weapons, Industry, etc)

* Category (Miniturization, Missles, Starbase, Government, etc)

* Research Cost

* AI Value

* Civ trade weight

 

???

 

Thanks!

<edit for formatting>

28,601 views 54 replies
Reply #1 Top
I think the techs are sorted by tech ID and prerequisites.

I don't know of any way of how to control how the techs shows up in game. I don't think it has been a concern for the devs. If you research 'Xeno Ethics' and pick good, you will see several bonus defense techs show up causing the defense techs to get twisted and warped. Point defense continues to be strait, but both armour and shields drop down to go around their bonus techs. Suffice to say, its a mess.

It might be worth the trouble to talk to the devs about giving us modders a way to control how the tech tree sorts itself, and how it looks.

But ask them in a month's time. As I understand, they are very busy right now (dealing with the TA release), so don't bother pestering them for now.
Reply #2 Top
I was able to examine this issue yesterday afternoon and you're probably right; the tree develops its structure at merely random pace.

The only common situation is that it remains the same from game to game; thus, an underneath procedure which dictates how the framework is setting up all these boxes.
Unless i can get my hands on the source, there's no way to determine the exact conditional routines.

I think this may well have everything to do with the incode_hidden ID numbering schema though... which i asked for a few days ago without any luck, it seem.
Take a look at a sandbox finished_game report file; the tech-section has all these numbers listed there in all their mysterious format.
And since, the Tree --must-- have a grid with GDI coordinates on it, the research screen ---must--- also tap some referencing schema from that unknown matrix.

It's certainly simple and yet complex enough to be much more than a top-bottom-left-to-right type of distribution.
Reply #3 Top
I'll try it out with 2 sample Techs for my custom techtree...
simply by assigning prefixes to the tech_id...
My guess, its a alphabetical base sorting algorithm...eg...

req.tech_id -- A_techx (or 1_techx)
|---------------B_techy (or 2_techy)


It might solve the problem, as I also wish to precisely "place" the techs
Reply #4 Top
Nothing better than an image to illustrate a theory or prove some detailed comments about this issue... so;



This excerpt from the upcoming update to the pending X-Worlds' tree is relatively direct about many things;

The alpha parsing method isn't really obvious in the actual snapshot for a number of reasons or hints...

1) The IDs are *XWw#...* and aren't lined up by any alphabetic processing.

2) Similarly, Elerium-115 & Alloys *names* do not adhere to any top-down schema.

3) The older default techs locations are re-organized according to the newest connections, so to speak.

And, so the mystery goes on! ;)
Reply #5 Top
According to your screenshot, you misunderstood my point...
the techs all BEGINN with "X" so my theoty is, a sorting by first letter--maybe, as I'm creating InvTactics at the moment, I'll try that later.
Reply #6 Top
The Catagory-Tag might also be involved.
Reply #7 Top
Hmm...

ID="XWw1_GroundTac" -- 14 chars long
ID="XWw4_AquaStra" -- 13 chars long

ID="XWw3_Elerium" -- 12 chars long
ID="XWw2_Alloys" -- 11 chars long

ID="XWw5_AquaPlastics" -- 18 chars long
ID="XWw6_Zrbite" -- 11 chars long

And, so the mystery goes on!
End of quote


Are you sure? It looks like the length of the tech ID appears to be deciding factor. The longest seems to go on top.

I'm not sure if I should be surprised I noticed this pattern.
Reply #8 Top
I'm not convinced, the ordering is by string length. It would narrow the choises of tech_id string--shortest first.
Has anybody tried, if reordering the technodes in the xml affects the display?
Reply #9 Top
What about Leinght of the requirement. More items are top?
Reply #10 Top
I did a test, and it sorted the techs I made in this order:

Longest -- 7 chars
Shorter -- 7 chars (I guess not shorter after all)
Short -- 5 chars
1
2
3
A
B
C
--__
----

Since the last 2 entries were pushed to the bottom despite being longer, I guess that longest to top isn't a perfect solution. Despite the flaw, its still possible to predict how, and arrange the tech tree using "Longest first" as a guide line.

Sorting alphabetically and other stuff can be the next deciding factor afterwards.
Reply #11 Top
I'm not convinced, the ordering is by string length. It would narrow the choises of tech_id string--shortest first.
End of quote


Why shortest TechID string first? Longest works just as well.

Has anybody tried, if reordering the technodes in the xml affects the display?
End of quote


The OP already mentioned that it didn't seem to work.

I too tried such a thing myself, and it had no effect. I was using a completely custom tech tree (I wrote everything) at the time.

What about Leinght of the requirement. More items are top?
End of quote


All techs that have a prerequisite tech will show up after the prerequisite tech (further right) in the tech tree. Its how the tech tree is ordered in the first place. Those with don't require a tech known to research are the entries found furthest left.
Reply #12 Top


See what I mean ^^ , since ordering alphabetically is the simplest solution in Visual Studio :P
Reply #13 Top
@ MrKorx

I don't know if you are agreeing with me, or argueing against me right now. I see 2 techs of that appear to have the same TechID string length (can't be sure since the display name and TechID can be different), and as such they sort between each other using a different method, alphabetically.

Any ways, I think I've found a few anomolies in my theory. Since I'm currently interested figuring out how the tech tree sorts itself, I'll be checking them out. I'll post back with my results.

Let me know if you notice any patterns in the sorting.
Reply #14 Top
Arrrrggghhh - this whole analysis is really getting me a bit frustrated.

In theory, we could run a huge amount of tests to determine the exact solution to the OP's problem... and yet, somehow realize the entire concept is simply located in a SD-coder brain just about ready to be revealed -- IF, they could solve that mystery for us in flat seconds sharp.

At first, i thought this was gonna be a smooth ride in investigation paradise.
Not so, it seem.

Now, the question is which genius if any will hit this thread first with THE key to unlock us all from an infinite loop starting with A followed by a B-Minus, ID'ed & all what that really implicates! ;)
Reply #15 Top
Hold it, ASCII strings do have a numeric reference, do they?
Parsable and all... Conditional to a path origin. Delimited by two things;

- Singular instance of Requirement.
- Definition by IDs, Categories, Alpha-numeric or not.
Reply #16 Top
@DivineWrath

No, I'm not argueing against you, peace ;) It got late last night... and if I was a GC2 Dev, I would at least be critical, concerning a by length algorithm.
Its maybe both?
I just suspect the techtree doing some things by alphabetically ordering, connected with the tech_id, techrequirement and maybe category.
Since DL came out, I always wondered, whats the thingy with the Xeno techs. They might got named, because of the beginning "X"?
My theory....

root
|
level A --> alphabetically sorted branches --> branch 1 ...
|
level B --> alphabetically sorted branches --> branch 2 ...
|
level C --> alphabetically sorted branches --> branch 3 ...
|

But level A-Z get also alphabetically sorted by some criteria, I'll test after work tonight.

Its difficult to display with ascii, but you might understand what I mean...

Reply #17 Top
I Figure it out.

You have to have orederd in xml.
Code: xml
  1. <Weapons ID="OneRoot">
  2. <DisplayName>OneRoot</DisplayName>
  3. <Cost>800</Cost>
  4. <Description>OneRoot Node</Description>
  5. <Details>Haha</Details>
  6. <Category>Beam</Category>
  7. <Requires>None</Requires>
  8. <Model>bistront0</Model>
  9. <AIValue>1</AIValue>
  10. </Weapons>
  11. <Weapons ID="Child2">
  12. <DisplayName>Child 2</DisplayName>
  13. <Cost>800</Cost>
  14. <Description>OneRoot Node</Description>
  15. <Details>Haha</Details>
  16. <Category>Beam</Category>
  17. <Requires>OneRoot</Requires>
  18. <Model>bistront0</Model>
  19. <AIValue>1</AIValue>
  20. </Weapons>
  21. <Weapons ID="Child1">
  22. <DisplayName>Child1 1</DisplayName>
  23. <Cost>800</Cost>
  24. <Description>OneRoot Node</Description>
  25. <Details>Haha</Details>
  26. <Category>Beam</Category>
  27. <Requires>OneRoot</Requires>
  28. <Model>bistront0</Model>
  29. <AIValue>1</AIValue>
  30. </Weapons>

If you Switch Child1 and Child2, you will also switch ingame

Edit: Formating
Reply #18 Top
If you Switch Child1 and Child2, you will also switch ingame...
End of quote


Well, not really.
Cuz, Elerium-115 and Alloys would actually show up in reverse order since 'XWw2..' is ABOVE 'XWw3..' in the xml file!
:)

Reply #19 Top
One thing I noticed, tech_id whitespaces definately "break" somehow the sorting, a given tech suddenly places itself at a different location ingame.
Reply #20 Top
First script:


And First Screen:


After fliping order in xml (Node flip)
Script:



And Flipped ingame screen:



And if You use Twilight of the armor, Make sure the order in Data\English\TechTrees. Each civilization has its own Tree.
Reply #21 Top
Unfortunately, this does not work for more complex trees :(
I tried it with my big unique tree.
There must be somthing else...
Reply #22 Top
Are you using Twilight Of The Armor?
Reply #23 Top
Yes ;)

click

I have been trying to switch "Fusion Pulse Drive" and "Interstellar Expansion", no success yet...
Reply #24 Top
Now i realy got it. You can't make that ored.

Root-FirstOrder-5 Childes
-SecondOrder-3 Chileds


As abouve diagram, any item will bi top as long it has more childs than the lower one.