Why are some XML changes working, while others aren't?

BoogieMan

Chieftain
Joined
Dec 24, 2005
Messages
17
So I've been messing around tweaking some settings in various XML files to make that game more tailored to my tastes. However I am having trouble with some changes having no effect and I don't understand why.

For example, I am trying to lower the unhappiness caused by cities and population, as well as ease maintenance costs. I edit the fields in the GlobalDefines.xml and nothing changes at all, even if I set the numbers to something ridiculous. Changing the cost of tech also makes no difference.

Changes that HAVE worked was making it so you could set production to wealth at the start as well as overall game pacing (research, building speeds etc.) so I am at a loss as to why changing these other things isn't working. Anyone have any insight to offer?
 
First of all, the way you describe it, you're altering the core files directly. BAD BAD BAD BAD BAD. Don't do that; go learn how to make an actual mod, by reading Kael's modding guide over in the References forum.

Assuming you're using the correct Update syntax, and loading your mod correctly, there are still a few things to keep in mind:

1> You can't change types of variables. Take unhappiness per population; when Global Defines says "1" for this, it doesn't mean "1.0", it means the integer 1. As in, you can't put in a value of 0.6, because it's expecting an integer value and will just round it back up to 1. It doesn't matter that the unhappiness per CONQUERED population value is 1.34, and is therefore adjustable as a decimal.
There are various ways of getting around this, like modifying the Unhappiness modifier percentages in the Eras or HandicapInfos tables. In my own mods I did exactly this to have each population add 1.2 unhappiness instead of 1.0. But some values just aren't indirectly adjustable like this.

2> Quite a few variables in those files are remnants of Civ4 and/or early internal versions of Civ5, and have no effect on your version of Civ5. For instance, the resource quantity settings in the Resources XML table aren't used for anything; only AssignStartingPlots.lua and your map scripts can adjust those values.

3> Some variables in the Defines table apply to specific game types, and so changing them might not have an effect on your games. Or, they might not modify what you think they do, since not every variable name is as descriptive as we'd like.

If you've got a specific value you want to ask about, feel free to ask. We should be able to tell you whether it fits any of the above categories.
 
I see, thank you. What should I change to reduce unhappiness and maintenance in general? I figured modifying the core files wasn't that big a deal since I rarely play multiplayer and have the originals backed up. It was quicker, so that's why I decided to go right to that.

Overall I've greatly slowed research (first techs take 75 turns for example) while making most others speeds somewhere around that of the game speed below marathon. It was silly zipping through the eras so fast having units on the field from 3 different eras..


I just dislike that a reason to not go attack an empire that's been annoying me when they are vulnerable us because the unhappiness from taking their cities will magically affect my own city's citizens and make them unhappy empire wide and make my military weaker.
 
2> Quite a few variables in those files are remnants of Civ4 and/or early internal versions of Civ5, and have no effect on your version of Civ5. For instance, the resource quantity settings in the Resources XML table aren't used for anything; only AssignStartingPlots.lua and your map scripts can adjust those values.

While what you're saying is of course perfectly correct, the example is not, as those values are used for worldbuilder maps with random resource placement.

Meaning you don't get the same rules for map scripts (using resource placement from AssignStartingPlots.lua) and WB maps (using resource placement from WorldBuilderRandomItems.lua)
 
While what you're saying is of course perfectly correct, the example is not, as those values are used for worldbuilder maps with random resource placement.

Fair enough; I almost never use WorldBuilder, and the few times I've used it have been on maps with preset resource placement. Point is, while it might seem obvious that modifying certain tables will do certain things, it just doesn't turn out that way in practice.
 
So.. Any advice on reducing maintenance and general unhappiness? Not a lot of luck so far.
 
So.. Any advice on reducing maintenance and general unhappiness? Not a lot of luck so far.

Plenty. If your concern is the crippling unhappiness for adding a new city to your empire, there are a few ways to deal with it without any modding:
1> Raze the cities you conquer. If you want to capture them and keep them, then be prepared to deal with the consequences.
2> Don't go to war unless you have a bit of a buffer on Happiness. That is, if you're barely scraping by at +2, then don't start a war; wait until you've unlocked some Happiness-producing building and increased your net happiness to +10ish, to where you can afford the negatives of a newly acquired city. This is how the AI already works. The AI players will prefer not to go to war until they're well above the 0-line, to where they'd have sufficient excess to handle the absorption of a few cities.
3> Play on a lower difficulty. Happiness is one of the main benefits of difficulties below Prince.

