BFTTree - Multiple Page Tech Tree

FiresForever

Prince
Joined
Sep 30, 2010
Messages
584
BFTTree Version 6 Released 21/11/2010

Well it has been just over a month now since v5 was released, thanks to everyone for their input especially lemmy, i still have a bit of spit and polishing to do before release. So here is some new info to keep you going until then, there are some major changes so check out the new ‘how to’ section to see how the new system works!!

About

This is a multiple category (page) technology tree mod, useful to anyone adding new technologies to the game.

It includes:

Categories

Create your new technologies and place them within a specific category, for example:

Technology: Really Big Guns
Category: Offensive
Or
Technology: Shields
Category: Defensive

Technologies in any of the category trees can have prerequisite technologies in any other tree, including the default tree.

Civilization Specific Trees (and Technologies)

Want to create a technology tree and technologies that can only be used by England? How about Technologies only for America? BFTTree can do this.

NEW IN V6:

Everything is changed to run from XML rather than by lua editing making it extra moddable, no more asking me for categories you can now add them yourself :)

There is not a lot by default but now all text is written in TEXT_KEY format allowing additional languages to be added.

How To (Under Development)

Spoiler :


To demonstrate how BFTTree works i will walk through how a new technology tree (category) and technologies, that is just for the “English civilization” can be created.
The following is an example of creating a new Tech Tree called ‘England’, similarly to how we create a new technology we can write the following in an XML file:
<GameData>
<TechTreeCat>
<Row>
<ID>0</ID>
<Type>TECHTREE_England</Type>
<Description>TXT_KEY_TECHTREE_ENGLAND</Description>
<PortraitIndex>0</PortraitIndex>
IconAtlas>TECHTREE_ATLAS</IconAtlas>
</Row>
</TechTreeCat>
</GameData>

We could stop here if we wanted the technologies to be available to all civilization, but in this case we want this tree to be only for the English Civilization. We also want it to be displayed when we click the &#8216;our technologies button&#8217; on the &#8216;technology trees available&#8217; popup window (see screenshot).
<GameData>
<Civilization_TechTreeAccess>
<Row>
<TechTreeType>TECHTREE_England</TechTreeType>
<CivilizationType>CIVILIZATION_ENGLAND</CivilizationType>
<CivilizationMainTree>YES</CivilizationMainTree>
</Row>
</Civilization_TechTreeAccess>
</GameData>

Here we have the name of the technology tree that we made earlier, the civilization that this technology tree belongs to and the &#8216;YES&#8217; links this tree to the &#8216;our technologies button&#8217;.

Now the tree is set up let&#8217;s make the technologies, we create them as normal but add a tag:
<TechCat>TECHTREE_England</TechCat>

Since we want these technologies to only be researched by England we first need to create a starting technology for this tree, then disable it and finally gift it to the English civilization this will prevent other civilisations researching technologies that have this as a prereq. So we have the following technology:
<Technologies>
<Row>
<Type>TECH_Starting_England_Technology</Type>
<TechCat>TECHTREE_England</TechCat>
<Cost>1000</Cost>
<Description>TXT_KEY_TECH_Starting_England_Technology_TITLE</Description>
<Civilopedia>TXT_KEY_TECH_Starting_England_Technology_DESC</Civilopedia>
<Help>TXT_KEY_TECH_Starting_England_Technology_HELP</Help>
<Era>ERA_ANCIENT</Era>
<Trade>true</Trade>
<GoodyTech>true</GoodyTech>
<GridX>0</GridX>
<GridY>5</GridY>
<Quote>TXT_KEY_TECH_England_Only_Technologies_QUOTE</Quote>
<PortraitIndex>1</PortraitIndex>
<IconAtlas>TECH_ATLAS_1</IconAtlas>
</Row>

Now lets disable this technology:
<Update>
<Where Type="TECH_Starting_England_Technology"/>
<Set Disable="1"/>
</Update>
</Technologies>

Now we will give this technology to the English civilization:
<Civilization_FreeTechs>
<Row>
<CivilizationType>CIVILIZATION_ENGLAND</CivilizationType>
<TechType>TECH_Starting_England_Technology</TechType>
</Row>
</Civilization_FreeTechs>

