Policy options for OCC

Salamandre

King
Joined
Aug 4, 2003
Messages
612
Location
France
Hi,

I will start on a mod changing policies options for OCC- one city challenge, because as they are, half are useless in this type of play. So please write here any ideas you have for what would be good in such challenge.

So far I was thinking at:

* progressive growing ring (culture and workable tiles up to the max, 8 I think?) unlocked by techs (not sure can be done with xml, maybe lua?)

* all little bonuses to spread between cities (+1 happiness from x building) to multiply value

* add options for capital only, growth, yield changes

* replace the options giving settler with give workers (2)

* replace the 3 liberty last policies (about number of towns you have)

In general multiply bonuses from existent and applicable policies by 2-3, to match the increased challenge. I would also like to ask if there is possible by lua to capture settlers as they are ( this is xml modifiable I know) but then disband them in your OC and add one population, then tied to one policy.

Please write here more ideas if you have.
 
So I am trying to add options to monarchy policy. I want to add 4 to each specialist improvement, I also want 4 gold per pop in capital and -4 unhappiness for every 2 citizens. The codes are there, yet I see zero effect in game (text display so is loaded), where I am wrong? :confused:

Code:
<GameData>
	<Policies>
		<Update>
			<Set CapitalUnhappinessMod="-100"
				 GridX="4"
				 GridY="1" />
			<Where Type="POLICY_MONARCHY" />
		</Update>
	</Policies>	       

<Policy_CapitalYieldPerPopChanges>
		       <PolicyType>POLICY_MONARCHY</PolicyType>
			<YieldType>YIELD_GOLD</YieldType>
			<Yield>100</Yield>                        
</Policy_CapitalYieldPerPopChanges>

<Policy_ImprovementYieldChanges> 
     <PolicyType>POLICY_MONARCHY</PolicyType>
     <ImprovementType>IMPROVEMENT_ACADEMY</ImprovementType>
     <YieldType>YIELD_SCIENCE</YieldType>
     <Yield>4</Yield>

     <PolicyType>POLICY_MONARCHY</PolicyType>
     <ImprovementType>IMPROVEMENT_CUSTOMS_HOUSE</ImprovementType>
     <YieldType>YIELD_GOLD</YieldType>
     <Yield>4</Yield>

     <PolicyType>POLICY_MONARCHY</PolicyType>
     <ImprovementType>IMPROVEMENT_MANUFACTORY</ImprovementType>
     <YieldType>YIELD_PRODUCTION</YieldType>
     <Yield>4</Yield>

     <PolicyType>POLICY_MONARCHY</PolicyType>
     <ImprovementType>IMPROVEMENT_HOLY_SITE</ImprovementType>
     <YieldType>YIELD_FAITH</YieldType>
     <Yield>4</Yield>
</Policy_ImprovementYieldChanges>
</GameData>


Pffff, forgot the Rows. :crazyeye:

Now working.
 
