Current (SVN) development discussion thread

^ Why not look for a more universal solution?

To start with, I don't think the number of foreign contacts or Open Border agreements should affect Diplomatic Stability at all. Foreign Trade already indirectly affects Stability by boosting your Economy. Letting it also influence Diplomatic Stability would be unbalanced and redundant.
They don't for exactly this reason. Although open borders can impact your stability negatively if they are with a collapsing civ, that might exacerbate the problem.

In terms of Economic Stability, I don't think absolute growth/stagnation should be the determining factor. Instead it should be relative (as long as your economic growth is not negative). Say if a civ's economy output is stagnating (zero growth), but the whole rest of the world are at negative growth (Plague, Great Depression, etc.), then the civ with the zero growth should have a relatively good economic rating.
It's both. Growth is based on the percentage change from your commerce output from ten turns earlier, but there's another factor based on your rank compared to other civs. Rising in rank gives positive stability.
 
By the way, I've lost one of my hard drives today. Game files itself are fine (and are secure in the SVN anyway), but I've lost my C++ compiler and various utility programs are gone too, so it might take a while until I'm ready to do stuff again.

Looks like I have to rewrite my comically large modding schedule.
 
They don't for exactly this reason. Although open borders can impact your stability negatively if they are with a collapsing civ, that might exacerbate the problem.

It's both. Growth is based on the percentage change from your commerce output from ten turns earlier, but there's another factor based on your rank compared to other civs. Rising in rank gives positive stability.
I really can't think of any inherent advantage of pre-colonial Europeans over Asians in terms of Stability other than

(1) More Open Border agreements and foreign trade

and

(2) Less economic stagnation

I think these are the primary reasons why Rhye gave Japan huge Stability buffs. I'm hoping that instead of civ-specific buffs we'd have a universal standard applicable to all civs this time.

Oh, and there is maybe a third reason

(3) Religious unity (Catholicism)

but that will (or should) cease to be a factor after the Reformation. btw Protestant civs always had worse Stability under the previous system. In the current system too I see England and Vikings do worse than continental Europe for some reason.
 
By the way, I've lost one of my hard drives today. Game files itself are fine (and are secure in the SVN anyway), but I've lost my C++ compiler and various utility programs are gone too, so it might take a while until I'm ready to do stuff again.
Bad news.

On the other hand I will use this interregnum period to read your Stability code and try to find out the reason behind the poor Stability of Asian civs and hopefully solutions (other than civ-specific buffs) for it.
 
Yeah. The modding stuff isn't even the worst but I have tons of other stuff to recover and reconfigure before I can even start doing that.

I hope the stability code is legible. Feel free to ask if it isn't.
 
^ Well, they are very legible. But I think you need a slightly different approach if you'd want to balance this in a reasonable amount of time.

There are some minor mistakes (I could be wrong of course) such as line 183:
bForeignCore would always be True since you looped through all the civs

But by far the most important issue with balancing Stability in general is the problem of parameter fitting.

Different factors of Stability are multiplied with different parameters and then summed with each other. These parameters, unless very carefully designed (a task which is not always possible), would always mean that some factors are grossly overweighted and would overwhelm the other factors.

For example, lines 192 - 219:

I think you have given iModifier too much weight by giving them too many possible components. This means no civ can expand much beyond their core territory because the punishment is too severe. Moreover, I don't think iModifier should be multiplicative at all. I think most of their components should be additive (i.e. they should be added to or subtracted from the population of each city, instead of being multiplied with it).

I think the way around this problem (of parameter fitting) is to make the Stability calculation robust. i.e. largely independent of the specific values of the parameters. One way to achieve this is through percentage calculations, which you have used in your economic section.

We could talk more on Google Talk if you wish.
 
When i try the SVN checkout i see this error

2zmv.png


After several attempts i decide make the checkout in download folder..and the checkout happened like if the world don't have a tomorrow

The chekcout don't work in Mods folder..but working in download folder...someone know how resolve this problem?
 
Have you tried doing it with administrator privileges enabled? The error could be due to lack of admin rights to the folder.
 
^ Well, they are very legible. But I think you need a slightly different approach if you'd want to balance this in a reasonable amount of time.

There are some minor mistakes (I could be wrong of course) such as line 183:
bForeignCore would always be True since you looped through all the civs
Good catch, I've corrected this.

But by far the most important issue with balancing Stability in general is the problem of parameter fitting.