We now have our new tech tree and starting category, now you can create more technologies for this tree, make sure to make prereq so that all your new technologies for this tree link back to this first starting tech.




Files Changed and Created for this mod

InGame.xml (Important breaks compatibility with any other mod changing this file)
TechTree.lua
TechTree.xml


TechTreeCategories.lua
TechTreeCategories.xml
TechTreeText.xml
TechCheck.lua (Not currently used)


Additional Info:

This mod does not change the height of the technology panels, doing this would cause problems and compatibility issues with about 20% of steam users. (http://store.steampowered.com/hwsurvey)
 

Attachments

  • BFTTreeEnglishCivTree.jpg
    BFTTreeEnglishCivTree.jpg
    128.1 KB · Views: 1,740
  • BFTTreeV5.jpg
    BFTTreeV5.jpg
    226.7 KB · Views: 1,992
First of all thanks to Kael and the excellent Modders guide. Special thanks to lemmy for his advice and code on changing BFTTree to use xml and sql.

Important INFO

Since the mod is now making changes to the sql tables the mod load order is important, atm there does not seem to be a way to set this. If anyone knows a way around this or has any input let me know.

Known Bugs/missing features

Tech count is not currently working,this is being worked on :)
Pressing 'our technologies button' when that civ does not have a civ specific technology tree closes the tech panel. This button will be dynamic in V7 and will not show if a corresponding table does not exist.

To Do:

(For V7) Tech trees are displayed after an event is triggered e.g. reaching a specified era, technology researched, etc

Potential future feature ideas:

Dynamic category buttons linked to events e.g. era, a technology researched, policy chosen (idea by Pouakai) - Now being worked on
Add a vertical scroll to the tech tree (idea by blazekid87)


Current Status:



Other Stuff



Other Projects:

BFSPanel (a multi page social panel mod) - Currently changing it from the static system to a more dynamic one, delayed a little as will be changing it to use the xml and sql, similar to BFTTree, making it more mod friendly.
 
You know, something like that would be awesome to make different tech trees for each civilization in some mods ;)
 
You know, something like that would be awesome to make different tech trees for each civilization in some mods ;)

I had not thought about it but i can see a way (potentially easy way) of doing this with how it works.
 
Your mod looks like it is going to rock when it is finished.

I have been trying to do my own tech tree modding, but without success.

Is there a tutorial on the basic functions of tech tree modding? I have been all through Kaels guide, but it doesn't quite apply for what I am trying to do.

Can I basically remove all the tech with a delete function, and then add in my own tech tree(which includes all the old tech but in different positions and orders).

I have modified my tech tree extensively, but it always crashes when I load a game with it.

For instance, here is 2 example tech for what I have done while trying to mod the tree:

Spoiler :
<Row>
<Type>TECH_MYSTICISM</Type>
<Cost>35</Cost>
<Description>TXT_KEY_TECH_AGRICULTURE_TITLE</Description>
<Civilopedia>TXT_KEY_TECH_AGRICULTURE_DESC</Civilopedia>
<Help>TXT_KEY_TECH_AGRICULTURE_HELP</Help>
<Era>ERA_ANCIENT</Era>
<Trade>true</Trade>
<GoodyTech>true</GoodyTech>
<GridX>1</GridX>
<GridY>1</GridY>
<Quote>TXT_KEY_TECH_AGRICULTURE_QUOTE</Quote>
<PortraitIndex>0</PortraitIndex>
<IconAtlas>TECH_ATLAS_1</IconAtlas>
<AudioIntro>AS2D_TECH_AGRICULTURE</AudioIntro>
<AudioIntroHeader>AS2D_HEADING_TECH_AGRICULTURE</AudioIntroHeader>
</Row>
<Row>
<Type>TECH_SAILING</Type>
<Cost>35</Cost>
<Description>TXT_KEY_TECH_SAILING_TITLE</Description>
<Civilopedia>TXT_KEY_TECH_SAILING_DESC</Civilopedia>
<Help>TXT_KEY_TECH_SAILING_HELP</Help>
<Era>ERA_ANCIENT</Era>
<Trade>true</Trade>
<GoodyTech>true</GoodyTech>
<GridX>1</GridX>
<GridY>4</GridY>
<Quote>TXT_KEY_TECH_SAILING_QUOTE</Quote>
<PortraitIndex>13</PortraitIndex>
<IconAtlas>TECH_ATLAS_1</IconAtlas>
<AudioIntro>AS2D_TECH_SAILING</AudioIntro>
<AudioIntroHeader>AS2D_HEADING_TECH_SAILING</AudioIntroHeader>
</Row>

