Okay, if I directly alter the XML (not via mod) I can alter Handicap settings just fine and see their effects in game; however, trying to get my mod to do so is giving me fits.
I've tried the following:
<HandicapInfos>
<Update>
<Where Type="HANDICAP_PRINCE" />
<Set>
<HappinessDefault>15</HappinessDefault>
<RouteCostPercent>80</RouteCostPercent>
<UnitCostPercent>80</UnitCostPercent>
<BuildingCostPercent>80</BuildingCostPercent>
<BarbarianBonus>10</BarbarianBonus>
<AIBarbarianBonus>10</AIBarbarianBonus>
<AIUnhappinessPercent>91</AIUnhappinessPercent>
<AIGrowthPercent>91</AIGrowthPercent>
<AITrainPercent>91</AITrainPercent>
<AIConstructPercent>91</AIConstructPercent>
<AICreatePercent>91</AICreatePercent>
<AIBuildingCostPercent>91</AIBuildingCostPercent>
<AIUnitCostPercent>91</AIUnitCostPercent>
</Set>
</Update>
</HandicapInfos>
(With other entries for other handicaps as well) and the only thing that takes effect is the Happiness change. I can mouse over happiness and see the 15 for Difficulty. There is no visible change to Unit Maintenance and it still shows +40% in the preview when I attack barbarians.
When I did these as direct xml adjustments before attempting to package my mod, mousing over the Unit, Building or Route sections of the Economic Overview (F2) would have the additional line "You are paying 80% of normal because of your difficulty setting" and combat previews with barbs showed +10%.
I have tried using SQL and the same thing happens (even when I do a single update for each line).
I have tried using <Delete/> and re-entering each entry using <Row> in place of <Update> (and the missing areas I did NOT change with Update) and the game has a CTD when trying to build the world.... logs say "ERROR: Game does not contain valid handicap!!" in GameCore.log (despite the fact I re-added each entry).
I get the same issue if I do not use <Delete/> and instead use <Replace> pasting the entries exactly from the default game xml just altering specific lines. I've tried including and not including <ID>0</ID> in the Settler setting with no effect on outcome.
So, has anyone managed to alter additional settings in the Handicaps besides just Happiness? (I can alter the other subsections fine, as I have removed all AI Free Tech and tested my mod on Immortal and 50 turns in both my empire and the AI all had only 1 tech when the summary screen appeared).
I could possibly believe the Unit maintenance discount and barbarian bonus were display issues; however, they display properly in Solo play when I alter the xml directly and my mod has no UI changes (not running any others either until I get mine fully functional) and runs no LUA script. Pure XML (except my one attempt to alter handicap via SQL).
EDIT: Ran a few more tests using IGE and editing the core game files. Using IGE to check on other Civs proved my changes to their number of starting units was functioning (so I suspect the other AI changes are as well) and modding the core files and reloading a save in my mod turned out the combat preview and unit maintenance are display issues (since the combat outcome 18 damage to barb and 48 to my scouts was identical with and without core xml changes but preview showed correctly when I altered core xml directly).
This will still be an issue for people who use my mod without a UI upgrade that corrects the issues and I find it quite annoying myself.
I've tried the following:
Spoiler :
<HandicapInfos>
<Update>
<Where Type="HANDICAP_PRINCE" />
<Set>
<HappinessDefault>15</HappinessDefault>
<RouteCostPercent>80</RouteCostPercent>
<UnitCostPercent>80</UnitCostPercent>
<BuildingCostPercent>80</BuildingCostPercent>
<BarbarianBonus>10</BarbarianBonus>
<AIBarbarianBonus>10</AIBarbarianBonus>
<AIUnhappinessPercent>91</AIUnhappinessPercent>
<AIGrowthPercent>91</AIGrowthPercent>
<AITrainPercent>91</AITrainPercent>
<AIConstructPercent>91</AIConstructPercent>
<AICreatePercent>91</AICreatePercent>
<AIBuildingCostPercent>91</AIBuildingCostPercent>
<AIUnitCostPercent>91</AIUnitCostPercent>
</Set>
</Update>
</HandicapInfos>
(With other entries for other handicaps as well) and the only thing that takes effect is the Happiness change. I can mouse over happiness and see the 15 for Difficulty. There is no visible change to Unit Maintenance and it still shows +40% in the preview when I attack barbarians.
When I did these as direct xml adjustments before attempting to package my mod, mousing over the Unit, Building or Route sections of the Economic Overview (F2) would have the additional line "You are paying 80% of normal because of your difficulty setting" and combat previews with barbs showed +10%.
I have tried using SQL and the same thing happens (even when I do a single update for each line).
I have tried using <Delete/> and re-entering each entry using <Row> in place of <Update> (and the missing areas I did NOT change with Update) and the game has a CTD when trying to build the world.... logs say "ERROR: Game does not contain valid handicap!!" in GameCore.log (despite the fact I re-added each entry).
I get the same issue if I do not use <Delete/> and instead use <Replace> pasting the entries exactly from the default game xml just altering specific lines. I've tried including and not including <ID>0</ID> in the Settler setting with no effect on outcome.
So, has anyone managed to alter additional settings in the Handicaps besides just Happiness? (I can alter the other subsections fine, as I have removed all AI Free Tech and tested my mod on Immortal and 50 turns in both my empire and the AI all had only 1 tech when the summary screen appeared).
I could possibly believe the Unit maintenance discount and barbarian bonus were display issues; however, they display properly in Solo play when I alter the xml directly and my mod has no UI changes (not running any others either until I get mine fully functional) and runs no LUA script. Pure XML (except my one attempt to alter handicap via SQL).
EDIT: Ran a few more tests using IGE and editing the core game files. Using IGE to check on other Civs proved my changes to their number of starting units was functioning (so I suspect the other AI changes are as well) and modding the core files and reloading a save in my mod turned out the combat preview and unit maintenance are display issues (since the combat outcome 18 damage to barb and 48 to my scouts was identical with and without core xml changes but preview showed correctly when I altered core xml directly).
This will still be an issue for people who use my mod without a UI upgrade that corrects the issues and I find it quite annoying myself.