Different factors of Stability are multiplied with different parameters and then summed with each other. These parameters, unless very carefully designed (a task which is not always possible), would always mean that some factors are grossly overweighted and would overwhelm the other factors.

For example, lines 192 - 219:

I think you have given iModifier too much weight by giving them too many possible components. This means no civ can expand much beyond their core territory because the punishment is too severe. Moreover, I don't think iModifier should be multiplicative at all. I think most of their components should be additive (i.e. they should be added to or subtracted from the population of each city, instead of being multiplied with it).

I think the way around this problem (of parameter fitting) is to make the Stability calculation robust. i.e. largely independent of the specific values of the parameters. One way to achieve this is through percentage calculations, which you have used in your economic section.

We could talk more on Google Talk if you wish.
Expansion stability ultimately relies on a percentage calculation. A penalty starts to kick in once your periphery score exceeds your core score (both of which are heavily based on population, weighted by a modifier, as you know), or in other words, makes up more than 50% of their combined score.

I don't see how weighting parameters could be completely avoided. Individual cities have to contribute more instability than others depending on their location and whether they were acquired by conquest. Parameter fitting has to enter the equation somewhere as these effects need to be quantified. Getting them right is obviously the main balancing problem but it shouldn't be too hard.

By the way, I'd really like the score to scale proportionally with population instead of a constant offset from modifiers, simply because that would encourage making large supercities to avoid penalties again. I don't think the rules are too harsh as long as you don't go out of your way to accrue all of the negative modifiers. With the rules you're familiar with (I've chance the core weighting now to scale with your era, so that large empires are easier to maintain later in the game) while settling only historical tiles you can keep four times of your core population in historical cities, which is quite a lot. Consider that now only the city's own tile and not the culture-covered tiles count, which makes things a bit easier as well.

What I really want to make destabilizing is conquest and occupying foreign cores*. Again, this is counterbalanced by the collapse to core effect which kicks in on an earlier expansion crisis level than complete collapse, so if your instability comes from this you'll lose the territories that make you unstable and should return to a better expansion rating.

On another note, I think it's also time to remove the player's immunity to complete collapses. The new mechanics should give you enough of a warning when you come close, and the "keep your capital" rule was rather exploitive considering you could just keep your army there.

*this reminds me that cores of not yet born civs should not count, as that makes no sense and would probably ruin the life Rome especially.
 
Re: Expansion

I don't think Historical cities should be of any penalty at all. Just load a 1700AD England start and you'll see what I mean.

And by reducing the number of parameters I don't mean eliminating all of them. I just think you should have a core forumla with a minimal number of them first, while adding the extra modifiers on top of them.

Another thing: I think the Stability modification from City Culture or infrastructure (Courthouses) should be under Domestic category, not Expansion.

^ Including these parameters in Expansion instead of Domestic causes several problems:
(1) iModifier (Line 193 onwards) get grossly inflated when these parameters stack on top of each other
(2) Expansion Stability becomes harder to balance because you have more than double the amount of parameters
(3) You get the unrealistic outcome of an expanding empire having worse expansion Stability than a non-expanding one (who has the time to build up Culture, Courthouses, etc).

Suggested Expansion formula weighting parameters:

Core: (2 + iCurrent Era + bNationhood - bCityStates)
Historical: 0 + bTotalitarianism
Contested: -1 + bTotalitarianism
Foreign: -1, or -2 + bTotalitarianism
Foreign Cotre: -3, or -4 + bTotalitarianism

^ You need just these 5 parameters. Further parameters should be added only after the Expansion stability has proven to be balanced with these 5 parameters.
 
(3) You get the unrealistic outcome of an expanding empire having worse expansion Stability than a non-expanding one (who has the time to build up Culture, Courthouses, etc).
This is a sensible outcome in my opinion.

Rapid expansion should be a problem that disappears when you spend time to consolidate. The vanilla stability mechanic was very weird in often having the opposite effect.
 
This is a sensible outcome in my opinion.

Rapid expansion should be a problem that disappears when you spend time to consolidate. The vanilla stability mechanic was very weird in often having the opposite effect.
I'm not suggesting removing those effects. I'm suggesting moving them to the Domestic category rather than Expansion category.

Because otherwise it would cause the dilemma of an expanding empire unable to expand.

I working on the assumption that Expansion Crisis would be in the form of Independence/Barbs/other Civ's DoWs

and Domestic Crisis would be in the form of (city) Anarchy, Unhappiness, Buildings destroyed, and random Civics switches
 
Basically, this is how I imagine the different types of Crisis to differ from each other:

Expansion Crisis: Loss of cities.
Your Peripheral cites become Independent/Barb, or have armies of Barbs spawn next to them.

Domestic Crisis: You don't loose cities, but existing cities become worse.
City Anarchy, Unhappiness, Buildings/Improvements destroyed, forced Civics switches (Political assassinations).

Military Crisis: Loss of units.
Some of your units (especially if you're running Mercenary) will disappear or switch sides. Increased (+50% to +100%) War Weariness.

Econimc Crisis: Gold/Trade penalties.
-:gold:, -:gold: per turn penalties, loss of Trade Routes/Foreign Trade Routes/Trade agreements, temporarily increase Inflation, loss of Banks/Markets/Factories

Diplomatic Crisis: Diplomacy penalties.
:mad: penalties in Diplomacy, loss of OB/Defensive Packs/Trade agreements, loss of Apostolic/Congress/UN votes, DoWs

I imagine a rapidly expanding civ to be mostly dealing with the other four types of crisis instead of Expansion Crisis.
 
The effects are among the things I thought of, yes.

But China and Japan's economic problems show why Rhye originally gave your number of contacts a stability penalty. I think in general we need to differentiate between civs with a number of dynamic thresholds. For example, currently 10% growth is the break-even point for economic stability for everyone, while the original stability code treated civs differently depending on whether they tend to stagnate or grow very fast. Similar adjustments might be necessary to allow rapidly expanding civs their historical performance.
 
Free units means that you can have more units before paying upkeep for them.
 
The effects are among the things I thought of, yes.

But China and Japan's economic problems show why Rhye originally gave your number of contacts a stability penalty. I think in general we need to differentiate between civs with a number of dynamic thresholds. For example, currently 10% growth is the break-even point for economic stability for everyone, while the original stability code treated civs differently depending on whether they tend to stagnate or grow very fast. Similar adjustments might be necessary to allow rapidly expanding civs their historical performance.
I have an idea that may allow Economic Stability to be balanced without requiring you to come up with specific balancing parameters for each civ.

The idea is that a civ's Economic Stability only depends on its performance relative to the civs it has contact with.

- When a civ - let's call it iCiv - undergoes Economic Stability check, a list of all other civs which it has contact with (including itself - this inclusion is to prevent huge civs with only small neighbours to have rapidly fluctuating Economic Stability) is compiled, let's call it iNeighbours

- The sum of commerce output of every civ in iNeighbours is calculated, compared to the same sum done a few (10?) turns ago. The ratio (in terms of percentage) between these sums is the average economic growth rate of all civs in iNeighbours - let's call it iRateNeighbours

- The commerce output of iCiv is calculated, compared to its value a few (10?) turns ago. The ratio (in terms of percentage) between these values is the economic growth rate of iCiv - let's call it iRateCiv

- Economic Stability of iCiv = iRateCiv - iRateNeighbours + iSumModifiers

- iSumModifiers would be the sum of modifiers from factors such as game difficulty, Civics (Mercantilism should provide a bonus, for example), and other balancing concerns - ideally, iSumModifiers should have a universal formula for every civ.


This method has several advantages:

(1) It balances the Economic Stability of civs with numerous contacts (Europeans) against those with few contacts (Japan) without explicitly introducing parameters for individual civs.

(2) It is historically realistic - civilizations not in contact with each other should not affect each others' economy. In early game this eliminates unrealistic effects such as Rome's economy affecting that of Japan's. In late game it seamlessly transition into a global economy where everyone affects each other.

(3) It makes Economic Stability automatically normalized. iSumModifiers aside, the Economic Stability averaged across all civs will always be zero.

To address your likely concern that the compilation of iNeighbours may take up too much computing time (the only drawback of this framework IMO), it can be simplified greatly in the late game when turn times become an actual concern:

Civs who have the tech Astronomy would all share a single iNeighbours list - a list containing all civs. Hence iRateNeighbours will only be calculated once and shared between these civs. This represents the opening up of global trade starting with the age of discovery. Presumably this mechanism will give Europe a great boost upon the discovery of Astronomy and hits Asia with a penalty - again improving historical realism.
 
Yes, that's really elegant and I like it. I've thought about something like this before but so far attempted to keep the calculation as computationally simple as possible, but that has to be abandoned at some point evidently.

So who would you consider as neighbors? Civs you have contacts with? Or the constant neighbor list?
 
Back
Top Bottom