A question for the experts: is it possible to condition city cultural and workable ring to policy 1-2-3, each adding one ring? I tested and max distance is 5 (there is whoward's mod doing that) but couldn't get more than 8 culture tiles.

I would like to create 3 policies, each updating the workable ring, increasing by 1. Can be only xml or must combine with lua, please? Also is possible to have culture around going up to 10-15 tiles every direction or is again hardcoded?
 
Max workable ring distance is hard-coded (in something like 80 places in the DLL IIRC)

Firaxis default is 3, can't remember what the config value is to reduce it to 2 or 1.

Modded DLL takes it up to 5, and you can change the limit based on policy, trait or building
 
Ok thanks. And how would look to change workable ring on policy, something like this?

Code:
<Policies>
		<Update>
	       <SetCityWorkingChange="4"/>
               <Where Type="POLICY_CUSTOM" />
	       </Update>
</Policies>

Would this add 1 additional ring to regular 3? And how to make one policy add one ring, then a second one add one ring too, but without setting to 4 or 5? Is possible? And (sorry many questions) is culture ring limit also hardcoded?
 
I had been using this in a 'Core' mod I made for my own use:
Code:
<GameData>
	<Defines>
		<!-- empire plot defines -->
		<!-- original value "5" -->
		<Update>
			<Set Value="6"/>
			<Where Name="MAXIMUM_ACQUIRE_PLOT_DISTANCE"/>
		</Update>
	</Defines>
</GameData>
It worked fine to extend the cultural expansion limit to 6 tiles out, but I eventually removed it again because I decided it really did tend to cause some unfortunate gameplay effects.

If you wanted to make the tile acquisition by culture extend father out based on adopting a policy, though, I think you'd have to use whoward's dll (assuming he has added that ability and assuming that dll can even successfully change that cultural-tile-acquisition-distance based on whether a player has a policy).
 
From "Global - City Working Distance"

Spoiler :
Code:
<GameData>
	<CustomModOptions>
		<!-- None of these are strictly necessary, as the options are always on in the DLL -->
		<Update>
			<Where Name="GLOBAL_CITY_WORKING"/>
			<Set Value="1"/>
		</Update>
		<Update>
			<Where Name="TRAITS_CITY_WORKING"/>
			<Set Value="1"/>
		</Update>
		<Update>
			<Where Name="POLICIES_CITY_WORKING"/>
			<Set Value="1"/>
		</Update>
		<Update>
			<Where Name="BUILDINGS_CITY_WORKING"/>
			<Set Value="1"/>
		</Update>
	</CustomModOptions>

	<Defines>
		<Replace>
			<!-- General work tile maximum distance from city centre (default is 3) -->
			<!-- Min value is 2, max value is 5 (these are hard-coded in the DLL) -->
			<!-- Traits, techs, policies and buildings can increase this value for specific civs and specific cities -->
			<Name>MAXIMUM_WORK_PLOT_DISTANCE</Name>
			<Value>3</Value>
		</Replace>
		<Replace>
			<!-- General buy tile maximum distance from city centre (default is 3) -->
			<!-- Min value is 2, max value is 5 (these are hard-coded in the DLL) -->
			<!-- The buy plot distance for a specific city will never be less than the work plot distance for that city -->
			<Name>MAXIMUM_BUY_PLOT_DISTANCE</Name>
			<Value>3</Value>
		</Replace>
	</Defines>

	<Traits>
		<Update>
			<Where Type="TRAIT_POPULATION_GROWTH"/>
			<Set CityWorkingChange="1"/>
		</Update>
	</Traits>

	<Language_en_US>
		<Update>
			<Where Tag="TXT_KEY_TRAIT_POPULATION_GROWTH"/>
			<Set>
				<Text>[ICON_HAPPINESS_4] Unhappiness from number of Cities doubled, [ICON_HAPPINESS_4] Unhappiness from number of [ICON_CITIZEN] Citizens halved. Cities may work one additional ring of tiles.</Text>
			</Set>
		</Update>
	</Language_en_US>

	<Buildings>
		<Update>
			<Where Type="BUILDING_HANGING_GARDEN"/>
			<Set CityWorkingChange="1"/>
		</Update>
	</Buildings>

	<Language_en_US>
		<Update>
			<Where Tag="TXT_KEY_WONDER_HANGING_GARDEN_HELP"/>
			<Set>
				<Text>Provides a free Garden in the city in which it is built and the city may work one additional ring of tiles.</Text>
			</Set>
		</Update>
	</Language_en_US>

	<Policies>
		<Update>
			<Where Type="POLICY_EXPLORATION_FINISHER"/>
			<Set CityWorkingChange="1"/>
		</Update>
	</Policies>
</GameData>

Note 1: As hinted at in the comments above, there is also TECHS_CITY_WORKING and a corresponding CityWorkingChange column in the Technologies table

Note 2: "Acquire" is not "workable" - the game core can only change "acquire", to change "workable" (and also "buyable") requires extensive DLL mods
 
Yes I know this mod. However I still don't know how to create an update process in defines files when a policy is selected. I assume that my code above is wrong, right?

A1h sorry whoward, I just scrolled down your example and saw the code at last. So my question is:

I want policy 1 to give +1 to ring, policy 2 to give +1 to ring too. Is it possible to add values to existing, or we can only set?
 
Would this add 1 additional ring to regular 3?
Like all the Lua ChangeXyz() methods, it's additive. So your code would add 4 to the base of 3 for a total of 7 (which the DLL would cap at 5)

And how to make one policy add one ring, then a second one add one ring too, but without setting to 4 or 5? Is possible? And (sorry many questions) is culture ring limit also hardcoded?
Each policy would have a change of +1. Three policies would be pointless, unless you drop the starting size to 2 rings.

The hard-coded limit is 5 workable/buyable rings, this is because there are a large number of static arrays within the DLL that are allocated based on the total possible number of workable rings. For the standard 3 rings this is 1 + 6 + 12 + 18 = 37. In general, for N rings it is 1 + (1+N)*(N/2)*6, so for 5 rings it's 91, adding another ring is a delta of (1 + (1+N+1)*((N+1)/2)*6) - (1 + (1+N)*(N/2)*6) = (6N + 6) so adding a 6th ring requires an additional 36 (total 127) entries in many arrays per city, a 7th ring requires 42 in addition to those (total 169). These numbers get big rapidly for very, very rare occurrences, and a line had to be drawn somewhere and it was drawn by Firaxis at 3 (37 slots), and I redrew it at 5 (91 slots)
 
Code:
		<Row>
			<Type>BUILDING_FACTORY</Type>
			<BuildingClass>BUILDINGCLASS_FACTORY</BuildingClass>
			<Cost>360</Cost>
			<GoldMaintenance>3</GoldMaintenance>
			<PrereqTech>TECH_INDUSTRIALIZATION</PrereqTech>
			<Help>TXT_KEY_BUILDING_FACTORY_HELP</Help>
			<Description>TXT_KEY_BUILDING_FACTORY</Description>
			<Civilopedia>TXT_KEY_CIV5_BUILDINGS_FACTORY_TEXT</Civilopedia>
			<Strategy>TXT_KEY_BUILDING_FACTORY_STRATEGY</Strategy>
			<ArtDefineTag>ART_DEF_BUILDING_FACTORY</ArtDefineTag>
			[B][COLOR="Red"]<XBuiltTriggersIdeologyChoice>3</XBuiltTriggersIdeologyChoice>
[/COLOR][/B]			<SpecialistType>SPECIALIST_ENGINEER</SpecialistType>
			<SpecialistCount>2</SpecialistCount>
			<MinAreaSize>-1</MinAreaSize>
			<ConquestProb>66</ConquestProb>
			<HurryCostModifier>0</HurryCostModifier>
			<IconAtlas>BW_ATLAS_1</IconAtlas>
			<PortraitIndex>3</PortraitIndex>
		</Row>
 
Asking here, to avoid create another thread: is there a xml way to make changes to a building after unlocking a policy? Like modifying great works slots to palace after unlocking for example Aesthetics?

Or we have to stick exclusively to policies features from policies.xml?
These have been provided by Firaxis within the XML-Schema of Buildings/Policies:
Code:
<Policy_BuildingClassYieldChanges>
<Policy_BuildingClassProductionModifiers>
<Policy_BuildingClassTourismModifiers>
<Policy_BuildingClassHappiness>
<Policy_BuildingClassYieldModifiers>
<Policy_BuildingClassCultureChanges>
But with lua there is a specific event GameEvents.PlayerAdoptPolicy(PlayerID, policyID) for when a player adopts a policy, and you can use that to accomplish quite a bit more than Firaxis provided.

Whether the effect can be accomplished easily depends on exactly what you mean by
modifying great works slots to palace
  • If you mean directly changing the number or type of great-works slots in the Palace, then no not really in a workable sort of way I don't think. It isn't anything to do with policies it is to do with altering a building's basis definition in XML/SQL as given at game-start-up in ways Firaxis did not provide reliable methods. There is also the whole cultural overview hardcoding difficulties to be considered as well.
  • If you mean adding a free great work if the slot is empty I think this can be done but I would have to research more on the subject.
  • And I am sure I am missing a few keys issues that will need to be thought-through. There always are re buildings and great-work slots :)
  • As soon as you even think about non-World-Wonder buildings and great works slots, you need to be sure to include the files from KyteM's Dynamic Culture Overview mod, which fixes Firaxis' broken Culture Overview Pop-up. Unbless, of course, whoward has a better 'fixier' available from Pick'n'Mix.
 
