Idea to clean up Tech Tree Branch Interaction

For topics that do not fit in another sub-forum.

Moderator: Oberlus

Post Reply
User avatar
Space Squid
Posts: 66
Joined: Sat Feb 01, 2014 5:03 pm

Idea to clean up Tech Tree Branch Interaction

#1 Post by Ta'Lon »

In my work with recreating the tech tree as a standalone graphic, I found myself very much appreciating the code which allows you to turn various tech categories on and off. This is a very nice innovation, and again kudos to the designer(s) responsible!

I did notice that the current 'order' in which the categories/buttons are listed strongly influences a tech's placement on the tree. So it would make sense that if you changed the order that the categories appear in the relevant tech tree .py files, that this would also influence initial placements of techs.

BTW, I did try to reorder the techs using just the techs.txt category, but the game just laughed at my childish efforts...

One tech that probably should be moved near/to the bottom of that list is Defense. It currently interacts with only one non-defense tech (Force Field Harmonics), so moving it to the bottom (or top) would very likely eliminate a lot of 'line crossings' by techs trying to cross the Defense tech lines to get where they need to go.

Incidentaly, the only Defense interaction is the Planetary Shield tech branch. More on this below.

Intelligence is already at the bottom, which makes sense because only one tech touches the 'Intelligence Tree'. There are two 'standalone' sensor techs as well, that do not interact with the other Sensor tree techs. Dunno why Active Radar insists in hanging out by itself and not next to it's own tree though. Active Radar and Interstellar Lighthouse should populate by the rest of the Intelligence techs, but that's a minor issue/thing that makes programmers go 'hmmm'.

Learning currently has the following 'affinities'
Production: 6 Techs
Ships: 5 Techs
- Tech four is the 'Energy Hulls' branch with 3 sub-techs.
- Tech five is the 'Ship Shield Branch with 2 subtechs.
Construction: 2 Techs
Growth: 1 Tech

Construction touches 3 other techs early in the tree, plus one ship tech at the end of the tree and the Transcend Victory tech. These techs are a Production, Ships, and a 'Standalone' Production tech that has it's own Ship Subtree (the Asteroid branch).

The Production tree has on abberation, that being Microgravity Industry. It is technically a 'production' tech, but it doesn not interact with the rest of the Production tree at all. so, discounting Microgravity Industry, Production touches 5 Ship techs (Ship tech doesn't return the favor). Oh, and the Transcend victory condition at the end...

Growth as a tree only interacts with the Organic 'subtree', plus the Transcend Victory at the end. I did see that someone 'broke out' the Organic tree in the techs.txt. Orbital Habitation is a 'standalone tech' linked to Microgravity Industry.

Note that the Weapons and Armor branches of Ship Techs are standalone. Also, need to mention Ship Shields again, which is kind of it's own branch off of Force Field Harmonics...

Sooo, based on this analysis, I think that Construction makes sense to be the first tech at the top. Because of the Asteroid branch, putting Ships below Construction helps clean up some interactions. Putting Production below Ships also makes sense, with Learning following Production. Finishing out the order as Growth, Intelligence, and Defense, or Growth Defense Intelligence makes sense.

Or, in list format


Shifting the order in this way should clean up the line interactions significantly. Sure, Galactic Exploration will still cross a few tech lines to reach Active Radar, but the number of techs in the first two 'rows' is considerably less than say rows 3-6...

Some additional notes:

While Microgravity Industry is technically a Production tech, and Orbital Habitation is a Growth tech, if both were categorized as Construction techs, this would likely 'move' them closer to the 'Construction Tree Core'.
Doing this should also 'coax' the Asteroid tree to the 'top' of the Ship branches, out of the way of some other branch interactions. Assuming that the Construction and Ships categories are ordered next to each other, of course.

Force Energy Camaoflage is a standalone tech tied to Force Energy Structures. Categorizing it as a Construction tech would 'move' it next to the Construction techs. It does only affect buildings, not other structures, so that could make some sense, even though it's more of an intelligence thing...

The Distortion Modulator is part of the Learning Tree, and currently doesn't interact with Intelligence. However, it seems 'well behaved' at the moment, placing itself near the learning techs.

Nova Bomb, while a Ship Tech that is soley dependent on a Learning and Production Tech, seems to have placed itself appropriately at the moment.

The Organic Branch has no interaction whatsoever with the rest of the Ship branch. While 'Categorizing' it as
a Growth tech might clean things up very nicely, this could cause some confusion for those pressing the 'Ships' category and wondering where the Organic ships are. It might not be a bad idea to create a new "Organics' or "Organic Hulls' category, to break them out from the Ship branch.

An similar treatment could be done with Asteroid Hull line, but I think that my above suggestion will work fine for now (Moving Microgravity Industry to Construction), placing the Ships Category after Construction).