Spoiler :
<Row>
<TechType>TECH_MYSTICISM</TechType>
<FlavorType>FLAVOR_HAPPINESS</FlavorType>
<Flavor>5</Flavor>
</Row>
<Row>
<TechType>TECH_SAILING</TechType>
<FlavorType>FLAVOR_NAVAL</FlavorType>
<Flavor>3</Flavor>
</Row>

Spoiler :
<Row>
<TechType>TECH_MYSTICISM</TechType>
<PrereqTech>TECH_FISHING</PrereqTech>
</Row>
<Row>
<TechType>TECH_SAILING</TechType>
<PrereqTech>TECH_FISHING</PrereqTech>
</Row>

And my delete tech attempt. I have tried several different wordings for the delete function such as just <delete /> and <delete technologies /> but no dice.

Spoiler :
<GameData>
<Technologies>
<Delete Tech/>
</Technologies>
</GameData>


I had the notion that since they give you X and Y coordinates for the techs, you can just ensure that they are all correct, and then ensure prereqs are correct, and the Lua will fill out the tree for you?

Do I need to make special Lua scripts for the game to know what to do with my techs?

I was hoping that I could just update database after all the old techs were gone, and replace it with my new tech and the old tech all in new locations... should I just do a set/where update for all the old tech in my file and then a normal addition for all my new tech?

Thanks for any help you can give me.
 
Hey FiresForever, today I tried loading this mod and the test data, and the issue I found is I couldn't access the other pages, the Up/Down button simply closed the tech tree without warning. I could see the added test data in my research options though.
 
Hey FiresForever, today I tried loading this mod and the test data, and the issue I found is I couldn't access the other pages, the Up/Down button simply closed the tech tree without warning. I could see the added test data in my research options though

To Szpilman:

I have just downloaded the mod and checked it and seems to work from here, hmmm.
If you downloaded a previous version then you might try deleting the mod folders and re downloading, as follows;
In your documents folder:

Spoiler :
Documents\My Games\Sid Meier's Civilization 5\MODS

and delete the 2 BFTTree Folders:

FiresForever BFTTree (Test Technologies) (v 1)
and
FiresForever BFTTree (v 2)


If anyone else could test the mod and give feedback on if it is working or not would be helpful, i also noticed when testing that the up and down buttons don't display on smaller screen resolutions :) will add that to my todo list.

To Decimatus:

There isn't any guide out atm as far as i can tell however a few pointers that i have noticed during my poking:

if you have deleted all of the default technologies then your first technology in your new list of technologies will probably have to begin with an extra tag:

<ID>0</ID>

so for example:

<Technologies>
<Row>
<ID>0</ID>
<Type>TECH_AGRICULTURE</Type>

etc...

also it might be worth looking into altering the existing default technologies, using an update command, i think i saw this in the modders guide being used somewhere for something else, rather than deleting them all and starting from scratch. might solve some issues.

If you just want to add . new technologies to the existing ones then you don't have to delete the default technologies. you can reposition them by updating their <GridX> and <GridY>. Again i think an update command was used somewhere in the modders guide for something else, should be similar.

For reference the files that i have found that relate to the technologies are as follows:

CIV5Technologies.xml
CIV5GameTextInfos_Techs.xml

Hope that helps in some way :)
 
When I tested your mod out it worked fine with both pages and all 4 test tech in them. Trying to add a tech to page 2 caused both pages to blank out however, though I am sure that wasn't the fault of your mod... :p

To Szpilman:

I have just downloaded the mod and checked it and seems to work from here, hmmm.
If you downloaded a previous version then you might try deleting the mod folders and re downloading, as follows;
In your documents folder:

