Version User Scope of changes
Feb 1 2008, 11:53 AM EST (current) lvl_50_noob
Feb 1 2008, 11:35 AM EST lvl_50_noob 3 words added, 4 words deleted

Changes

Key:  Additions   Deletions
Guide by MKramer at http://warbookforums.com/smf/index.php?topic=196.0

I've been playing around with a sheet of paper all morning trying to figure out when it makes sense to rip down mines, build barracks, and put up mines again in the cycle of army building. I have hit upon a simple formula that is acreage-independent.

We want to know when the Savings of barracks = the Cost of building them and then replacing them with mines again.

S = C

Now I'm going to introduce a few more variables:

P = percentage of mines.
t = hours.
R = Resources expended on troops in Pt.
T = Total resources in Pt.

A = trade agreement factor.
U = upkeep factor

To get an abstract formula, everything will be reduced to the Pt unit. Pt is not a variable, it is a unit. Don't get confused. In the course of doing this, I realized that mine percentage hours, Pt, are the best mathematical representation of resources available. You can just call them "points". Points are held constant for any level of acreage and all costs and earnings can be reduced to points.

Calculating C


C is the cost of building barracks and afterwards replacing them with mines. C represents the costs of paying for two buildings in this cycle (the barracks and the mines.)

Consider a hypothetical kingdom, Smallville, of 100 acres. 1 mine produces 30 extra gold and it takes 33 1/3 hours for it to produce the 1000 gold necessary to build itself and another building. You can abstract this cost to 33 1/3 MINE PERCENTAGE HOURS, or 33.333 per percentage which is rebuilt. To get full barracks, that's 25 * 33.33 = 833.33

C = 833.33Pt

C IS DIFFERENT FOR GENERALS and MOGULS. It's 916 for generals and 750 for moguls. If you are trying to use this formula, make sure to plug in the correct C.

Calculating S


Savings = Resources expended on troops, in other words, S = R.
Assuming we want to spend all our money whenever we do this, R = T - C.
Plug that in.

S = T-C.

We are solving for S = C. By substitution,
C = T - C).

Solve for T in terms of C. T = 2C.

Solving the Equation


Back at Smallville, assume P is 100. We have more than 100 Pt, though! Your total acreage contributes a certain amount of P all on its own. In fact, it contributes exactly 33 1/3 Pt. (10/30). But wait! There's more. Trade alliances also need to be factored in. A = 1.15 for non-moguls, 1.5 for moguls. Meanwhile T at any t will be reduced by the upkeep cost. Here we introduce another concept, the upkeep factor U. To find U, divide your upkeep cost by your gross income.
T = (33.33 + P)A(1-U)*t

By substitution,

2C = (33.333 + P)A(1-U)*t
---

Once you have determined your own, P, C, A, and U, you will have t.
---

THE MAGIC FORMULA IS....

t = 2C / ((33.33+P)A(1-U)).
This formula works at any acreage and for any type of troop purchase. P, C, A, and U are all information available to you from your kingdom stats pages and from this post.

I'm an automator. I'm plugging in A = 1.15, C = 833.33, U = .1, P = 100.

t = 12.10 hours. This is a reasonable number. It means that if I keep on 100% mines, I will break even from a barracks splurge in 13 hours (always round up). Anything after that is a savings from not building the barracks. Anything before that, it's cheaper to not build the barracks. If P is less, t is higher. For instance if you keep on 70% mines (i.e., P = 70), t = 24.451.

Whew. Have a nice day.



Added by lvl_50_noob 01-Feb-2008--------------------------------------------------

It's much simpler than that

Cycling is better than permanent barracks, if;
3 x C x D is bigger than 100*

Cycling is better than no barracks, if;
B x C / A is bigger than 500*

Permanent barracks are better than none, if;
B / ( A x D ) is bigger than 15

*(As Generals have +10% building costs, these vales are also 10% higher for them. 100 -> 110, and 500 -> 550)

Where
A is your total land
B is the amount of Gold spent on troops per hour
C is the number of turns you are willing to wait between cycles
D is the gold increase factor

If you're having trouble working out these values.

B.
Most people usually spend their entire income on troops each hour, so if you do this, then the value for B is your total income, which can be found on the "your kingdom" page.


D.
The gold increase factor is the amount your income is increased by trade agreements, and alchemy.


-Trade agreements increase your income by 5% each, (10% for moguls).
This value is usually +15% for most, and +50% for moguls

-Alchemy is not an hourly factor, so needs to be averaged out.
take the number of times alchemy is used per day, and dividing by 24, to get an hourly average.
Then take 85% (multiply by 0.85) of the hourly average (as alchemy gives 85% of your revenue).
This final value is the average percent alchemy increases your gold by each hour.
This will probably be +28% for most, and +46% for wizard.


Then just combine the 2 factors to get the average gold increase per hour factor.
It's easier to use the values as decimal increases, rather than percentages, so just divide the value by 100, and add 1 ( 15% -> 1.15 | 28% -> 1.28)

The final value will usually be 1.47 (1.15 x 1.28).


Top Contributors