you need to be sure to include the files from KyteM's Dynamic Culture Overview mod, which fixes Firaxis' broken Culture Overview Pop-up. Unless, of course, whoward has a better 'fixier' available from Pick'n'Mix.

Not a better one, but I do have an alternative.
 
If I want to modify culture from an improvement, both are correct to use? I see both work, is there some backside using second?


Policy_ImprovementCultureChanges

Policy_ImprovementYieldChanges

Policy_ImprovementCultureChanges
Would only work for changing the culture output of the specified improvement. There doesn't actually have to be culture coming from the improvement beforehand in order for the "Changes" to be implemented. It would have been more clear if Firaxis has called such tables "Additions".​
Policy_ImprovementYieldChanges
Would work for changing all the other yield outputs of the specified improvement. It may also work with YIELD_CULTURE in G&K and BNW but I have not specifically investigated for that. Whether Firaxis altered the behavior of a speciific game-table to account for YIELD_CULTURE when they introduced G&K is a bit hit-and-miss, and just because it works within one game-table does not always mean it will work in another similar-looking game-table.

Note that Firaxis never used YIELD_CULTURE in this table in either of G&K or BNW, but this in and of itself does not mean anything other than a modder should not be suprised if YIELD_CULTURE in this table fails to implement, and pleased if it does.​
 
Top Bottom