Spoiler :
Documents\My Games\Sid Meier's Civilization 5\MODS

and delete the 2 BFTTree Folders:

FiresForever BFTTree (Test Technologies) (v 1)
and
FiresForever BFTTree (v 2)


If anyone else could test the mod and give feedback on if it is working or not would be helpful, i also noticed when testing that the up and down buttons don't display on smaller screen resolutions :) will add that to my todo list.

To Decimatus:

There isn't any guide out atm as far as i can tell however a few pointers that i have noticed during my poking:

if you have deleted all of the default technologies then your first technology in your new list of technologies will probably have to begin with an extra tag:

<ID>0</ID>

so for example:

<Technologies>
<Row>
<ID>0</ID>
<Type>TECH_AGRICULTURE</Type>

etc...

also it might be worth looking into altering the existing default technologies, using an update command, i think i saw this in the modders guide being used somewhere for something else, rather than deleting them all and starting from scratch. might solve some issues.

If you just want to add . new technologies to the existing ones then you don't have to delete the default technologies. you can reposition them by updating their <GridX> and <GridY>. Again i think an update command was used somewhere in the modders guide for something else, should be similar.

For reference the files that i have found that relate to the technologies are as follows:

CIV5Technologies.xml
CIV5GameTextInfos_Techs.xml

Hope that helps in some way :)

Thanks, I actually started moving in that direction. I even managed to add a tech to the tech tree.

My problem now is that updating existing tech isn't working thus far. Here is what I am using to try to update it:

<Technologies>
<Update>
<Set GridY="4"/>
<Where TechType="TECH_SAILING"/>
</Update>
</Technologies>

This is what it looks like:

Spoiler :
<Technologies>
<Row>
<Type>TECH_MYSTICISM</Type>
<Cost>35</Cost>
<Description>TXT_KEY_TECH_MYSTICISM_TITLE</Description>
<Civilopedia>TXT_KEY_TECH_MISTICISM_DESC</Civilopedia>
<Help>TXT_KEY_TECH_MISTICISM_HELP</Help>
<Era>ERA_ANCIENT</Era>
<Trade>true</Trade>
<GoodyTech>true</GoodyTech>
<GridX>1</GridX>
<GridY>0</GridY>
<Quote>TXT_KEY_TECH_MISTICSIM_QUOTE</Quote>
<PortraitIndex>0</PortraitIndex>
<IconAtlas>TECH_ATLAS_1</IconAtlas>
<AudioIntro>AS2D_TECH_AGRICULTURE</AudioIntro>
<AudioIntroHeader>AS2D_HEADING_TECH_AGRICULTURE</AudioIntroHeader>
</Row>
<Update>
<Set GridY="4"/>
<Where TechType="TECH_SAILING"/>
</Update>
(More techs)
<Technologies>


In this test, all I did was add my update string in the middle of a mod that already worked.

Also I should note that the grid space is empty. And I do know that adding a tech on top of another existing tech just covers the old one up.
 
Not sure if it affects it but you have spelt mysticism two different ways in the above spoiler tab.
 
I think I will create a new thread for this topic so I don't clutter up your thread with my questions. :)

Not sure if it affects it but you have spelt mysticism two different ways in the above spoiler tab.

I sure have. :p Only affects that text description though. And actually, I also mispelled them in the TEXT lines too, so I wouldn't have noticed unless you told me, thanks. :)
 
something i have noticed with this:
<Technologies>
<Update>
<Set GridY="4"/>
<Where TechType="TECH_SAILING"/>
</Update>
</Technologies>

Instead of TechType i think it should just be Type, so we should have something like:

<Technologies>
<Update>
<Set GridY="4"/>
<Where Type="TECH_SAILING"/>
</Update>
</Technologies>
 
something i have noticed with this:
<Technologies>
<Update>
<Set GridY="4"/>
<Where TechType="TECH_SAILING"/>
</Update>
</Technologies>

Instead of TechType i think it should just be Type, so we should have something like:

<Technologies>
<Update>
<Set GridY="4"/>
<Where Type="TECH_SAILING"/>
</Update>
</Technologies>

