Making a difficulty mod between King and Emperor level

Joined
Apr 11, 2015
Messages
438
I've decided to try and make a mod to create a new difficulty level between King and Emperor.

I tend to play with between 8 and 12 civs. On King difficulty I'm finding I stop playing half way through games because I'm way ahead of all the other civs.

Although I've won on Emperor level at least once, I usually find myself trailing well behind the other civs on this difficulty level and give up before the end. I do enjoy the challenge of this level but it's a little too much. So most of my games I'm abandoning half way through.

I've had a look through the mods and have found three or four that address difficulty in one way or another. However, they seem to have not been updated in a while and users of the mods have left comments about games crashing.

So I'm thinking of making my own.

The two things that annoy me about playing on Emperor difficulty are: falling behind technologically; the happiness penalty and its consequent effect on the player's empire population.

So basically, I want to use the Emperor difficulty level as the basis and then use the parts that relate to happiness and technology/research from King difficulty level. Here's the crib sheet from the wiki: http://civilization.wikia.com/wiki/Difficulty_level_(Civ5)

I'm searching for files that might be relevant in the Civ V folder, starting with the search term: difficulty

It's been searching the folder for some time now. Might have to leave it for the night... :crazyeye:

If 'difficulty' doesn't bring any search results, I'll try 'handicap'.
 
There are two relevant tables in the wiki. The first table, Player Bonuses, has identical values for King and Emperor except for values with an asterisk, which aren't used in gameplay, and barbarian-related stuff, which I'll keep at Emperor settings.

The second table, AI bonuses, has the key data. I've reproduced it below and highlighted where the values differ between King and Emperor difficulty level.



I also found this post on another thread with some explanations of the elements:

Ninakoru said:
If memery serves me right:

train rate: Unit production
world train rate: Specialist/Generals discount for next
Construction rate: Building production
world construction rate: National wonders production
Create: Faith and gold purchases
world create: Global projects (Apollo, Manhattan)
Per era modifier: Affect all other bonuses, reducing costs of maintenance, units, purchases, etc. It's multiplicative not aditive, so when AI enters classic with 50% unit prod and 5 per era, will have 52,5% discount, not 55% discount.

I'm still not fully understanding how the Per Era Modifier element works.

My initial thoughts are to:

- drop the Free Techs of Animal Husbandry and Mining
- maybe drop the Starting Explore Unit (scout)
- set Unhappiness at 100%

After that, I'm not sure. I'd be hesitant of using values that are not explicitly used. For example, Work Rate Bonus jumps from 20% to 50%. I'd be concerned that if I set it to 30, 35 or 40% the game might crash.
 
In addition to the changes I suggested previously, I think I'll also:

- drop Pottery as a Free Tech, so no starting techs for the AI. The other reasons for the AI's technological advancement on Emperor level look as though they're related to indirect things like reduced building cost rate and population bonuses. So hopefully having no free techs, combined with removing the AI happiness bonuses should have some effect on the technology gap. Removing the free Pottery AI Tech should also reduce the advantage the AI has in founding pantheons/religions.

- Keep the Work Rate bonus, which I presume relates to the speed at which workers build improvements, at King level's 20% rather than Emperor's 50%.
 
I'm still not fully understanding how the Per Era Modifier element works.

My initial thoughts are to:

- drop the Free Techs of Animal Husbandry and Mining
- maybe drop the Starting Explore Unit (scout)
- set Unhappiness at 100%

After that, I'm not sure. I'd be hesitant of using values that are not explicitly used. For example, Work Rate Bonus jumps from 20% to 50%. I'd be concerned that if I set it to 30, 35 or 40% the game might crash.

AIPerEraModifier applies to the following things:
- City growth rate
- Unit, building, project production
- Unit supply cost
- Inflation rate (disabled in the code)
- Unit upgrade cost

Each one of those is multiplied by 100+(Per Era Modifier * an integer representing the current era defined in EraType)/100. So, for example, if you're playing Emperor difficulty and the AI civ is in the Medieval era, each one of those would be multiplied by 100+(-3*2)/100 or .94. EraType can be found at http://modiki.civfanatics.com/index.php/EraType_%28Civ5_Type%29

Setting AIWorkRateModifier to 30, 35, 40, etc shouldn't crash the game. The building progress code adds the worker's building rate each turn and then checks to see if it's greater than or equal to the required build time. There wouldn't be any strange rounding errors or anything like that.
 
AIPerEraModifier applies to the following things:
- City growth rate
- Unit, building, project production
- Unit supply cost
- Inflation rate (disabled in the code)
- Unit upgrade cost

Each one of those is multiplied by 100+(Per Era Modifier * an integer representing the current era defined in EraType)/100. So, for example, if you're playing Emperor difficulty and the AI civ is in the Medieval era, each one of those would be multiplied by 100+(-3*2)/100 or .94. EraType can be found at http://modiki.civfanatics.com/index.php/EraType_%28Civ5_Type%29

Setting AIWorkRateModifier to 30, 35, 40, etc shouldn't crash the game. The building progress code adds the worker's building rate each turn and then checks to see if it's greater than or equal to the required build time. There wouldn't be any strange rounding errors or anything like that.
Thanks for the info. I'll try out the Per Era Modifier at Emperor level.

