1.4.4: Most Accurate Ever

After finally working out the entire income formula, I’ve improved CNExtend to the point where may be one of the most accurate calculators available for CN.

That’s a bold statement, but the truth is for certain improvements it’s enormously difficult to get within ~.5% accuracy. Let me give an example:

Let’s say we have a nation with 1000 working citizens, a gross income of 100, and a tax rate of 30%. They buy a clinic. What is the change in their collection, normalized for a single day?

Figured it out yet? Of course not, it was a trick question. You still don’t have enough information. For starters, you need to know how many other clinics they already have. Since improvements of the same type stack, adding one clinic when you have 4 existing clinics will yield a different result than if you had zero existing clinics.

So, let’s say we have a nation with 1000 working citizens, a gross income of 100, a tax rate of 30%, and two existing clinics. I’m sure you can guess given the size of this post that is still not enough information. We also need to know how many soldiers they have!

What do soldiers have to do with population? It turns out that after all modifiers such as clinics are added, soldiers subtract an absolute number of citizens. Specifically, the number of soldiers * 0.01 * (environment – 1). Since this happens after clinics have their effect, we need to re-add that population before we can start figuring out what impact this new clinic had. Since this impact involves environment we need to know their environment rating as well.

So, amongst our nations properties are such diverse elements as: 1000 working citizens, a gross income of 100, a tax rate of 30%, two existing clinics, an environment of 3, and 500 soldiers. Is that enough? Well, as it turns out that will get you pretty close. But it’s still not enough.

When you add population, you end up decreasing your income. It’s not generally a large amount for most nations, and the effect is hardly noticeable when buying infra because infra mitigates this effect. However, increasing population through land, wonders, or improvements will have a small but noticeable effect on your income. Since this effect includes infrastructure we need to know that. Oh, and we also need to know about any income modifiers at all since they all apply to this effect. Banks, Guerrilla Camps, etc.

(For those pointing out that you can’t have all these improvements with so few citizens, or that the infra vs citizens ratio isn’t right, I know, it’s just a simplified example)
1000 working citizens, a gross income of 100, a tax rate of 30%, two existing clinics, an environment of 3, 200 soldiers, 400 infra, 3 Banks, and a Harbor. Any of these things change and you get a different result. And this is just a clinic.

A border wall includes a population change, a happiness change, and an environment change. Environment changes on their own also cause happiness changes and population changes. Both the original and indirect happiness changes cause income changes, and so do both of the population changes. They are by far the worst, and getting them to within 1% accuracy has been quite a challenge. At this point population improvements are within .1% accuracy, and I believe that any further improvements will have to come from figuring out exactly where rounding is occurring. At some point it will be impossible due to the fact that the infrastructure numbers stored internally are more accurate than the ones displayed. For instance, you can buy .001 infra or .005 infra and it can have an impact on your population.

Fortunately, I don’t need an individual formula for each improvement. Instead, CNExtend extrapolates changes to your stats based on the improvement’s properties, which are generalized for things like population, environment, and how many if any existing improvements of that type you have.

Well, this update is long enough as it is. By the way, if you figure out the answer to the clinic problem, post it up in the comments. First person to get it right while showing their work gets 3mil, 50 tech, and a gold star.