Aha, that worked perfectly! :)

Thanks for the help. I look forward to your finished Pages mod. I will try to test it when I can.


On another note, do you know if the ages expand to cover the techs in them, or do you have to manually expand it in LUA or somewhere? Like ancient is 3 grids wide. If I moved an ancient tech from the 3rd grid to the 4th grid, and moved the rest of the techs over 1 grid(so that they would be out of the way), would the ancient era expand to cover?
 
Yes the Era Grid expands automatically

If you make an ancient technology on Grid 4 then the ancient era panel will expand to cover grid 4. You will however have to move all the later era technologies by increasing their GridX Value as they will no longer be showing in the correct era.
 
Glad they made the tech tree structure flexible to easy modding.

I was thinking about the extra pages you are adding in.

Can you use them for era specific techs? Like have a tech sitting there in the industrial that doesn't have prereqs but you can't research it until you get to industrial? Not sure if that is how it works or how it could work.

Basically in the extra pages you could have a few era specific techs that don't matter to the whole tree, and could even be things that aren't necessarily technologies.

Such as, you enter the medieval era and can then research into moats if you want. You don't have to waste points there since it isn't tied into an overarching line, but if you wanted to you could get good at medieval defensive structures.

Or you could even introduce religion with the extra pages. I think it would work pretty well conceptually, having your smart people advance your nation spiritually so to speak. You could have a page per religion. Perhaps figure out how to make each religion page exclusive to the others once you choose 1.

Could do the same for governments.

But perhaps religion and goverments would be better suited as extra pages in the social policy area since you could go anarchy for a turn to change them if you wanted to.

Just some thoughts.
 
I pretty much have the tech tree under my control now, thanks in large part to your help. :)


After I finish adding units and buildings to my new tech tree, I think I may give your mod a try and fill out the extra pages with what I will refer to as "Sub-Core" tech trees. Things that allow civilizations to specialize in areas that don't tie into the main tree, but could be very helpful nonetheless.

Things like the ability to specialize military units. Imagine learning tanks in the industrial, but then war breaks out. At that point you may want to research into tanks even more, giving you advanced versions of tanks. Basically Panthers and Tigers to your Shermans.

Stuff like that is at best weeks away, but I think your extra pages could add crazy amounts of tech tree flexibility in the future. :)



Also, can you also add pages to the social policy screen? The ability to have multiple screens of social policies, perhaps 1 for governments, 1 for religions, etc would be awesome.
 
I pretty much have the tech tree under my control now, thanks in large part to your help. :)


After I finish adding units and buildings to my new tech tree, I think I may give your mod a try and fill out the extra pages with what I will refer to as "Sub-Core" tech trees. Things that allow civilizations to specialize in areas that don't tie into the main tree, but could be very helpful nonetheless.

Things like the ability to specialize military units. Imagine learning tanks in the industrial, but then war breaks out. At that point you may want to research into tanks even more, giving you advanced versions of tanks. Basically Panthers and Tigers to your Shermans.

Stuff like that is at best weeks away, but I think your extra pages could add crazy amounts of tech tree flexibility in the future. :)



Also, can you also add pages to the social policy screen? The ability to have multiple screens of social policies, perhaps 1 for governments, 1 for religions, etc would be awesome.


Glad to hear that someone is thinking of using my mod at some point and that sounds like a nice idea on how it could be used.

I had a very brief look at the social policy screen before starting this mod and it did look possible to add multiple screens, however without a closer look at how the social policies work its hard to say how the policies on the new pages could be different from those on the main page. If someone doesn't do it before i get this mod to a point where i am happy with it then i will look into it further ;)



I should have some nice changes coming in V3 of BFTTree, i decided to be less lazy with my coding and hopeful it comes together soon so i can get it out.
 
I have just updated some information on this mod, see "Fun With Pipes" and the new screen shot in that post.
 
FF, I was just wondering, is it possible to have the extra pages be accessed by extra buttons in the main UI, instead of Up/Down buttons in the tech tree?

What I'm thinking is regarding Decimatus ideas: if you had a tree for religion, it could be accessed by a 'Religion' button instead of the Technology Tree button.
 
Back
Top Bottom