It might also make sense to break out the Ship Hulls into the four other categories and out of Ships, i.e. Asteroid/Construction, Robotic/Production, Energy/Learning, and Organic/Growth. As an example, the Energy Hull branch is completely tied to the Learning tree. However, players would need to be aware of this in advance (where are the ship hull techs at?)

If this were done, the Ships category could perhaps be relabeled as Ship Components, or Components or some such...

An 'Interesting' programming approach might be to 'Have' a master Hulls category, but where that category isn't used for ranking/placing purposes. Instead, the Hulls are still tied to the four other tech Categories (Construction/Asteroids, Robotics/Production, Energy/Learning, and Organics/Growth), and would be 'ranked' among those categories whenever the 'Ship Hulls' Category is selected/active. This 'Hulls' category could have it's own color, but would rank based on the 'parent' category first, with the 'orphan' hull techs listing below if their parent category isn't selected.

Finally, it might make a LOT of sense to take Shields, Regular Armor and Weapons out of their respective categories and placed into their own categories. That being said, Shields aren't a major issue currently, as both 'lines' only interact with one tech, Force Field Harmonics. Although, 'categorizing' both Ship Shields and Planetary Shields as a new Shileds category might make sense, as they have absolutely no interaction whith other techs in their current categories.

If Shields were broken out in their own category, I'd recommend that said category be near the bottom, above Weapons and Armor.

Weapons should just be their own branch/category. They are in the way currently, and have NO interaction with the rest of the tree.

Same with 'Regular' Armor. The 'Asteroid Armor' techs that are 'buried' in the Asteroid Tree are fine where they are at, but Armor as it's own category would enable the standalone armors to be moved to the bottom, hence 'getting it out of the way'. while having a 4 tech category seems like overkill, I think that players will accept/appreciate having an Armor category.

One Final note...
In the Categories window, Locked, Available and Complete have their own dedicated 'row', and List View and Tree View have their own separate 'Dedicated' row. in the interest of saving screen space, putting all five on the same 'row' instead of separate rows would save a little screen real estate for those that stretch out the tech categories across the bottom. Myself, I'm finding myself liking a single column of techs at the bottom left as my preferred position/window adjustment, but the current default has them at the bottom as three rows on my screen.

Conquering the galaxy, one planet at a time...

Any artwork that I submit for use in the graphics forum is submitted under the CC-BY-SA 3.0 License.

User avatar
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Idea to clean up Tech Tree Branch Interaction

#2 Post by MatGB »

I don't really disagree with anything there, I especially like the idea of splitting ships and components up into different categories, and allowing the hulls closer association with their related tech.

OrbCon might be a growth category, but there's already one construction category that increases population, there's no reason why 'growth' can't be the more medical methods and construction contain the better building methods. Microgravity manufacture is a tech that's always annoyed me anyway, I'd actually consider dumping it completely and putting the effect into, say, orbital generation, except that it's also a key for asteroids, a line I use less often than some.

