Tech pipes mod?

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
Does anyone know of a mod which rewrites the code for linking buttons on the tech tree? It contains numerous bugs for certain arrangements of techs, and the code is messy and hard to edit. The social policy linking code contains many of the same bugs and problems. Firaxis has avoided particular arrangements of policies and technologies... I sometimes wonder if the game-balance developer was ever influenced by the limitations of the code. :think:
 
I did google it, but that's not what I'm looking for. I'm asking if anyone has improved the code at a more fundamental level than quick bugfixes. The code is very disorganized, which is probably what led to all the bugs, since messy code is harder to understand and debug. It also has limitations like hardcoded era and tree size restrictions.

In other words... you rewrote the linking code for unit promotion and upgrade trees. Has anyone applied that methodology for tech and social policy trees? It would open up some flexibility for mods. I'm thinking of putting some work into it, but don't want to redo it if someone else has done it already.
 
One change I've considered doing to the tech tree code is making it so if a tech has a second prerequisites being too far behind in the tech tree to be linked to, the second prerequisite's icon would appear in the middle of the first prerequisite's arrow, allowing for adequate graphical representation of such "too far behind" tech prerequisites.
 
For anyone comtemplating writing something like this, don't try and place all the graphical elements (pipes and buttons) on the same "glass" or you will run into drawing sequencing issues - rather use 4 layers of "glass" and draw the horizontals on the bottom layer (1), the verticals on layer 2, the bends on layer 3 and the buttons on the top layer (4). That way you can draw your connections between buttons without regard for any other pipes/buttons in the tree and the layering will correctly hide what you don't need to see (as the pipes will run behind the buttons).

If you want "horizontals over verticals" just swap layers 1 and 2, but, IMHO, vertical pipes running over the top of horizontal pipes looks better (assuming pipes need to cross)
 
Is something like what FiresForever did for CTP what you mean? We have 5 different tech trees and all of the era are 4 techs deep. If so, you should contact him; I know he has done some very recent work on the tech tree.
 
I don't think it is really what you want but who knows... For IGE I had to add a tech tree and I made a custom implementation for that purpose (trying to understand and modify the original mess seemed more complicated than rewriting one from scratch). It also has a validation algorithm to detect whether the tech tree (possibly modified by mods) can be rendered with my implementation. The core logic is in IGE_API_UI.lua, look at UpdateGraph. It can be used for both horizontal graphs (techs tree) and vertical ones (policies trees) and it is as small as 121 lines of LUA code, and quite easy to understand, modify and reuse I guess.

Note that this algorithm works with custom LUA structures (generated in IGE_API_Data.lua - see SetTechnologiesData - this is also where the validations lies) rather than the ones from GameInfo but you could change that. The XML part is in IGE_TechsPanel.xml or IGE_PoliciesPanel.xml but those ones are more or less copy-pasted from the original civ5 components.
 
Back
Top Bottom