How do i modify the cost of units?

ilshur

Warlord
Joined
Feb 25, 2008
Messages
251
small client side editing question:

How do i modify the cost of units?

I can see that you can set the maximum ratio for the AI in terms of air or navy or armor or artillery, and this helps, but i want to dramatically lower the production cost of infantry and some armor units for Russia.

Russia is a pushover when playing a skilled Germany, especially on the historical timeline when germany can marshall the very maximum of units for invasion. I'd had some success in increasing Russia's overall durability by adding a ton more population to most of the smaller cities, and adding about 10 manufactories to the rear of Stalingrad, Novgorod, and beyond, but they still dont 'fill the space' appropriately. Something like half to 65% of the tiles on 'the front' or occupied, and iw ant to push that closer towards 90%.

To do this, i need to lower the production cost of Russian Infantry, Artillery, and Light Armor. To accommodate the increased unit limit, ive added 5-8 population to basically every city. But where specifically can i edit the unit cost?
 
It will be easier to edit in next version.

You can't do that for the artillery, or must do it globally (there is now UU for that class ATM)

You can change the cost of specific civilizations units in the SQL files.

For example in NewUnitsInfantries.sql find the russian infantry entry, and on the second line replace "cost" by the value you want to use.

Change
Code:
	SELECT	("UNIT_RUSSIAN_INFANTRY"), ("TXT_KEY_UNIT_RUSSIAN_INFANTRY"), "Civilopedia", "Strategy", "Help", "Requirements", "Combat", "RangedCombat", [COLOR="red"]"Cost"[/COLOR], "Moves", "Immobile", "Range", "BaseSightRange", "Class", "Special", "Capture", "CombatClass", "Domain", "CivilianAttackPriority", "DefaultUnitAI", "Food", "NoBadGoodies", "RivalTerritory", "MilitarySupport", "MilitaryProduction", "Pillage", "Found", "FoundAbroad", "CultureBombRadius", "GoldenAgeTurns", "IgnoreBuildingDefense", "PrereqResources", "Mechanized", "Suicide", "CaptureWhileEmbarked", "PrereqTech", "ObsoleteTech", "GoodyHutUpgradeUnitClass", "HurryCostModifier", "AdvancedStartCost", "MinAreaSize", "AirUnitCap", "NukeDamageLevel", "WorkRate", "NumFreeTechs", "RushBuilding", "BaseHurry", "HurryMultiplier", "BaseGold", "NumGoldPerEra", "SpreadReligion", "IsReligious", "CombatLimit", "RangeAttackOnlyInDomain", "RangeAttackIgnoreLOS", "RangedCombatLimit", "XPValueAttack", "XPValueDefense", "SpecialCargo", "DomainCargo", "Conscription", "ExtraMaintenanceCost", "NoMaintenance", "Unhappiness",
to
Code:
	SELECT	("UNIT_RUSSIAN_INFANTRY"), ("TXT_KEY_UNIT_RUSSIAN_INFANTRY"), "Civilopedia", "Strategy", "Help", "Requirements", "Combat", "RangedCombat", [COLOR="Red"](100)[/COLOR], "Moves", "Immobile", "Range", "BaseSightRange", "Class", "Special", "Capture", "CombatClass", "Domain", "CivilianAttackPriority", "DefaultUnitAI", "Food", "NoBadGoodies", "RivalTerritory", "MilitarySupport", "MilitaryProduction", "Pillage", "Found", "FoundAbroad", "CultureBombRadius", "GoldenAgeTurns", "IgnoreBuildingDefense", "PrereqResources", "Mechanized", "Suicide", "CaptureWhileEmbarked", "PrereqTech", "ObsoleteTech", "GoodyHutUpgradeUnitClass", "HurryCostModifier", "AdvancedStartCost", "MinAreaSize", "AirUnitCap", "NukeDamageLevel", "WorkRate", "NumFreeTechs", "RushBuilding", "BaseHurry", "HurryMultiplier", "BaseGold", "NumGoldPerEra", "SpreadReligion", "IsReligious", "CombatLimit", "RangeAttackOnlyInDomain", "RangeAttackIgnoreLOS", "RangedCombatLimit", "XPValueAttack", "XPValueDefense", "SpecialCargo", "DomainCargo", "Conscription", "ExtraMaintenanceCost", "NoMaintenance", "Unhappiness",
global cost is 200.

(and note that this is bad SQL syntax with those " everywhere, do not take this as an example :blush: )

to change a global cost, see NewDefaultUnits.sql.

and remember that all that I've just written above will be deprecated in the next release, I've completely changed the way to initialize units.
 
Well this works well, and i get that the entire format of things can change to better serve the intended schemes or streamline the code or wahtever, but im just toying with ways to make the game a little more realistic and intrinsically balanced.

Russia is enormous, especially in the 1939-1945 regular Europe, and outside of modifying the way the Civ5 AI Engine seems determined to keep units garrisioned in every city (as opposed to sending every man, boy and toddler into the breach along the front!), im trying to figure out a way to dramatically alter (increase) the way the AI fights. Adding more units is one, and this is best done in a balanced way by making them all infantry.

Speaking in an RP sense, the Russian Infantry were not crack troops, and got demolished by German combined arms, only halting catastrophic loss at an enormous expense to force depletion.

German (and some UK, and American) units should be better, and likewise more expensive. Russia ended up pulling together decent armor strategy, but a lot of it was just in their numerical advantage.


But i'll give this a try and report back on my findings in a few days.


e: when i tried editing this last night, it broke Civ5. Its likely an error on my end and not in the instructions, but im going to hold off on trying to userside mod things in this direction.
 
Back
Top Bottom