Tidying up the tech tree is somethign I think should be considered an onboing project, we'll have to add things to it and move things around to make things balanced (I'm hoping to split the 'robotic' hull line up into two branches with the patch I'm almost finished with, for example, it'll flow better that way), and most of what you suggest looks fine and will, hopefully, make it much clearer.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Space Squid
Posts: 66
Joined: Sat Feb 01, 2014 5:03 pm

Re: Idea to clean up Tech Tree Branch Interaction

#3 Post by Ta'Lon »


OK, so it turns out that I CAN modify the tech tree layout using just the .txt files. I'd appreciate it if you could give this a gander ingame and let me know what you think.

I spent hours perusing the various .cpp, .h, and other files trying to figure out where the tech category order was determined, and didn't find anything.

So, I added a tech category in techs.txt (and also en.txt), assigned a tech to it, and voila! it showed up ingame!!!

After much experimentation, what I was able to determine that how the game chooses to place techs and categories is driven alphabetically, unless the branch engine decides it needs to place a tech somewhere else.. Which is why, say, Force Energy Structures/Construction appears above Galactic Infrastructure/Construction and not below, assuming that multiple tree branches don't pull a tech up or down on the tree placement.

Hence, adding prefixes to the category names (and changing the relevant techs) to 'order' the categories worked like a charm! Took me a bit to work out some simple 'nomenclature' that would make sense to others, though... Note that the 'ingame' tech names are not the same as the category names, a 'string' is assigned to each category for this, to deal with the multiple language issue no doubt.

However, tech names are referred to in several files, while the categories seem to be standalone. So you can't just rename a tech without possibly breaking a few things. I tried, and indeed, I did break a tech... so I changed it back. Nonetheless, I was able to accomplish most of my goals with just recategorizing some things.

Anyways, attached is a .zip file of what I currently have, after a bit of experimentation to see which tech category placements seemed to work the best. I needed to modify both the en.txt and the techs.txt, so that the proper category labels would show up.

