Posted: Fri Dec 09, 2005 12:21 pm Post subject:
An explanation of how buildings are listed in the build menu
Quick and easy one this.
Buildings are listed from top to bottom in order of their tech-level, so tech-level 1 structures appear at the top, whislt tech-level 10 ones appear at the bottom and everything else appears inbetween.
However, buildings are also split-up within their tech-level groups using the tag;
Code:
BuildCat=
The tag can be used to determine the order with which buildings are displayed in the menubar within their tech groups, it has no other effect.
Buildings will be displayed in the following order;
BuildCat=Tech
BuildCat=Power
BuildCat=Resource
So, if you have a lot of buildings of the same tech-level you can at least get some sort of order using the correct buildcat. There is also BuildCat=combat and that will put the building in the base defence and superweapon tab.
I am pretty sure that this info is correct, because I am using the techlevel + AIBaseSide sort myself, but if your tests prove different, feel free to edit it. QUICK_EDIT
Yes, you are right i hadn't even considered the object type or AIbase planning tag. However, im almost certain that BuildCat also affects the sorting. QUICK_EDIT
Ok, i did some tests and it seems we are both wrong. I cloned the allied power plant and added it to the end of the buildings list, and changed the BuildCat to Resource (and changed the UIname so icould tell them apart). Now going by my logic, it should appear after the original power plant because BuildCat=resource come last. Going by yours it should come after the original because the original is first in the buildings list. It didn't, it came first.
This leads me to believe that my theory on the buildcat is correct, but is in the wrong order, and is used in preference to the object list when there are two buildings of the same techlevel and cost. The object list would then be used to order buildings of the same level, cost and buildcat.
It's just a theory and needs furthur testing.
Edit: been testing. Um... well...
I added 8 new cloned power plants, all i changed was the buildcat, 3 were tech, 2 power, 3 resource. Along with the orignal that leaves 3 of each. However, when ingame, it appeared in the following order:
Tech
Tech
Tech
Resource
Power
Resource
Power
Power
Resource
as you can see, two of them are in the wrong places which makes no sense as they are identical save for the different UInames.
Not only that but they were completly jumbled up from their position on the building object list. I think there may be another factor unaccounted for. QUICK_EDIT
I just did more tests myself, and actually I was wrong about the building list, it is actually higher numbers that come first.
First test (only changed code, not complete code):
Code:
[BuildingTypes]
436=GAPOW
437=GAPOWRX
438=GAPWR1
[GAPOWRX]
Image=YAPOWR
[GAPOW]
Image=NAPOWR
[GAPWR1]
Image=GAROBO
Note that the list order does not follow the actual section ordering, so the order the game chooses should be clear and not ambiguated in this case.
And the results were GAPWR1 first, followed by GAPOWRX, then by GAPOW, then the original GAPOWR.
I tried various BuildCat combos as well (Power, Tech, Resource, Infrastructure), and nothing changed.
Then I swapped the GAPOW and GAPOWRX, and voila, the list becomes GAPWR1, GAPOW, GAPOWRX, GAPOWR.
(The weird names are just a way to rule out any possible lingual sort affecting the result.)
I can see why the BuildingTypes order is the final step, after all it is an injective function, unlike all the other criteria...
Edit: lol, this is what happens when two moderators start discussing stuff, you can't tell who edited his post and when, so things get lost... Well, I'll have to try out with more clones, but so far what I've seen suggests what I wrote above, higher index = priority. QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum