Is it possible to add a unique building without overriding?

JDHalfrack

Chieftain
Joined
Mar 18, 2009
Messages
35
Okay, I did the best I could to search before posting this. As a guy who used to do a lot of modding for Madden '08, I remember the "grrrrs" when a person would ask a question that's been asked 35 times before without searching. That said, my search found some promising threads, but they either didn't go the direction I was hoping, were super old, or didn't make sense.

Anyway, as the title suggests, I'd like to add a unique building to a civilization, but not one that overrides anything. for example, if my civ has a city with a monument, I want it to be able to build something that no other civilization can, but that doesn't get rid of any "default" buildings.

a) is this possible?
b) using only XML?
c) if a = yes and b = no, can some one give me a little shove in the right direction?

Thanks a bunch!

JD
 
a=true
b=true
c=no shoving really needed

In XML:
  1. Make a new building-class, but without a 'default' building in the class
    Spoiler :
    Code:
    <GameData>
    	<BuildingClasses>
    		<Row>
    			<Type>BUILDINGCLASS_NEW_BUILDING</Type>
    			<Description>TXT_KEY_BUILDING_NEW_BUILDING</Description>
    		</Row>
    	</BuildingClasses>
  2. Stick your new building into the new building-class by the way you do the reference in the <Buildings> table:
    Spoiler :
    Code:
    <GameData>
    	<BuildingClasses>
    		<Row>
    			<Type>[COLOR="Blue"]BUILDINGCLASS_NEW_BUILDING[/COLOR]</Type>
    			<Description>TXT_KEY_BUILDING_NEW_BUILDING</Description>
    		</Row>
    	</BuildingClasses>
    	<Buildings>
    		<Row>
    			<Type>BUILDING_NEW_BUILDING</Type>
    			[COLOR="blue"]<BuildingClass>BUILDINGCLASS_NEW_BUILDING</BuildingClass>[/COLOR]
    			<Cost>100</Cost>
    			<GoldMaintenance>1</GoldMaintenance>
    			<PrereqTech>TECH_MATHEMATICS</PrereqTech>
    			<FreeStartEra>ERA_RENAISSANCE</FreeStartEra>
    			<Help>TXT_KEY_BUILDING_NEW_BUILDING_HELP</Help>
    			<Description>TXT_KEY_BUILDING_NEW_BUILDING</Description>
    			<Civilopedia>TXT_KEY_BUILDING_NEW_BUILDING_PEDIA</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_NEW_BUILDING_STRATEGY</Strategy>
    			<ArtDefineTag>NONE</ArtDefineTag>
    			<MinAreaSize>-1</MinAreaSize>
    			<NeverCapture>true</NeverCapture>
    			<IconAtlas>NEW_BUILDING_ATLAS</IconAtlas>
    			<PortraitIndex>0</PortraitIndex>
    		</Row>
    	</Buildings>
  3. Make the new building require a monument-class building in the city:
    Spoiler :
    Code:
    <GameData>
    	<BuildingClasses>
    		<Row>
    			<Type>BUILDINGCLASS_NEW_BUILDING</Type>
    			<Description>TXT_KEY_BUILDING_NEW_BUILDING</Description>
    		</Row>
    	</BuildingClasses>
    	<Buildings>
    		<Row>
    			<Type>[COLOR="Blue"]BUILDING_NEW_BUILDING[/COLOR]</Type>
    			<BuildingClass>BUILDINGCLASS_NEW_BUILDING</BuildingClass>
    			<Cost>100</Cost>
    			<GoldMaintenance>1</GoldMaintenance>
    			<PrereqTech>TECH_MATHEMATICS</PrereqTech>
    			<FreeStartEra>ERA_RENAISSANCE</FreeStartEra>
    			<Help>TXT_KEY_BUILDING_NEW_BUILDING_HELP</Help>
    			<Description>TXT_KEY_BUILDING_NEW_BUILDING</Description>
    			<Civilopedia>TXT_KEY_BUILDING_NEW_BUILDING_PEDIA</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_NEW_BUILDING_STRATEGY</Strategy>
    			<ArtDefineTag>NONE</ArtDefineTag>
    			<MinAreaSize>-1</MinAreaSize>
    			<NeverCapture>true</NeverCapture>
    			<IconAtlas>NEW_BUILDING_ATLAS</IconAtlas>
    			<PortraitIndex>0</PortraitIndex>
    		</Row>
    	</Buildings>
    	[COLOR="blue"]<Building_ClassesNeededInCity>
    		<Row>
    			<BuildingType>BUILDING_NEW_BUILDING</BuildingType>
    			<BuildingClassType>BUILDINGCLASS_MONUMENT</BuildingClassType>
    		</Row>
    	</Building_ClassesNeededInCity>[/COLOR]
  4. Then assign the new building specific to your civ, in this case using India as an example, and locking Barbarians and Minor Civs (City-States) from being able to construct the building:
    Spoiler :
    Code:
    <GameData>
    	<BuildingClasses>
    		<Row>
    			<Type>[COLOR="Blue"]BUILDINGCLASS_NEW_BUILDING[/COLOR]</Type>
    			<Description>TXT_KEY_BUILDING_NEW_BUILDING</Description>
    		</Row>
    	</BuildingClasses>
    	<Buildings>
    		<Row>
    			<Type>[COLOR="blue"]BUILDING_NEW_BUILDING[/COLOR]</Type>
    			<BuildingClass>BUILDINGCLASS_NEW_BUILDING</BuildingClass>
    			<Cost>100</Cost>
    			<GoldMaintenance>1</GoldMaintenance>
    			<PrereqTech>TECH_MATHEMATICS</PrereqTech>
    			<FreeStartEra>ERA_RENAISSANCE</FreeStartEra>
    			<Help>TXT_KEY_BUILDING_NEW_BUILDING_HELP</Help>
    			<Description>TXT_KEY_BUILDING_NEW_BUILDING</Description>
    			<Civilopedia>TXT_KEY_BUILDING_NEW_BUILDING_PEDIA</Civilopedia>
    			<Strategy>TXT_KEY_BUILDING_NEW_BUILDING_STRATEGY</Strategy>
    			<ArtDefineTag>NONE</ArtDefineTag>
    			<MinAreaSize>-1</MinAreaSize>
    			<NeverCapture>true</NeverCapture>
    			<IconAtlas>NEW_BUILDING_ATLAS</IconAtlas>
    			<PortraitIndex>0</PortraitIndex>
    		</Row>
    	</Buildings>
    	<Building_ClassesNeededInCity>
    		<Row>
    			<BuildingType>BUILDING_NEW_BUILDING</BuildingType>
    			<BuildingClassType>BUILDINGCLASS_MONUMENT</BuildingClassType>
    		</Row>
    	</Building_ClassesNeededInCity>
    	<Civilization_BuildingClassOverrides>
    		<Row>
    			<CivilizationType>CIVILIZATION_BARBARIAN</CivilizationType>
    			<BuildingClassType>BUILDINGCLASS_NEW_BUILDING</BuildingClassType>
    			<BuildingType/>
    		</Row>
    		<Row>
    			<CivilizationType>CIVILIZATION_MINOR</CivilizationType>
    			<BuildingClassType>BUILDINGCLASS_NEW_BUILDING</BuildingClassType>
    			<BuildingType/>
    		</Row>
    		[COLOR="blue"]<Row>
    			<CivilizationType>CIVILIZATION_INDIA</CivilizationType>
    			<BuildingClassType>BUILDINGCLASS_NEW_BUILDING</BuildingClassType>
    			<BuildingType>BUILDING_NEW_BUILDING</BuildingType>
    		</Row>[/COLOR]
    	</Civilization_BuildingClassOverrides>
    Though the bit with Barbarians and Minor civs is probably not required in this specific case.
  5. Add Language tags, and the basic code of the building is completed:
    Spoiler :
    Code:
    <GameData>
    	<BuildingClasses>
    		<Row>
    			<Type>BUILDINGCLASS_NEW_BUILDING</Type>
    			<Description>TXT_KEY_BUILDING_NEW_BUILDING</Description>
    		</Row>
    	</BuildingClasses>
    	<Buildings>
    		<Row>
    			<Type>BUILDING_NEW_BUILDING</Type>
    			<BuildingClass>BUILDINGCLASS_NEW_BUILDING</BuildingClass>
    			<Cost>100</Cost>
    			<GoldMaintenance>1</GoldMaintenance>
    			<PrereqTech>TECH_MATHEMATICS</PrereqTech>
    			<FreeStartEra>ERA_RENAISSANCE</FreeStartEra>
    			<Help>[COLOR="blue"]TXT_KEY_BUILDING_NEW_BUILDING_HELP[/COLOR]</Help>
    			<Description>[COLOR="seagreen"]TXT_KEY_BUILDING_NEW_BUILDING[/COLOR]</Description>
    			<Civilopedia>[COLOR="Red"]TXT_KEY_BUILDING_NEW_BUILDING_PEDIA[/COLOR]</Civilopedia>
    			<Strategy>[COLOR="magenta"]TXT_KEY_BUILDING_NEW_BUILDING_STRATEGY[/COLOR]</Strategy>
    			<ArtDefineTag>NONE</ArtDefineTag>
    			<MinAreaSize>-1</MinAreaSize>
    			<NeverCapture>true</NeverCapture>
    			<IconAtlas>NEW_BUILDING_ATLAS</IconAtlas>
    			<PortraitIndex>0</PortraitIndex>
    		</Row>
    	</Buildings>
    	<Building_ClassesNeededInCity>
    		<Row>
    			<BuildingType>BUILDING_NEW_BUILDING</BuildingType>
    			<BuildingClassType>BUILDINGCLASS_MONUMENT</BuildingClassType>
    		</Row>
    	</Building_ClassesNeededInCity>
    	<Civilization_BuildingClassOverrides>
    		<Row>
    			<CivilizationType>CIVILIZATION_BARBARIAN</CivilizationType>
    			<BuildingClassType>BUILDINGCLASS_NEW_BUILDING</BuildingClassType>
    			<BuildingType/>
    		</Row>
    		<Row>
    			<CivilizationType>CIVILIZATION_MINOR</CivilizationType>
    			<BuildingClassType>BUILDINGCLASS_NEW_BUILDING</BuildingClassType>
    			<BuildingType/>
    		</Row>
    		<Row>
    			<CivilizationType>CIVILIZATION_INDIA</CivilizationType>
    			<BuildingClassType>BUILDINGCLASS_NEW_BUILDING</BuildingClassType>
    			<BuildingType>BUILDING_NEW_BUILDING</BuildingType>
    		</Row>
    	</Civilization_BuildingClassOverrides>
    	<Language_en_US>
    		<!-- In-game name of the building -->
    		<Row Tag="[COLOR="SeaGreen"]TXT_KEY_BUILDING_NEW_BUILDING[/COLOR]">
    			<Text>Name your building here</Text>
    		</Row>
    
    		<!-- Pop-up "Help" text -->
    		<Row Tag="[COLOR="blue"]TXT_KEY_BUILDING_NEW_BUILDING_HELP[/COLOR]">
    			<Text>
    				Pop-Up Help Info on the building here.  You can add such things as the culture icon [ICON_CULTURE].
    				[NEWLINE]Or you can start a new line of text, and insert the science beaker icon [ICON_RESEARCH].
    				[NEWLINE]You can structure your commands as I have done for this "help" entry, or you can do it in the more standard way
    				[NEWLINE]as the other text entries are shown.
    				[NEWLINE]You can add such things as text color commands which would [COLOR_POSITIVE_TEXT]make THIS bit of text show up green.[ENDCOLOR]
    			</Text>
    		</Row>
    
    		<!-- "Strategy" Entry -->
    		<Row Tag="[COLOR="Magenta"]TXT_KEY_BUILDING_NEW_BUILDING_STRATEGY[/COLOR]">
    			<Text>Add an entry to the civilopedia that tells the player why they should build this building.</Text>
    		</Row>
    
    		<!-- Civilopedia Entry -->
    		<Row Tag="[COLOR="red"]TXT_KEY_BUILDING_NEW_BUILDING_PEDIA[/COLOR]">
    			<Text>Historical info on the building goes here. Otherwise, a more generic discussion of the building, or even just a repeat of the "strategy" info</Text>
    		</Row>
    	</Language_en_US>
    <GameData>
  6. The building as shown doesn't actually have any effects as yet (such as adding a culture point or two per turn), nor does it have flavors so an AI player would know what to do with it.
 
It's really this easy?

I'll be honest... I didn't even try to just create a building class. I thought that'd be harder than just editing XML.

I'll go ahead and give this a shot. Thanks a bunch man!

JD
 
One other thing: the basic code of that example came from a template I often use, but there's no existing IconAtlas called NEW_BUILDING_ATLAS.

For testing purposes you could use the monument's icon, so you would replace with this:
Code:
			<IconAtlas>BW_ATLAS_1</IconAtlas>
			<PortraitIndex>21</PortraitIndex>
in place of what was in the code in post #2 for those two column commands
 
Yeah, this worked like a charm, thanks again, man!

Also, thanks for all the extra info even though I had all the other stuff down. I just can't believe I didn't even try to just create a buildingclass... I kind of feel dumb :)

You're the man!

JD
 
I know it's not exactly what the topic is about (and I'm quite new here so I hope I don't get banned) but... well still connected(and I do some research before but I can't).
A few times I experiment with playing with the xml files. So I thought about reshaping one of the current civilizations... I already do experiments like adding some new traits (I mean like add more treats to one leader) or unique unit or buildings - ant it work perfectly fine (just attempts to add some other special improvements get kinda messy effects...) - and considering it kind of skip loading mods part it could be quite useful sometime.
But when Instead of that I try to add some new unique building, its class kind of disappear. I mean i tried also with palace and... when I create my first city It doesn't have it. The same happened in case of monument - it wasn't in build options... actually both building options (production) and list of already build buildings disappear. But not only from the city menu, they disappear also from the tech tree! I completely don't know what could go wrong.
I mean while creating new unique building which as usually overrides some other there is no new class to add, so all needed data are in apropriate(I mean it could be in the "_Expansion2" or "_Expansion2_inherited" version) CIV5Building.xml and CIV5CIvilizations.xml files. So why it isn't working? What am I missing?
Could putting the text directly in those XML files (because when its just for my experimental personal use it's more convienient way) be the reason? (I highly doubt that - in case of the civilization it seems to work fine (excluding not displaying correctly the diactric))

I give example of one of this buildings. So let's assume that I want to "reshape" Maroccan civilization and I want to give them (under their new name which doesn't really matter here) library replacement I called "Dragon library", which has higher maintance cost but beside normal benefits gives also +1 culture, faith and great writer points. Also as I completely can't create any decent graphics i decide to use Royal Library art for this building.

So the lines for my "Dragon Library" looks like this:
in CIV5Building_Expansion2.xml
<GameData>
<Buildings>
<Row>
<Type>BUILDING_DRAGON_LIBRARY</Type>
<BuildingClass>BUILDINGCLASS_LIBRARY</BuildingClass>
<FreeStartEra>ERA_INDUSTRIAL</FreeStartEra>
<Cost>80</Cost>
<GoldMaintenance>2</GoldMaintenance>
<SpecialistType>SPECIALIST_WRITER</SpecialistType>
<GreatPeopleRateChange>1</GreatPeopleRateChange>
<PrereqTech>TECH_WRITING</PrereqTech>
<Help>Daje 1 nauki [ICON_SICENCE] za każdych 2 obywateli [ICON_CITIZEN] a także +1 kultury [ICON_CULTURE] i +1 wiary [ICON_FAITH] oraz zapewnia jedno miejsce naukowca</Help>
<Description>Biblioteka rodu Doragonów.</Description>
<Civilopedia>Ród Doragonów od zawsze cenił wiedzę, więc biblioteki były w jego społeczności szczególnym miejscem. Stanowiły nie tylko imponujący zbiór ksiąg, zawierających wiedzę z całego świata, zebraną podczas okresu Wielkiej Tułaczki, ale były też lubianym miejscem spotkań i dyskusji towarzyskich, na tematy filozoficzne, naukowe i religijne. Ponadto młodzież szkoliła się tam w sztuce pisania i tworzenia własnych utworów.</Civilopedia>
<Strategy>Smocze Biblioteki Doragonów choć droższe w utrzymaniu zapewnią także punkty kultury i wiary oraz wielkich pisarzy</Strategy>
<ArtDefineTag>ART_DEF_BUILDING_LIBRARY</ArtDefineTag>
<MinAreaSize>-1</MinAreaSize>
<ConquestProb>0</ConquestProb>
<HurryCostModifier>25</HurryCostModifier>
<IconAtlas>EXPANSION2_BUILDING_ATLAS</IconAtlas>
<NeverCapture>true</NeverCapture>
<PortraitIndex>3</PortraitIndex>
</Row>
</Buildings>
<Building_Flavors>
<Row>
<BuildingType>BUILDING_DRAGON_LIBRARY</BuildingType>
<FlavorType>FLAVOR_SCIENCE</FlavorType>
<Flavor>25</Flavor>
</Row>
</Building_Flavors>
<Building_YieldChanges>
<Row>
<BuildingType>BUILDING_DRAGON_LIBRARY</BuildingType>
<YieldType>YIELD_CULTURE</YieldType>
<Yield>1</Yield>
</Row>
<Row>
<BuildingType>BUILDING_DRAGON_LIBRARY</BuildingType>
<YieldType>YIELD_FAITH</YieldType>
<Yield>1</Yield>
</Row>
</Building_YieldChanges>
<Building_YieldChangesPerPop>
<Row>
<BuildingType>BUILDING_DORAGON_LIBRARY</BuildingType>
<YieldType>YIELD_SCIENCE</YieldType>
<Yield>50</Yield>
</Row>
</Building_YieldChangesPerPop>
</GameData>
and in CIV5CIvilizations_Expansion2.xml
<GameData>
<Civilization_BuildingClassOverrides>
<Row>
<CivilizationType>CIVILIZATION_MOROCCO</CivilizationType>
<BuildingClassType>BUILDINGCLASS_LIBRARY</BuildingClassType>
<BuildingType>BUILDING_DORAGON_LIBRARY</BuildingType>
</Row>
</Civilization_BuildingClassOverrides>
</GameData>

Anyone know what I miss or do wrong?
 
From your description of the error, it sounds like you've got an error that's causing the entire Civ5Buildings.xml file not to load, hence the game failing to recognize the existence of the palace, monument, etc. It's hard to say exactly what's causing this, but if you enable logging, then your Database.log file should provide an answer. (Incidentally, for the future I'd recommend doing modding in new XML files, rather than changing core game files— that way, if you make mistakes, it won't knock out whole sections of the game.)

Another thing I noticed: your building is defined with BUILDING_DRAGON_LIBRARY as its type, but in the Civilization_BuildingClassOverrides table (as well as Building_YieldChangesPerPop, incidenally) it's spelled as BUILDING_DORAGON_LIBRARY instead. This won't be the cause of the aforementioned error, but it will prevent Morocco from being able to build your building.
 
Ok, it was already some time ago since You replied, but only recently I could do this logging debugging (or whataver we would name itd) and well actually problems are not only in buildings (well I modified more than just buildings, though in that topic the errors were most game-breaking) some errors I could fix myself, but some of them I didn't understand/not know for sure how to fix. (Actually this naming issue wasn't in my actual files, but here just stayed as residue from different naming conception - this 'o' isn't actually an error, but comes from the family name which is the core of this civilization idea. Anyway that just ingame-story details which don't affect mechanic in any way)
So first problem is with traits, when I wanted to add bonus missionary spreading in a civilization, so I add
Code:
<ExtraMissionarySpreads>1</ExtraMissionarySpreads>
Well the game seems to working perfectly fine but I didn't have missionary yet to test it (well maybe I should just do some testing with ingame editor...)
The second... is a completely different story actually (though go to anywhere with it was possible thanks to You showing me that logging feature - so really thanks for that!) i has some XML, and some Lua to create worng solution... the problem is my solution is not working - I described the entire issue here, so I won't unnecessery double it.
 
<ExtraMissionarySpreads> does not belong in table <Traits>

You cannot borrow a column-name from one game-table and jam it into another game-table. Databases do not work like that.
 
Hm... well I thought that if it is already some attribute that exist ingame, then it will automatically link into any new table i put it... well when I think more of it i see it's quite naive, I should know better that to expect inteligent behaviour from game engine...
But fortunately I have just the perfect workaround from that: as Civilization I wanted use it for is a one-city civ anyway (can't produce settler nor annex cities) I could just add it to palace replacement.

Also, while trying out my experimental Civ I wonder why when I put to the special building the following entry for YieldModifiers:
Code:
<Row>
            <BuildingType>BUILDING_SEVEN_DRAGONS_PALACE</BuildingType>
            <YieldType>YIELD_FAITH</YieldType>
            <Yield>33</Yield>
</Row>
It seems to not have any effects in game
The same comes to culture, surprisingly, though that one could be relatively easily worked around.
 
Because table Building_YieldModifiers was never hooked up at the game's SourceCode (ie, DLL) level to make either Faith or Culture work for the table.

See https://forums.civfanatics.com/thre...o-brave-new-world.525486/page-3#post-13203257

The game uses an SQL database, and therefore conforms to the requirements of an SQL database. Columns must first be defined within a table in order for the database to accept usage of the column within that specific table. For example, this bit defines all the columns that can be used in the Brave New World expansion for table <Buildings>:
Spoiler Buildings Definition :
Code:
<GameData>
	<!-- Table definition -->
	<Table name="Buildings">
		<Column name="ID" type="integer" primarykey="true" autoincrement="true"/>
		<Column name="Type" type="text" notnull="true" unique="true"/>
		<Column name="Description" type="text" reference="Language_en_US(Tag)"/>
		<Column name="Civilopedia" type="text" reference="Language_en_US(Tag)"/>
		<Column name="Strategy" type="text" reference="Language_en_US(Tag)"/>
		<Column name="Help" type="text" reference="Language_en_US(Tag)"/>
		<Column name="ThemingBonusHelp" type="text" reference="Language_en_US(Tag)"/>
		<Column name="Quote" type="text" reference="Language_en_US(Tag)"/>
		<Column name="GoldMaintenance" type="integer" default="0"/>
		<Column name="MutuallyExclusiveGroup" type="integer" default="-1"/>
		<Column name="TeamShare" type="boolean" default="false"/>
		<Column name="Water" type="boolean" default="false"/>
		<Column name="River" type="boolean" default="false"/>
		<Column name="FreshWater" type="boolean" default="false"/>
		<Column name="Mountain" type="boolean" default="false"/>
		<Column name="NearbyMountainRequired" type="boolean" default="false"/>
		<Column name="Hill" type="boolean" default="false"/>
		<Column name="Flat" type="boolean" default="false"/>
		<Column name="FoundsReligion" type="boolean" default="false"/>
		<Column name="IsReligious" type="boolean" default="false"/>
		<Column name="BorderObstacle" type="boolean" default="false"/>
		<Column name="PlayerBorderObstacle" type="boolean" default="false"/>
		<Column name="Capital" type="boolean" default="false"/>
		<Column name="GoldenAge" type="boolean" default="false"/>
		<Column name="MapCentering" type="boolean" default="false"/>
		<Column name="NeverCapture" type="boolean" default="false"/>
		<Column name="NukeImmune" type="boolean" default="false"/>
		<Column name="AllowsWaterRoutes" type="boolean" default="false"/>
		<Column name="ExtraLuxuries" type="boolean" default="false"/>
		<Column name="DiplomaticVoting" type="boolean" default="false"/>
		<Column name="AffectSpiesNow" type="boolean" default="false"/>
		<Column name="NullifyInfluenceModifier" type="boolean" default="false"/>
		<Column name="Cost" type="integer" default="0"/>
		<Column name="FaithCost" type="integer" default="0"/>
		<Column name="LeagueCost" type="integer" default="0"/>
		<Column name="UnlockedByBelief" type="boolean" default="0"/>
		<Column name="UnlockedByLeague" type="boolean" default="false"/>
		<Column name="HolyCity" type="boolean" default="0"/>
		<Column name="NumCityCostMod" type="integer" default="0"/>
		<Column name="HurryCostModifier" type="integer" default="0"/>
		<Column name="MinAreaSize" type="integer" default="0"/>
		<Column name="ConquestProb" type="integer" default="0"/>
		<Column name="CitiesPrereq" type="integer" default="0"/>
		<Column name="LevelPrereq" type="integer" default="0"/>
		<Column name="CultureRateModifier" type="integer" default="0"/>
		<Column name="GlobalCultureRateModifier" type="integer" default="0"/>
		<Column name="GreatPeopleRateModifier" type="integer" default="0"/>
		<Column name="GlobalGreatPeopleRateModifier" type="integer" default="0"/>
		<Column name="GreatGeneralRateModifier" type="integer" default="0"/>
		<Column name="GreatPersonExpendGold" type="integer" default="0"/>
		<Column name="GoldenAgeModifier" type="integer" default="0"/>
		<Column name="UnitUpgradeCostMod" type="integer" default="0"/>
		<Column name="Experience" type="integer" default="0"/>
		<Column name="GlobalExperience" type="integer" default="0"/>
		<Column name="FoodKept" type="integer" default="0"/>
		<Column name="Airlift" type="boolean" default="0"/>
		<Column name="AirModifier" type="integer" default="0"/>
		<Column name="NukeModifier" type="integer" default="0"/>
		<Column name="NukeExplosionRand" type="integer" default="0"/>
		<Column name="HealRateChange" type="integer" default="0"/>
		<Column name="Happiness" type="integer" default="0"/>
		<Column name="UnmoddedHappiness" type="integer" default="0"/>
		<Column name="UnhappinessModifier" type="integer" default="0"/>
		<Column name="HappinessPerCity" type="integer" default="0"/>
		<Column name="HappinessPerXPolicies" type="integer" default="0"/>
		<Column name="CityCountUnhappinessMod" type="integer" default="0"/>
		<Column name="NoOccupiedUnhappiness" type="boolean" default="false"/>
		<Column name="WorkerSpeedModifier" type="integer" default="0"/>
		<Column name="MilitaryProductionModifier" type="integer" default="0"/>
		<Column name="SpaceProductionModifier" type="integer" default="0"/>
		<Column name="GlobalSpaceProductionModifier" type="integer" default="0"/>
		<Column name="BuildingProductionModifier" type="integer" default="0"/>
		<Column name="WonderProductionModifier" type="integer" default="0"/>
		<Column name="CityConnectionTradeRouteModifier" type="integer" default="0"/>
		<Column name="CapturePlunderModifier" type="integer" default="0"/>
		<Column name="PolicyCostModifier" type="integer" default="0"/>
		<Column name="PlotCultureCostModifier" type="integer" default="0"/>
		<Column name="GlobalPlotCultureCostModifier" type="integer" default="0"/>
		<Column name="PlotBuyCostModifier" type="integer" default="0"/>
		<Column name="GlobalPlotBuyCostModifier" type="integer" default="0"/>
		<Column name="GlobalPopulationChange" type="integer" default="0"/>
		<Column name="TechShare" type="integer" default="0"/>
		<Column name="FreeTechs" type="integer" default="0"/>
		<Column name="FreePolicies" type="integer" default="0"/>
		<Column name="FreeGreatPeople" type="integer" default="0"/>
		<Column name="MedianTechPercentChange" type="integer" default="0"/>
		<Column name="Gold" type="integer" default="0"/>
		<Column name="AllowsRangeStrike" type="boolean" default="false"/>
		<Column name="Espionage" type="boolean" default="false"/>
		<Column name="AllowsFoodTradeRoutes" type="boolean" default="false"/>
		<Column name="AllowsProductionTradeRoutes" type="boolean" default="false"/>
		<Column name="Defense" type="integer" default="0"/>
		<Column name="ExtraCityHitPoints" type="integer" default="0"/>
		<Column name="GlobalDefenseMod" type="integer" default="0"/>
		<Column name="MinorFriendshipChange" type="integer" default="0"/>
		<Column name="VictoryPoints" type="integer" default="0"/>
		<Column name="ExtraMissionarySpreads" type="integer" default="0"/>
		<Column name="ReligiousPressureModifier" type="integer" default="0"/>
		<Column name="EspionageModifier" type="integer" default="0"/>
		<Column name="GlobalEspionageModifier" type="integer" default="0"/>
		<Column name="ExtraSpies" type="integer" default="0"/>
		<Column name="SpyRankChange" type="integer" default="0"/>
		<Column name="InstantSpyRankChange" type="integer" default="0"/>
		<Column name="TradeRouteRecipientBonus" type="integer" default="0"/>
		<Column name="TradeRouteTargetBonus" type="integer" default="0"/>
		<Column name="NumTradeRouteBonus" type="integer" default="0"/>
		<Column name="LandmarksTourismPercent" type="integer" default="0"/>
		<Column name="InstantMilitaryIncrease" type="integer" default="0"/>
		<Column name="GreatWorksTourismModifier" type="integer" default="0"/>
		<Column name="XBuiltTriggersIdeologyChoice" type="integer" default="0"/>
		<Column name="TradeRouteSeaDistanceModifier" type="integer" default="0"/>
		<Column name="TradeRouteSeaGoldBonus" type="integer" default="0"/>
		<Column name="TradeRouteLandDistanceModifier" type="integer" default="0"/>
		<Column name="TradeRouteLandGoldBonus" type="integer" default="0"/>
		<Column name="CityStateTradeRouteProductionModifier" type="integer" default="0"/>
		<Column name="GreatScientistBeakerModifier" type="integer" default="0"/>
		<Column name="BuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
		<Column name="ArtDefineTag" type="text" default="NULL"/>
		<Column name="NearbyTerrainRequired" type="text" reference="Terrains(Type)" default="NULL"/>
		<Column name="ProhibitedCityTerrain" type="text" reference="Terrains(Type)" default="NULL"/>
		<Column name="VictoryPrereq" type="text" reference="Victories(Type)" default="NULL"/>
		<Column name="FreeStartEra" type="text" reference="Eras(Type)" default="NULL"/>
		<Column name="MaxStartEra" type="text" reference="Eras(Type)" default="NULL"/>
		<Column name="ObsoleteTech" type="text" reference="Technologies(Type)" default="NULL"/>
		<Column name="EnhancedYieldTech" type="text" reference="Technologies(Type)" default="NULL"/>
		<Column name="TechEnhancedTourism" type="integer" default="0"/>
		<Column name="FreeBuilding" type="text" reference="BuildingClasses(Type)" default="NULL"/>
		<Column name="FreeBuildingThisCity" type="text" reference="BuildingClasses(Type)" default="NULL"/>
		<Column name="FreePromotion" type="text" reference="UnitPromotions(Type)" default="NULL"/>
		<Column name="TrainedFreePromotion" type="text" reference="UnitPromotions(Type)" default="NULL"/>
		<Column name="FreePromotionRemoved" type="text" reference="UnitPromotions(Type)" default="NULL"/>
		<Column name="ReplacementBuildingClass" type="text" reference="BuildingClasses(Type)" default="NULL"/>
		<Column name="PrereqTech" type="text" reference="Technologies(Type)" default="NULL"/>
		<Column name="PolicyBranchType" type="text" reference="PolicyBranchTypes(Type)" default="NULL"/>
		<Column name="SpecialistType" type="text" reference="Specialists(Type)" default="NULL"/>
		<Column name="SpecialistCount" type="integer" default="0"/>
		<Column name="GreatWorkSlotType" type="text" reference="GreatWorkSlots(Type)" default="NULL"/>
		<Column name="FreeGreatWork" type="text" reference="GreatWorks(Type)" default="NULL"/>
		<Column name="GreatWorkCount" type="integer" default="0"/>
		<Column name="SpecialistExtraCulture" type="integer" default="0"/>
		<Column name="GreatPeopleRateChange" type="integer" default="0"/>
		<Column name="ExtraLeagueVotes" type="integer" default="0"/>
		<Column name="CityWall" type="boolean" default="false"/>
		<Column name="DisplayPosition" type="integer" default="0"/>
		<Column name="PortraitIndex" type="integer" default="-1"/>
		<Column name="WonderSplashImage" type="text" default="NULL"/>
		<Column name="WonderSplashAnchor" type="text" default="R,T"/>
		<Column name="WonderSplashAudio" type="text"/>
		<Column name="IconAtlas" type="text" default="NULL" reference="IconTextureAtlases(Atlas)"/>
		<Column name="ArtInfoCulturalVariation" type="boolean" default="false"/>
		<Column name="ArtInfoEraVariation" type="boolean" default="false"/>
		<Column name="ArtInfoRandomVariation" type="boolean" default="false"/>
	</Table>
Nothing that is not in this definition can be used in this specific table. SQL is a static system in that only those columns and tables that have been pre-defined to be used within that specific database are allowed.

However, an SQL database is merely text laying within a DB or SQLite file. In and of itself it does absolutely nothing. The columns that are used within the tables must be "hooked-up" to the game's DLL sourcecode. This is done by brute-force coding on the part of Firaxis to make the game's sourcecode DLL pull needed data from the SQL database and for each row found within a specific table do X. In the case of a YieldType, each Yield that will be implemented must specifically be coded at the Sourcecode level to "do" what that sort of yield ought to do.
 
Considering how flexible and modder friendly this game seems to be it's very suprising that some yields are not working, or to say it in other way: that the very fact of existing of certain yield and its unique identificator (like "YIELD_FAITH") wouldn't be enough to use any kind of yield in any yield-connected effects. I mean really why the yields type aren't just a parameter (that possible values doesn't have to be fixed to certain list... because that way that's not that much of parameter actually...) especially that the very structure of the XML files strongly suggest that... honestly I would be surprised if there wasn't any fanmade workaround to "fix" this inflixibility of modding system. (I don't know like maybe library which make yield type an actual parameter?)

Anyway that doesn't actually answer my question. I realize that it's quite simple workaround with culture (<GlobalCultureRateModifier> or <CultureRateModifier> tags) but the link doesn't contain information of any work around for faith, what would be realy useful. Because really, why we can't have modifiers for faith?
 
Last edited:
There is no direct work-around for Faith for Modifier tables.

Most people use an lua script to accomplish the desired result, but these methods have their own issues.

--------------------------------------------------

There are actually two modded DLL mods I know of available that fix all these issues in all pertinent tables:
  1. William Howard's Various Mods Components DLL mod
  2. The CP (ie, Community Patch) DLL mod made originally to be a community use project but primarily now design-crept into being essentially the engine upon which Vox Populi runs
William Howard pretty much lead the effort to work through all the pertinent tables and add the needed code to all the DLL functions and calls to implement truly unified yield implementation. It was labor-intensive.

Using a DLL mod however means that by definition you cannot as a player use any competing DLL mod, nor in many cases do many other mods work properly when a user is running a DLL mod.

--------------------------------------------------------------

You have to bear I mind that
  1. Faith was not an original Yield. It was added to the game by the Gods & Kings expansion.
  2. Hooking up Database tables to new ingame effects (such as an added Yield-Type) is heavily labor-intensive.
  3. Yields do not have an inherent and universal application.
    • Food does one sort of thing, namely allow cities to grow population, and is "sent" to the city.
    • Gold does another thing, namely allow the purchasing of stuff and the payment of maintenance, and is "sent" through the city to the empire
    • Production does yet something else -- ie, it is the "score" by which completion of city projects is kept
    • Culture has yet a fourth unique purpose, and is not used at all directly by cities except to culturally expand borders, which is not controllable or selectable by the player in any way. And originally in Vanilla Culture was not even implemented as a true yield, but as a sort of in-between yield. Culture is yet another yield that is sent and spent at the empire level.
    • Faith is yet a fifth animal, added by an expansion, and is only used to buy certain types of buildings and units, but only under certain conditions driven by whether a player has a required belief, or have reached a certain game-era and have completed a certain Policy-Branch.
    • Science is the sixth unique system which is not used at all by cities, and is only really "spent" in a hidden way by being directly applied to current research points
  4. There's no single definition here that can be used across the board and coded at any level that can adapt so far as what to do with Yield-X. Every yield requires its specific implementation into the game's sourcecode, to then be broadcast out by the sourcecode to all the necessary game-mechanics.
 
Last edited:
Considering how flexible and modder friendly this game seems to be ...

You'd think wouldn't you. Unfortunately, the reality is that while the original release was fairly modder friendly, G&K was less so (with features needed for the expansion hard-coded with only minor thought for modding extensions) and BNW even less so (it's pretty much hard coded just for the features to get the expansion and scenarios working)

Hence the Unified Yields project - for a full discussion of the work undertaken see this tread
 
Thank's I will surely check it out!
Ad well... i get that impression even though I start the game with the BNW (including my own coutnry - Poland - in this expansion was one of the first thing that actually catch my attention and make me want to try the game). Strangely enough I get a feeling that through some "silent" (by that I mean I didn't actually notice or at least didn't remember noticing any) update just BNW change to much less modder-friendly (for example I remember that I could completely freely change the city range both in matter of acquireable by culture board expansion and being workable - for playing as one city civ even 5 tiles could be to few in more advanced stage of the game... but now it seems to be impossible any longer - I don't get who could come up with such a stupid update which even in some sense break the game to me - by that I mean that I can't enjoy playing it so much like I had before)

Also as much as I understand faith wasn't the orginal yield... (though personally as I started playing with BNW from the very beginning even the elements from expansion like faith or even tourism are for me as native to the game like food or production - but that are feeling more tha facts and I know that) I can't agree with sentence
There's no single definition here that can be used across the board and coded at any level that can adapt so far as what to do with Yield-X
Actually You even kind of write negation Yourself - all the yields have one thing in common: they are some statistic, numeric feature of the tile (here I mean all: base yield of the terrain, yield from features and improvements) specialist or building, kind of countable profit a city can get if use that tile/have working specialist/have building builded.
Which city gets and then... well what is done with that deppends on yield type:
- added to city reserve in case of food
- added (or redirceted) to empire reserve in case of gold, faith or culture (which all are some king of a reserve, just the way the reserve is used differs) - similarly for tourism but here with this split to all other players
- added to current city production proces in case of production
- added to current reserch in case of science
That way it can be adapted to any way of spending those points - it's just matter of being using directly by the city or being send further to some game mechanics. And at the point of being given to the city it could also by easily modifie by some yieldmodifiers.
Actually the same abstraction could apply also to great people points. And as much as it plainly wasn't implemented in the game that way but it could be, and I even dare say it should. At least from modder perspective. Well actually not only because (if it would be done so from the very beginning) it would also make easier for developers to add new kind of yields.
And as much as that's kinda fruitless reasoning... well maybe it will at least help me to avoid some similar mistakes when I will be creating my own games (yeah I have an ambition of becoming game programmer some day)... but for now I just think I should learn how to mess with the dll modding... but as noticed - it has the disadvantage of being potentially less compatible (and that's the way I wanted to come up with a way that don't need any dll moding but just some alternation in XML or at worst lua script or other relatively easy overwriting the code - intentionally without breaking any compatibilities)
 
Without a modded DLL you have never been able to work more than 3 tiles out from the city center, regardless of patches or expansions. Tile Purchasing with gold and Workable tile range have always been 3 tiles from the city center and only DLL mods have ever been able to modify this. The Defines for this in the GlobalDefines.xml file are ignored past 3 tiles out.

The standard cultural expansion distance has always been five tiles, but this has always been moddable -- several mods have done so -- but this does not in any way affect tile purchasing with gold or workable tile-range.

As far as the other, I'd be interested in the code you create that can handle all these Yield conditions and effects which does not require else and elseif clausing or their C++ equivalents. Or that does not rely on data-driven hard-coded lua (or its C++ equivalent) table techniques.
 
Well it will take a loooot time before I would do that unfortunately.

And well it's impossible, that extending workable tile range over just this laughable 3 tiles (really what was firaxis thinking when setting that limit?)
was impossible without DLL modding, because I played one without DLL modding and have workable city range succesfully extending to 10 tiles. Just by modifying XML files.
Well perhaps it could be connected to the fact, that firstly I have just BNW as my only expansion, and just adding all other made this change - it has to be it or some "silent update" I didn't seen. But I'm 100% sure it was possible, what a shame I didn't have any screenshots to prove it... but that doesn't change the simple fact that it is true.
 
It has never been true. Search the forum a bit and you'll find multiple discussions on this point.

Here's a thread from 2014: https://forums.civfanatics.com/threads/workable-titles.526249/#post-13225136

The threads discussing this point go back to the original Vanilla release of the game.

There was a mod on Steam Workshop that purported allowing working out to 10 tiles, but I never investigated whether it was a DLL mod or merely yet another in a multitude of mods posted to the Civ5 Steam Workshop that either don't actually do anything or don't actually do what the mod-author claims. The confusion between workable tile range and border expansion is common and rampant throughout the Civ5 modding community both for mod-users and mod-makers.

There was a 5-tile mod that I think was a DLL mod but I never used it or looked at its code, and I think it only worked for G&K.

@whoward69 's Various Mods Components DLL mod available on his Pick'n'Mix website allows extension of the workable range to 5 tiles, and the reason he selected a range of 5 tiles as the max in his DLL is because the higher the range number the greater the exponential increase in processing required by the game for each city to calculate yields and implement effects thereby created by these yields.
 
Top Bottom