Looking for help - Custom Tech Tree

Dunabar

Chieftain
Joined
Sep 5, 2014
Messages
55
Location
United States
Hello Civ Fanatics!

So I'm ready to begin working on a rather large mod project I have in the works, but I haven't exactly figured out the best way to go about developing a custom tech tree. So without me constantly bothering a friend of mine with every little modding question I have, I figured I would make a effort to bug everyone here. This is of course after searching the forums first for answers :).

So my question is as followed..

Can I make this tech tree using XML and if so what are the key things I need to know when making this bedrock for my project? IE: How do I make a tech, branch it, add units, buildings, & improvements to it, and advance the tree through eras?

Thanks ahead of time to anyone who can help me with this.
:goodjob:
 
Yes you can do it all in XML, but if you also would like to alter the vanilla tech tree and keep it clean, i would suggest you do it via sql.

But thats just my opinion, and yes i have some tipps for creating technologies and all related stuff.

As one who managed to create a tech tree with 600 technologies at all, i guess i could offer my help to you.

But like i said it depends on what your trieng, if you will just add a few new technologies, then keep XML and do it the simple way, but if you are going to rerange a lot of prerequested technologies, you will find out that xml is very time consuming.

To your questions, all related stuff about technologies can you find in one file, the CiV5Technologies.xml (look under Steam..../Civ/Assests/DLC/Expansion2/Gameplay/XML/Expansions).

Code:
<Row>
			<Type>TECH_EXAMPLE</Type>
			<Cost>35</Cost>
			<Description>TXT_KEY_TECH_EXAMPLE_TITLE</Description>
			<Civilopedia>TXT_KEY_TECH_EXAMPLE_DESC</Civilopedia>
			<Help>TXT_KEY_TECH_EXAMPLE_HELP</Help>
			<Era>ERA_ANCIENT</Era>
			<Trade>true</Trade>
			<GoodyTech>true</GoodyTech>
			<GridX>3</GridX>
			<GridY>4</GridY>
			<Quote>TXT_KEY_TECH_EXAMPLE_QUOTE</Quote>
			<PortraitIndex>4</PortraitIndex>
			<IconAtlas>TECH_ATLAS_1</IconAtlas>
			<AudioIntro>AS2D_TECH_EXAMPLE</AudioIntro>
			<AudioIntroHeader>AS2D_HEADING_TECH_EXAMPLE</AudioIntroHeader>
		</Row>

This is just a example of how a new XMLtechnologie should look like.
The Grids define where the tech is located, if you use the same grids for more then one tech, it will messed up, so be carefully with that.

The audio entries can be ignored and simple removed, but if you would like to add your own sound to the tech, then this is doable, but a lot of work.

The era defines, to what era a technology belong, its very simple in vanilla, but for us modders, we need to keep attention of it.
It can end sometimes, that if you are n ot patience enough with prerequested techs, that someone enters a new era to quickly.

Spoiler :
<Column name="FirstFreeUnitClass" type="text" default="NULL"/>
<Column name="FeatureProductionModifier" type="integer" default="0"/>
<Column name="UnitFortificationModifier" type="integer" default="0"/>
<Column name="UnitBaseHealModifier" type="integer" default="0"/>
<Column name="WorkerSpeedModifier" type="integer" default="0"/>
<Column name="FirstFreeTechs" type="integer" default="0"/>
<Column name="EmbarkedMoveChange" type="integer" default="0"/>
<Column name="EndsGame" type="boolean" default="false"/>
<Column name="AllowsEmbarking" type="boolean" default="false"/>
<Column name="AllowsDefensiveEmbarking" type="boolean" default="false"/>
<Column name="EmbarkedAllWaterPassage" type="boolean" default="false"/>
<Column name="AllowsBarbarianBoats" type="boolean" default="false"/>
<Column name="Repeat" type="boolean" default="false"/>
<Column name="Trade" type="boolean" default="false"/>
<Column name="Disable" type="boolean" default="false"/>
<Column name="GoodyTech" type="boolean" default="false"/>
<Column name="ExtraWaterSeeFrom" type="boolean" default="false"/>
<Column name="MapCentering" type="boolean" default="false"/>
<Column name="MapVisible" type="boolean" default="false"/>
<Column name="MapTrading" type="boolean" default="false"/>
<Column name="TechTrading" type="boolean" default="false"/>
<Column name="GoldTrading" type="boolean" default="false"/>
<Column name="AllowEmbassyTradingAllowed" type="boolean" default="false"/>
<Column name="OpenBordersTradingAllowed" type="boolean" default="false"/>
<Column name="DefensivePactTradingAllowed" type="boolean" default="false"/>
<Column name="ResearchAgreementTradingAllowed" type="boolean" default="false"/>
<Column name="TradeAgreementTradingAllowed" type="boolean" default="false"/>
<Column name="PermanentAllianceTradingAllowed" type="boolean" default="false"/>
<Column name="BridgeBuilding" type="boolean" default="false"/>
<Column name="WaterWork" type="boolean" default="false"/>


In the spoiler, you see the vanilla colums that can be linked to a tech, i.e if a tech grants a new trade route.
Also important if you wish to reselect a column to another tech.

All units and buildings got there techprequest, and this is defined in there own table.

Ok that was a quick overview and i hope i helped you, feel free to ask some questions.
 
You Sir or Ma'am have earned yourself a special thanks spot easily in my mod. :D

I've never messed with SQL or Lua script and have learned enough XML stuff to steadily start moving forward, so that is part of the reason I asked if it's possible to do it via XML. As I said, I'm still getting use to all of this mod work.

I'm one of those people who thrives on challenge, but Lua script made my brain split in half. So if SQL is anything like Lua, I'm hooped lol.

Thank you very much! I will be sure to post any questions I may have in regards to this undertaking of mine.
 
Lua script made my brain split in half. So if SQL is anything like Lua, I'm hooped lol.
Don't despair. I was there about 6 months ago so far as lua was concerned. SQL triggers and such still just confuse the huh out of me.
 
sql is very handy when you want to change alot of similar stuff, e.g. change upgrade path for all the pikemen units, including UUs.
you just write
Code:
update Unit_ClassUpgrades set UnitClassType="UNITCLASS_RIFLEMAN" where UnitType in (select Type from Units where Class="UNITCLASS_PIKEMAN");
:cool:
 
sql is very handy when you want to change alot of similar stuff, e.g. change upgrade path for all the pikemen units, including UUs.
you just write
Code:
update Unit_ClassUpgrades set UnitClassType="UNITCLASS_RIFLEMAN" where UnitType in (select Type from Units where Class="UNITCLASS_PIKEMAN");
:cool:

Huh, that doesn't look bad at all, actually it looks like XML for the most part.
 
Huh, that doesn't look bad at all, actually it looks like XML for the most part.

on startup xml we mod is translated into sql and fed to the game's database.
thats why it resembles sql (<update><where ...></update> etc)
writing your mod directly in sql gives more flexibility as you can use more commands like the 'in' command in my example.
 
on startup xml we mod is translated into sql and fed to the game's database.
thats why it resembles sql (<update><where ...></update> etc)
writing your mod directly in sql gives more flexibility as you can use more commands like the 'in' command in my example.

Well this is something to consider indeed. Thank you very much for the help! :goodjob:
 
Yes can can do it all in XML, but if you also would like to alter the vanilla tech tree and keep it clean, i would suggest you do it via sql.

But thats just my opinion, and yes i have some tipps for creating technologies and all related stuff.

As one who managed to create a tech tree with 600 technologies at all, i guess i could offer my help to you.

But like i said it depends on what your trieng, if you will just add a few new technologies, then keep XML and do it the simple way, but if you are going to rerange a lot of prerequested technologies, you will find out that xml is very time consuming.
.

Yeah SQL is looking better and better at this point. I've been wracking my brains trying to find the best step by step process for designing a new tech tree for myself. Currently phase 1 of this is requiring me to perform the following.

-Rename Ancient Era into Rise of Clans
-Figure out at the very least 12 techs (Maybe more) for the Era.
-What each Tech will offer to the player.

The later kind of being more kicker than the rest only because I'm basing my mod off something where tech isn't explained, or how it came to be short of "This person and this group made it", or when it was exactly made. So it's sort of like feeling around in the dark.

Luckily the help you and Killmeplease provided have taken some of that pressure off of me. Now it's about at that point where I need to stumble around a bit and get the hang of it lol.
 
Yeah SQL is looking better and better at this point. I've been wracking my brains trying to find the best step by step process for designing a new tech tree for myself. Currently phase 1 of this is requiring me to perform the following.

-Rename Ancient Era into Rise of Clans
-Figure out at the very least 12 techs (Maybe more) for the Era.
-What each Tech will offer to the player.