In my current game, hulls are now broken down into 4 categories (all still brown). Defenses has been relabeled Fortification, a Shields caterory was added (dark blue), Weapons and Armor are now under the Aggression category (still brown), and Ships is now relabeled as Ship Systems. I also moved a couple of techs into other categories (notably Death Spores and Bio Terminators), and I assigned existing icons to a few techs (ship hulls and the Death Spores/Bio Terminators, plus the Kraken so I can say 'Release the Kraken!' every time I earn the Domesticated Mega Fauna tech...

If people end up liking this, I want a chance to work with a clean tech.txt file to properly order things. I moved a lot of stuff around more than a few times in the .txt file, and now that I'm more or less happy with the result, I want to work with a clean 'baseline' file to make sure I have everything right, in case I inadvertently introduced a space or extra character or whatever. Also, I would need to modify the other language stringtable files appropriately, so no sense submitting just an .en version.

So, to use the files in the .zip below, just open the default folder, save the techs.txt file somewhere safe (so you have it to change things back), open the default/stringtables folder, save the en.txt file somewhere safe, then place the enclosed techs.txt and en.txt files in the relevant folders. Then start up a new game, and this should appear immediately. Go to research, you should see a bunch of new buttons. As usual, hitting 'locked' will show you the new tree layout.

Also, let me know if I broke anything! Things seem to be working well/perfectly fine on my end, but ya never know...
techtreeingame.jpg (113.94 KiB) Viewed 1475 times
(116.27 KiB) Downloaded 70 times
Conquering the galaxy, one planet at a time...

Any artwork that I submit for use in the graphics forum is submitted under the CC-BY-SA 3.0 License.

User avatar
Space Squid
Posts: 66
Joined: Sat Feb 01, 2014 5:03 pm

Re: Idea to clean up Tech Tree Branch Interaction

#4 Post by Ta'Lon »

OK, I just downloaded SVN6931, and modified the techs.txt and en.txt files in 6931, that will produce the layout shown above.

I only did minor rearrangement of the tech.txt file, so that those of you doing .diff checks or whatever can see what changed more easily.

I did add name headers to Asteroid Hulls, Energy Hulls, and Robotic Hulls, so it is more clear in the files where those files are (similar to Organic Hulls), and moved the ship parts that appear after the hulls to just before where hulls are delineated.
(120.96 KiB) Downloaded 67 times
Conquering the galaxy, one planet at a time...

Any artwork that I submit for use in the graphics forum is submitted under the CC-BY-SA 3.0 License.

User avatar
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Idea to clean up Tech Tree Branch Interaction

#5 Post by Dilvish »

I do really like how you were able to clean up the tech tree layout significantly; at the very least this might help someone down the road looking to improve the layout algorithm. I am concerned (1) that this approach seems to require a significant proliferation of categories in the UI, which becomes a bit cluttered. I suspect there will also be (2) some dislike of being so dependent on manual adjustment of the layout.

It sounded like you may have been able to accomplish this cleaner layout purely by modifying tech names rather than adding any categories, is that so? Yes, you ran into problems with the tech names being referenced in other places, but that could be handled fairly easily. In that case the only UI change would be a cleaner tree, clearly a benefit and thus not subject to concern (1). Concern (2) would still remain, but so long as the renaming didn't confuse things for scripting, then it might be deemed sufferable in order to accomplish a short-to-mid-term benefit to the layout.

Just to be clear, I'm not one of the people who would be actually deciding any of this, & they might have entirely different opinions, but I wanted to go ahead and give you some feedback and food for thought.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Space Squid
Posts: 66
Joined: Sat Feb 01, 2014 5:03 pm

Re: Idea to clean up Tech Tree Branch Interaction

#6 Post by Ta'Lon »

My 'eventual goal' would be to have Ship Hulls in one 'Master Cagegory', with the various sub-categories used for sorting purposes only, so as to place the Organic Hulls below Growth, Energy near Learning, the Robotic Hull line near Production, and the Asteroid Hull line near Construction.

Only one "Ship Hulls" would appear for all four categories in this case, which would shut off all of the hull branches when deselected.

A similar approach could be used for Shields (group them under the 'Defense' button with Fortifications, but still allow the two to be split apart in tree placement).

Simply making a 'Ship Hulls' category and assigning all four hull types to the same category in the current structure still ends up with some messy tree interactions (I did try)...

But the easiest way I found to 'force' Shields and the various Hull branches to areas where they would interact more cleanly with the rest of the tree without modifying the 'compiled' files was to break them out into five new categories. Plus the Weapons category as well, to move them out of the way.

A simpler approach might be to modify the category button window placement algorithm, so as to 'sort' those based on the order they appear in the 'categories' header in techs,txt, instead of alpabetically, but still sort the actual category placement alphabetically using the prefixes I added. This would allow grouping of the four 'hull' buttons together without also messing up where they are placed as shown above. That way the actual tree algorithm wouldn't have to be messed with, and only a few minor tech name changes could clean up the tree a bit more.

Simply changing the tech names 'alphabetical order' with prefixes won't quite do the job (say by changing SHP_DOMESTIC_MONSTER to T53_SHIP_DOMESTIC_MONSTER), as the algorithm tries to place techs as close to the 'core' of their category as it can. Which is why chunks of the Organic Hulls tree branch currently end up getting pulled up/down towards the rest of the Ships category, unless they are broken out into their own category.

I have LOTS of respect for the guy that put that tree algorithm together, and think the actual algorithm works awesomely. I would think that the 'category window' part of the algorithm can be tweaked without having to tackle the tree algorithm itself. Simply by, say, adding a new variable (main categories button order), along with sub-categories that are assigned to 'parent' category buttons (via a parent category variable). That way, the 'tree order' could be tweaked in the background without having to have a bunch of extra buttons in the interface.

This isn't really a priority at the moment, though, so I think having a few extra buttons for now would be acceptable, until more imporatant things are completed, IMHO of course!
Conquering the galaxy, one planet at a time...

Any artwork that I submit for use in the graphics forum is submitted under the CC-BY-SA 3.0 License.

Post Reply