Help modifying tech trees

uckzekaj

Chieftain
Joined
Aug 25, 2013
Messages
2
What I'm looking to do seems rather simple and straight forward but I've been poking at the Civ4-BTS files for a while now and with my limited experience with python and such I'm not making any headway.

What want to do is basically end the regular Civ-BTS tech tree right before the modern era by cutting out all the techs past Physics, Biology and such.
(Image of what I'm talking about in the spoiler)
Spoiler :
5111380190_d3e3992670_o.jpg

I'd be willing to leave in the Assembly Line tech if I could easily remove the Infantry unit from the tech as it's one of the main reasons I want to remove the later techs.


At first I figured this should be as easy as going into the civ files and just deleting the techs from the Civ4TechsInfo.xml and the related schema file but of course that didn't work since, as I learned afterwards, there's a ton of other things that call those lines of code.

Second major attempt I went through all the Civ-BTS files and tried to edit out anything and everything that even mentioned the later techs. This included deleting units, resources; such as aluminum, and anything else that called or referenced the techs.

So now I'm really hoping someone with far more experience then I can shed some light on this and point me in the right direction on this.


Exposition:
I'm looking to do this cause I find the diversity of units both on land and sea right before the modern era and the acquisition of infantry best suits me. I really like the choices between units such as the rifleman->cavalry->grenadier relationship or frigates speed vs ship-of-the-line strength to be a more interesting choice then 'all my boats are destroyers' that seems to happen in my later games. And to compound this I feel like this era goes by the fastest as it's just when I've expanded enough and have enough infrastructure that my research is really taking off.

So anyway, there's my personal reasons for trying to do this. Like I said above, anyone that can help me work this out I'd greatly appreciate it.
 
This is not, for the most part, a Python issue or an SDK issue except possibly in the very few places in the Python where specific techs are mentioned (although there might not be any direct references to techs this late in the tech tree, there are probably several references to things enabled by those techs which you may also be removing from you rmod). There are no references to specific techs in the .cpp or .h files so there is no SDK work needed.

If you want to try something easier to start with, you can just set all the "not researchable" techs to have their bDisable set to 1 instead of 0. They will still show up in a lot of places but it will not be possible to research them. This makes a mod that consists of just that one CIV4TechInfos.xml file.

I did a lot of this sort of tech removal thing when trimming Caveman 2 Cosmos down to make the Rocks 2 Rockets mod. I removed 142 techs, to be specific, which is way more than even exist in regular BtS (BtS has 92 techs; version 24 of C2C had 642 and R2R has 500).

It is pretty much just a case of doing what you said: delete the tech info, then search all XML and Python files for the TECH_WHATEVER string and remove all references. It is best to do them one tech at a time, starting from the right (i.e. Fusion or Future Tech) and working your way back. You may want to leave in Future Tech so there is something to do with research points after you hit the end of the tech tree, if so just make it require two or more of the last techs you are leaving in and possibly adjust its cost. If the tech made something go obsolete then either it will no longer go obsolete or you have to change the obsolete tech to something that will still exist. If the tech is a prereq for something then you have to either change the prereq, remove that prereq and rely on any others it has (allowing it to show up earlier), or remove whatever it is and any related data (if you remove a building, you should also remove the building class; likewise for the unit class when you remove a unit) - for each thing you removed (unit, building, civic, whatever) you also need to search the XML and Python for additional references to that thing. You can skip removing data from the game text files (any file in the Assets/XML/Text folder) and any art defines or sound definitions which will save some time and make your mod smaller (only relevant if you decide to share it).

There isn't really anything else to it. Just do a complete search each time. Start a test game every few techs and if any error happens when you load the game you missed something, possibly because the files for BtS that were not changed in that expansion are actually still located in the Warlords or expansionless Civ4 Assets folders.

Oh, and don't change the original files, make a mod and copy each file to be modified into it in the corresponding folder before editing it. You will end up copying quite a few files into your mod, but that's what happens when you mod something that relates to as many things as Techs do.

Having an era or two with no techs assigned to them is odd, but should not break anything. In fact, if you remove the eras then you may get undesirable effects due to the shift in end of the period defined to be "early" and the start of the period defined to be "late" - like having the modern music play in your last era which would not really be appropriate. So you should probably not actually remove any era.
 
If you are tired of changing 30+ tech entries to disable them, there is a python callback which can be enabled.
Then 2 lines of code will probably do it.
Should be canDoResearch or something.
Simply check if era of tech above a specific era, if so return false.

Not in modding mood recently :D
 
Back
Top Bottom