Unit Upgrade Tree

Hydromancerx

C2C Modder
Joined
Feb 27, 2008
Messages
16,281
Location
California, USA
As more and more Culture Units get added the more the more twisted and messy the Unit Upgrade Tree gets. In the past you would not have this problem since Unique Units would replace their base units.

So I am wondering if there could be a new tag for units that would hide them on the Unit Upgrade Tree. That way we can tag all Culture units so they hide on the tree and then you can see all the main units.

Can this be done? If so how soon?
 
The usual tag for such things is the bGraphicalOnly tag. That tag is only used in the pedia. However it may remove them from the pedia completely.

There are a number of things we need to do in the pedia like split resources into map, manufactured and cultural.
 
The usual tag for such things is the bGraphicalOnly tag. That tag is only used in the pedia. However it may remove them from the pedia completely.

There are a number of things we need to do in the pedia like split resources into map, manufactured and cultural.

How about writing into the unit upgrade tree code to ignore all units that have <iMaxPlayerInstances> of 15 and <iInstanceCostModifier> of 2? That would get all of the Culture Units and hopefully very little, if nothing else.
 
How about writing into the unit upgrade tree code to ignore all units that have <iMaxPlayerInstances> of 15 and <iInstanceCostModifier> of 2? That would get all of the Culture Units and hopefully very little, if nothing else.

Except of course a number of "my" units which people insisted should be 15.:mischief: It would be just as easy (read difficult) to base it on a prerequsite that is a culture as a max number as both require looking at a secondary file.

Having that tag I mentioned set does stop the unit appearing in the pedia (index and upgrade tree) but you can still get to the pedia entry for it.
 
As more and more Culture Units get added the more the more twisted and messy the Unit Upgrade Tree gets. In the past you would not have this problem since Unique Units would replace their base units.

So I am wondering if there could be a new tag for units that would hide them on the Unit Upgrade Tree. That way we can tag all Culture units so they hide on the tree and then you can see all the main units.

Can this be done? If so how soon?
Well, the option is there, except that it is not in the XML.
Check Assets/Python/Contrib/UnitUpgradesGraph.py.
Near the start of that script there is this:
Code:
#The exception list allow you to completely hide a unit from the upgrade graph.
#This is useful for mods that use an unreachable unit to keep others from expiring.
#unitExceptionList = [UNIT_UNREACHABLE]
unitExceptionList = []

#The split lists let you split a particular unit into several different graphs, so it doesn't hold several
#upgrade paths together that would look better separate.  For instance, you might have a Ranger unit that
#upgrades from both a Scout and Warrior unit, but otherwise Scouting and Fighting units are in their own
#trees.  In this case, you would place the Ranger in the SplitIncoming list, to get the program to split up
#the incoming upgrades to Ranger so that Ranger shows up in both trees without holding them together.
#unitSplitIncoming = [UNIT_RANGER, UNIT_STYGIAN_GUARD]
unitSplitIncoming = []

#SplitOutgoing is similar, but for a unit that holds together two trees by what it upgrades to.  For instance,
#you might have a commoner unit that upgrades to Scout, Warrior, and Worker, while otherwise those units have
#their own trees.  Using the SplitOutgoing list will just put a commoner at the start of each of the 3 trees
#unitSplitOutgoing = [UNIT_DWARVEN_SOLDIER]
unitSplitOutgoing = []

Currently it seems like only the promotions version is used a bit: promotionsSplitIncoming

While that is certainly something that can and should be added to the XML, for now you can use the options in this script to get the upgrade tree to look better.
 
@AIAndy

Yeah. At the moment if you have too many links (more than 15) then the left side of the tree will mess all up into chaos. Likewise all the Unique units are cluttering up the main tree and as a result its harder to read. Thus there are 2 issues ...

1. Getting the tree to be wider than 15 units so it will not make "cluster chaos".

2. Hiding units from the tree so its easier to read.
 
@AIAndy

Yeah. At the moment if you have too many links (more than 15) then the left side of the tree will mess all up into chaos. Likewise all the Unique units are cluttering up the main tree and as a result its harder to read. Thus there are 2 issues ...

1. Getting the tree to be wider than 15 units so it will not make "cluster chaos".

2. Hiding units from the tree so its easier to read.

Removing the Culture units from the Upgrade Tree will help with the vertical spacing of the tree, not the horizontal spacing. I don't think that there is any appreciable limit to the vertical spacing, so removing the Culture Units will make things look nicer only if the horizontal spacing issue is fixed.
 
@AIAndy

Yeah. At the moment if you have too many links (more than 15) then the left side of the tree will mess all up into chaos. Likewise all the Unique units are cluttering up the main tree and as a result its harder to read. Thus there are 2 issues ...

1. Getting the tree to be wider than 15 units so it will not make "cluster chaos".

2. Hiding units from the tree so its easier to read.
You can do number 2 with the unitExceptionList.
Unfortunately the algorithm did not seem to come to a conclusion in the time I was willing to wait so I have not seen 1. It might be that it does not do enough iterations of the layout algorithm.
 
Could we get the unit upgrade tree to be wider than 15 units? Its going super squishing currently so much so that units are appearing in revers order such as the Rock Thrower is a column after the Slinger and the Archer appears on the Same row as the Slinger. It should go ...

Rock Thrower -> Slinger -> Atl-Atl -> Archer
 
@AIAndy

Is there a way to set a width for the window or even the ability to set them in sports like how the tech tree works?
There is no limit to the width. It is determined by the layout algorithm.
I have now doubled the number of iterations to get a better rendering at the cost of calculation time.
 
There is no limit to the width. It is determined by the layout algorithm.
I have now doubled the number of iterations to get a better rendering at the cost of calculation time.

Yay! It worked!! :D Nice job! Now they are not so squished anymore. Its still messy, but that's because of what units each unit upgrades to. Thank you! :goodjob: Its actuality readable again! :cool:
 
Top Bottom