The later kind of being more kicker than the rest only because I'm basing my mod off something where tech isn't explained, or how it came to be short of "This person and this group made it", or when it was exactly made. So it's sort of like feeling around in the dark.

Luckily the help you and Killmeplease provided have taken some of that pressure off of me. Now it's about at that point where I need to stumble around a bit and get the hang of it lol.

Admittedly, I think the actual coding for a tech tree is pretty straightforwards. A while back I played around with adding some new techs to the tree for a near-future mod, and was surprised at how little a tech actually needs. Like Gilgamesch indicated, all it really needs is a name, cost, era, its grid X and grid Y, and an icon, with its prerequisites listed in a seperate table. Once you've got the hang of making them they're pretty easy to do.

It's planning your whole tech tree that's the difficult part. :p

You don't actually need to add your units, buildings, and improvements to it, since that gets done automatically -- all your new things have to do is have your new technology listed as their prerequisite, and Civ will automatically put them in the tree for you.
 
It's planning your whole tech tree that's the difficult part. :p

Fully agreed;)

This is the most difficult place at all, i.e. iam still not 100% happy about the new CCTP ones.

But you always need to keep the whole tech tree balanced.

Here is the code you need to update the text for your era btw;)
Code:
<Language_en_US>
<!--Eras-->
<Update>
	<Set Text="Rise of Clans" />
	<Where Tag="TXT_KEY_ERA_1" />
</Update>
</Language_en_US>
 
Fully agreed;)

This is the most difficult place at all, i.e. iam still not 100% happy about the new CCTP ones.

But you always need to keep the whole tech tree balanced.

Here is the code you need to update the text for your era btw;)
Code:
<Language_en_US>
<!--Eras-->
<Update>
	<Set Text="Rise of Clans" />
	<Where Tag="TXT_KEY_ERA_1" />
</Update>
</Language_en_US>

Awesome, thank you very much.

Yeah I've re-made my 'tech tree' in blueprint form about four to five times. It's either missing something, flow is off, or it just feels bland. Sadly on top of being new at making mods, I'm also a perfectionist to the point where I've had work that I've spent six hours on, and deleted it after finding too much that I'm unpleased with. I'm actually going to re-do the tech tree one final time when I actually start punching in the XML and SQL stuff.

I got no idea how you managed 600 techs, Gilgamesch. My brain just about fried coming up with 76 of them for my tech tree. But once again, I'm also making a tech tree for something that has never been clear about technological advancement beyond "This person or people made it." So connecting the dots while not impossible, is still a little bit of a pain.

While we're on the subject. Is there a unmarked cap on Eras, or am I free to stretch my brains out more? lol.
 
I got no idea how you managed 600 techs, Gilgamesch. My brain just about fried coming up with 76 of them for my tech tree

Well, this was a long way, when i took over CCTP there was something like 100-120 techs, iam not sure its to long ago.

Since that time, what is now more then a year ago, i got a plan, but never got the time or the paticience for that.

Then sometimes, i thought why not end this work and hell :lol: i read some stuff from civ4 like caveman to cosmos and my favorite (old) game Alpha Centaurie.

Then i sleeped over the ideas and about the ways to fill all this new techs.

It was a long way, not to mention that i created more then 800 icons to polish all this stuff (techs(buildings/wonders and units).

Also i linked whowards amazing unifield yields to CCTP, and added awesome new improvements from Bouncy;)


You see its a long, maybe very long story, and yes sometimes you are stucked.
Iam also something like a perfectionist, and throwed several work into the garbage, but i stopped this thinking time ago.

Otherwise i will do the work on CCTP when i have white hair and iam to old:old: for it.

But it said to much, but i guess some advertising for CCTP isnt wrong, and since its the biggest mod outthere and maybe the really one that gives a huge impression how civ should look like, iam not so out of place.
 
But it said to much, but i guess some advertising for CCTP isnt wrong, and since its the biggest mod outthere and maybe the really one that gives a huge impression how civ should look like, iam not so out of place.

Na I don't see anything wrong it. I take inspiration from other people's work and just try not to copy it perfectly. Well, except for maybe Reforestation, I will have to talk to Framed about that one since I could use such a thing in my mod lol.
 
Na I don't see anything wrong it. I take inspiration from other people's work and just try not to copy it perfectly. Well, except for maybe Reforestation, I will have to talk to Framed about that one since I could use such a thing in my mod lol.