This is how the game stops people from going on Civ4-style rampages where they'll conquer half the world the moment they unlock a key military unit, like Tanks. It's working as intended. Back in Civ4, once you got past the basic courthouse limitation of new cities, they'd be nearly as productive as your core cities, so anyone who conquered a neighbor in the early eras would gain an insurmountable lead over their foes. The whole point of this unhappiness mechanism in Civ5 is to prevent that situation from reoccurring; if you conquer someone, you're creating all sorts of problems for yourself that your more peaceful opponents won't deal with. Happiness is the most direct way in which you're penalized. Without this sort of mechanism, no one would ever win through a cultural or diplomatic victory.

But if you still insist on this course, then you can do quite a few things to make the game more conqueror-friendly:
1> Lower the per-city unhappiness from 3 (its current value) back down to 2 (the value it had when Civ5 was first released), or at least change the per-city value for newly conquered cities from 5 down to a lower value.
2> Lower the per-population unhappiness from 1.0 to some lower value. While you can't change the Defines value directly (since, as I noted before, it's an integer), you CAN alter the happiness multipliers in several other tables to achieve the same effect.
3> Add more low-tier buildings that add Happiness. For instance, change the Temple from +3 Culture to something like +1 Culture and +1 Happiness and make it no longer depend on the Monument. (I've done exactly this in my own mod, but that's actually to counteract an INCREASED per-population unhappiness that I use to slow down conquerors even more.)
Adding more +Happiness buildings makes it much easier to acquire enough of a buffer to afford the unhappiness costs of an extra city.
4> Change the rules for population of a captured city. Right now, capturing a size 8 city gives you a size 4 remnant, which can still add up to a good amount of unhappiness. But if you changed it to give only a size 1-2 city, you'll have less unhappiness to deal with.
5> Change the cost of a Courthouse, so the player can complete one quickly when they conquer a city.

You get the idea. There are a lot of things you can do if you want this sort of change. Just understand that, as always, the AI will not handle the changes well. The AIs might be much more aggressive than normal (since they'll be more likely to have enough happiness to trigger the "okay, let's grab another city" logic), or it might not change at all (in which case you, the player, will have a huge advantage). This is the most common problem with any significant modifications to the game's balance; so much of it is balanced around certain assumptions of game balance, and if you drastically change that, then things can break in all sorts of ways.

Even if the AI somehow doesn't choke on your changes, then it can still have unintended effects. For instance, part of the reason that the base per-city unhappiness was raised from 2 to 3 was to combat the "ICS" strategy; undoing that change just opens the door for that sort of thing all over again.
 
I understand it's there to control pacing, but it's a flawed approach in my opinion. I'd be more accepting of this mechanic if it didn't affect your own cities if they were fine before. There is NO reason for my own cities to fall into chaos when I am defending my nation from another who has harassed us for centuries upon centuries with no provocations. If the unhappiness wasn't so global it'd make more sense. Rebellions in my territory, crippled growth/production and penalized troops is just completely ludicrous.
 
I understand it's there to control pacing, but it's a flawed approach in my opinion. I'd be more accepting of this mechanic if it didn't affect your own cities if they were fine before. There is NO reason for my own cities to fall into chaos when I am defending my nation from another who has harassed us for centuries upon centuries with no provocations. If the unhappiness wasn't so global it'd make more sense. Rebellions in my territory, crippled growth/production and penalized troops is just completely ludicrous.

Ignore all the "pro-balance" arguements and play the game you want to - it's much more fun :D

And when you're bored with steam-rollering the AI (which isn't hard even with the so called "balance" in place) you can change it back and play a different way ;)

Just disable happiness altogether ...
... locate the file CIV5GameOptions.xml
... locate the entry
Code:
<Row>
  <Type>GAMEOPTION_NO_HAPPINESS</Type>
  <Description>TXT_KEY_GAME_OPTION_NO_HAPPINESS</Description>
  <Help>TXT_KEY_GAME_OPTION_NO_HAPPINESS_HELP</Help>
[COLOR="Red"]  <Visible>0</Visible>[/COLOR]
</Row>

.. and DELETE the line in red

Under Advanced Options you'll now have a "Disable Happiness" checkbox

With happiness off (option is ticked) you'll have no hapiness issues, also no golden ages, no need to build hapiness buildings, etc
 
Back
Top Bottom