I'll also leave the Work Rate at King level's 20% for now, as that seems like a decent advantage as it is.

Thanks for the input. Am about to start a game on the new settings. Hoping for my greatest Civ game ever... :king:
 
I've played a few hours with the new settings. It feels as though there's a slight improvement, although it still feels much closer to Emperor difficulty than to King. So I'd like to make some more alterations.

I am wondering:

1) If values are set at percentages not divisable by 5, such as 87%, will

a) The game not crash?
b) Will the values be recognised and utilised?

For example, it could be that the value range is in twenty increments and is just displayed as a percentage for ease of understanding. In which case a value like 87% would be rounded up or down to 85 or 90% - or maybe not even work at all and cause the game to crash.

2) Still not sure what to do about Per Era Modifier. While the other values can be adjusted roughly to a halfway compromise, the Per Era Modifier has a binary range of either -2 or -3.

I'm not quite sure of the purpose of the Per Era Modifier. If it makes adjustments to the following things,

- City growth rate
- Unit, building, project production
- Unit supply cost
- Inflation rate (disabled in the code)
- Unit upgrade cost

then why have the percentages bonuses (e.g. Growth Rate 90%)? There seems to be two systems that do a similar job on top of each other.

It would be good if I could understand it better but my brain is rather untechnical... Fortunately, however, it all comes down to a single choice: -2 or -3. So if anyone has any opinion on which of those two would be better that's be appreciated.
 
1) If values are set at percentages not divisable by 5, such as 87%, will

a) The game not crash?
b) Will the values be recognised and utilised?

For example, it could be that the value range is in twenty increments and is just displayed as a percentage for ease of understanding. In which case a value like 87% would be rounded up or down to 85 or 90% - or maybe not even work at all and cause the game to crash.

a) Shouldn't
b) Should

There doesn't seem to be any rounding happening in the code, so that shouldn't be an issue, but I doubt you will see a huge difference between 85% and 87% anyway.

2) Still not sure what to do about Per Era Modifier. While the other values can be adjusted roughly to a halfway compromise, the Per Era Modifier has a binary range of either -2 or -3.

I'm not quite sure of the purpose of the Per Era Modifier. If it makes adjustments to the following things,

- City growth rate
- Unit, building, project production
- Unit supply cost
- Inflation rate (disabled in the code)
- Unit upgrade cost

then why have the percentages bonuses (e.g. Growth Rate 90%)? There seems to be two systems that do a similar job on top of each other.

It doesn't have to be -2 or -3, that just happens to be what Firaxis decided on. They probably ran multiple tests with other values and found that -2/-3 simply made the most sense for King/Emperor. Unfortunately it is an integer, so you can't set it to -2.5 to split the difference.

The formulas they use for stuff like city growth, policy cost, etc. are all fairly complicated and take a few different things into account. In the case of each of those listed above, they obviously wanted a way to scale them to increase the difficulty as the game went on, so they added AIPerEraModifier to do that, since something like AIGrowthPercent applies unilaterally throughout the game. So, for example, if you set it to -2 then in the Renaissance era city growth rate would be 6% faster, but if you set it to -3 it would be 9% faster; 8% faster at -2 in Industrial era, 12% faster at -3, etc. I would say keep that at the King level of -2; you mentioned in your original post that you have a hard time keeping up with the AI in Emperor, so making it more difficult as the game progresses would be opposed to what you're setting out to do.
 
Thanks for the info. If percentages not divisable by 5 work okay then I'll try some new settings that try and find a half-way balance between King and Emperor. I'll keep it conventional within the Civ V difficulty scheme, so I'll restore Pottery as an AI Free Tech.

I'll also do the same to the barbarian bonuses so I'll use
(in brackets are the King/Emperor settings):

Barbarian Bonus - 25 (30/20)
Barbarian Land Target Range - 6 (5/6)
Barbarian Sea Target Range - 14 (12/15)

Here's the main table with the modified settings I'll try:

 
How'd those settings work out?
It's going well so far. I'm about half way through a game. The difficulty's feeling about right - kind of mid way between King and Emperor, as was hoped. I'm not in the lead but am not trailing far behind, so there's still everything to play for.

I had a rather fortunate start, though, on an island with militaristic city-states, while the other civs are all on a single continent. So I haven't had to spend resources on military so far.

So the mod appears to be doing a good job and certainly feels closer to the sought-after Goldilocks point - neither too easy, nor too hard. So far, so good... :goodjob:
 
I've been playing Civ V a lot again recently. My past dozen or so games have all been too easy or too difficult, depending on the difficulty level, and I've been tinkering with the difficulty level settings in the XML file.

I've been playing with 18-22 civs on a large map with no city-states. At Prince level, it's too easy and by around the Medieval era I'm the no. 1 civilization.

So I've been adjusting/modding the difficulty settings between Prince and King. Playing at King level, I'd find myself near the bottom of the demographics standings by around the Medieval era.

So I modded a difficulty level approximately half way between Prince and King, but the results were not much different than King. Then another difficulty mod with around one quarter of the difference between Prince and King, and again I was left trailing behind the AI civs in demographics.

It's frustrating trying to find a sweet spot for this game. Maybe I will try another mod with an approximately one eighth of an increase between Prince and King...
 
Top Bottom