FA is one of the best examples here on fanatics, all his work is free for all, only he dislikes when you put the name on his works without any new add on.:lol:

We use so many parts of FA, that he should get his own tribut thread;)
 
FA is one of the best examples here on fanatics, all his work is free for all, only he dislikes when you put the name on his works without any new add on.:lol:

We use so many parts of FA, that he should get his own tribut thread;)

:lol:

I can agree to that. I friended him on Steam just because I was such fan for his Faerun mod and he was kind enough to not only accept that, but also kind enough to allow me to pick his brain. His Faerun mod has not only inspired the mod I'm currently working on, but another one that I got in planning down the line.
 
In case it's of use as a reference since it sort-of came up earlier, and dove-tailed nicely with a reference project I've been working on lately (and I had pulled this info into that reference project earlier today):

Eras Info:
Spoiler :
Era Information (G&K and BNW): C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\Expansion2\Gameplay\XML\GameInfo\CIV5Eras.xml

ID# Era Description Tag Strategy Tag
0 ERA_ANCIENT TXT_KEY_ERA_0 TXT_KEY_ERA_ANCIENT_STRATEGY
1 ERA_CLASSICAL TXT_KEY_ERA_1 TXT_KEY_ERA_CLASSICAL_STRATEGY
2 ERA_MEDIEVAL TXT_KEY_ERA_2 TXT_KEY_ERA_MEDIEVAL_STRATEGY
3 ERA_RENAISSANCE TXT_KEY_ERA_3 TXT_KEY_ERA_RENAISSANCE_STRATEGY
4 ERA_INDUSTRIAL TXT_KEY_ERA_4 TXT_KEY_ERA_INDUSTRIAL_STRATEGY
5 ERA_MODERN TXT_KEY_ERA_5 TXT_KEY_ERA_MODERN_STRATEGY
6 ERA_POSTMODERN TXT_KEY_ERA_6 TXT_KEY_ERA_POSTMODERN_STRATEGY
7 ERA_FUTURE TXT_KEY_ERA_7 TXT_KEY_ERA_FUTURE_STRATEGY

Era Information (Vanilla CIV5): C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\Gameplay\XML\GameInfo\CIV5Eras.xml

ID# Era Description Tag Strategy Tag
0 ERA_ANCIENT TXT_KEY_ERA_0 TXT_KEY_ERA_ANCIENT_STRATEGY
1 ERA_CLASSICAL TXT_KEY_ERA_1 TXT_KEY_ERA_CLASSICAL_STRATEGY
2 ERA_MEDIEVAL TXT_KEY_ERA_2 TXT_KEY_ERA_MEDIEVAL_STRATEGY
3 ERA_RENAISSANCE TXT_KEY_ERA_3 TXT_KEY_ERA_RENAISSANCE_STRATEGY
4 ERA_INDUSTRIALL TXT_KEY_ERA_4 TXT_KEY_ERA_INDUSTRIAL_STRATEGY
5 ERA_MODERN TXT_KEY_ERA_5 TXT_KEY_ERA_MODERN_STRATEGY
6 ERA_POSTMODERN TXT_KEY_ERA_6 TXT_KEY_ERA_FUTURE_STRATEGY
 
Are the strategy texts used anywhere?
I thought they had been used in the Civilopedia, which was why I included the tag references. But your question made me look at the Civilopedia more closely, and I wasn't able to see where there is anything that is used for the era strategy tags.

So far as I can see the eras are referenced in various places in the civilopedia, but never actually specifically ennumerated in the civilopedia. The discussion of social policy branches discusses which branch is unlocked by a particular era, for example. But nowhere is there an actual definition of the eras under game concepts or elsewhere.

Note: I am running the game using <Language_en_US>. Perhaps other-language versions of the game actually show info from the <Strategy> tags for eras ?
 
Here is the code you need to update the text for your era btw;)
Code:
<Language_en_US>
<!--Eras-->
<Update>
	<Set Text="Rise of Clans" />
	<Where Tag="TXT_KEY_ERA_1" />
</Update>
</Language_en_US>

Hey Gilagamesch. Is it possible to add two or more eras to my mod by following this same pattern?

I downloaded the Community power mod and just worked my way out of the pre-historic era and when I did it got me thinking of the other periods of time I can add to my mod. I know I would have to change numbers and names, but I'm curious to know if it's possible for me to add at least two more eras to my mod, or if I'm going to run into problems doing that.
 
Top Bottom