Below are results of my empirical tests from before version e1.4.1 (these results may be outdated to some extent).
Generally all prices in the game follow some hyperbolic function (y=k/x^n, where k seems to be linearly dependent on prosperity):
Figure 1. Price distribution
Price has some caps: minimum and maximum prices. It is broken when too close to both of these caps. For example, velvet prices crack to 1 above 2000 or something price tag.
For velvet the lowest price is around 32.5 (30 to sell, 35 to buy), for leather 28 (26 to sell, 30 to buy). For Aserai Horse it is 370 (342 to sell, 398 to buy on one skill level, 345 to sell, 394 to buy on another skill level).
As you can see, trade penalty is applied on both sides.
When you purchase and sell some goods - price shifts on that graph.
The other time when price shifts on that graph is when day changes, and price is not stable for the current stock amount.
Figure 2. Stable prices
When day changes, price is getting closer to stable for that stock amount and prosperity.
It seems like change amount follows exponential function too, it will take one day to greatly shift prices with huge stock towards much lower values, but with zero stock prices rise back almost linearly.
As I see it, for now amount of goods consumed is based solely on prosperity. And town with higher prosperity can use per day more raw material without workshop than another town with workshop using that raw material.
So in the end price is based on the stock amount/prosperity, which depends on the amount being consumed, so
generally prices are higher where demand (aka prosperity) is higher and lower where villages produce resources (they increase stock amount in town, which shifts prices towards lower). You can say that this is exactly what do you want. But I think simply linking the demand to prosperity is not the best solution.
For equipment there seems to be no demand/sinks whatsoever, so it is just stockpiled at town producing it. Prices for equipment are constant (do not change when you buy/sell).
There is a group pricing for mounts now, I guess it could be used for equipment too.
While it may seem easier to make everything as simple as possible, to add hardcoded caps and spawn/despawn things to fix problems, it does not always work well, and tuning needed to always stabilize hardcoded values can be more problematic that just making things work as they are, allowing them to reach equilibrium and balance themselves.
Self-balancing economy
It could be done that resources/gold do not appear/disappear, they change their form from one to another. That could mean that overall resource quantity is fixed, which is not something you really want, there need to be some sources and sinks: villages with raw resource production and town workshops (value of produced goods is higher that raw resources used) can serve as sources, destructive actions of men (sieges, raids) and resource shortage/starvation can serve as sinks (sieges should lower the level of structures too).
If resources/gold spawn will be turned off, there need to be some ways for everything needed to appear where it is needed. If there would be supply and demand, market and trade can help with that.
1. Demand
Towns demand food, clothing, tools (especially during construction works), hardwood (especially during winter at cold regions), other trade goods (like salt). With high prosperity they start to require high quality clothing and jewelry. Requirements of workshops are added to Town requirements. Towns themselves require the very minimal amount of raw resources used by workshops. They consume some very minimal amount of equipment too.
Castles require food (“passive”, see below).
Villages require tools (especially during construction works), hardwood (especially during winter at cold regions), simple clothing, salt. As well as gold to pay taxes.
Total demand is based on prosperity of a town, level of workshops.
Food could be divided into "passive" food in granaries and "trading good" food that could be sold and bought. "Passive" food transfers without villagers carrying it. "Trading good" food can be transferred to "passive" food.
While food demand could be fulfilled only by "passive" food to prevent starvation, towns require varied food too.
Food demand is distributed evenly by all the "trading good" food types. If some types are not available, town will consume available ones instead. Wine and beer demand is half of other food types demand.
When granary with "passive" food storage decreases with time, "trading good" food consumption is increased to
cover up the shortage.
Depending on demands fulfilled or not,
prosperity will increase or decrease, proportional to the cost of consumed goods. That cost is
deducted from the gold supply of a town.
Prosperity will not increase if food amount in storage decreases with time.
To have weapon/armour demand recruits in town may require some equipment: depending on recruit level different level of equipment. If there is not enough equipment of high level, recruit level decreases and demand for high-level equipment rises. Then that demand decreases with time to default values. When there are enough weapons/armour (that may be determined proportional to prosperity, for example), workshop produces only tools.
So demand for equipment will be higher at towns where more troops are recruited frequently, and equipment will not be stored in enormous amount without being needed by anyone.
If village have no gold to pay taxes, it pays it from prosperity.
Towns can convert gold-prosperity too, to have some amount of gold to trade. Excess gold converts to prosperity.
So whenever there are some problems with denars, it could be solved through prosperity conversion.
2. Prices
Generally prices do what the should do already. They help to distribute goods from places with surplus to places with shortage. If instead of prosperity demand (amount required - amount produced) as above would be used, they will help to distribute goods better.
I did think of some simple equations myself, I guess I will post it here.
First of all,
Cost should be defined for different trade goods, it could be based on the amount produced daily by a village with default production speed. It may be better to use overall (whole map) daily production in case it could change considerably. Anyway, some default prices are already defined in the game.
Then with
Cost and
Demand (amount required - amount produced) following equations could be used.
Optimal stock amount = 10 days worth of
Demand
Price base =
Cost * (
Optimal stock amount + 10)/(
Available stock amount + 10)
Price multiplier (recalculated daily) =
Previous price multiplier * (((
Optimal stock amount + 10)/(
Available stock amount + 10))/
Previous price multiplier)^0.1
Resulting price =
Price base *
Price multiplier *
Trading penalty
All the constant (10 and 0.1) values could be changed and tuned accordingly, but some kind of balance should be achieved anyway, with different absolute price values (constant 10) and inertia (constant 0.1).
With these equations there will be a
quick-changing base price, reacting on the supply-demand instantly (even while you buy-sell), and
inert price multiplier that will change daily,
adding stability to market.
All the towns will try to stay at their Optimal stock amount, dependant on the Demand.
Advantage in comparison with current equations used will be better stability (price multiplier changes very slowly because of 0.1 exponentiation). Now you can stock huge amount of resource, sell it at evening, and on the next day prices at this town will fluctuate a lot,
even after you buy everything back.
It will take one day to greatly shift prices with huge stock towards much lower values, but with zero stock prices rise back almost linearly, much slower.
That will be price formation at towns.
Villages will sell their production at price forming from the nearest town (or multiple towns) buying price.
3. Logistics
Villagers provide raw resources and recruits for town by travelling there with these resources, taken from village stock when their
Available stock amount reaches half of the
Optimal stock amount at town. Only one group of villagers per village, it gets bigger with village prosperity increase.
Villages will not sell goods apart from their production (they will fulfill their demands and increase prosperity) and will not have these 1000 denars spawned to buy anything. Goods sold by a player are available for trade for some time.
Town produce goods for town itself and villages (like tools and clothes), accumulate gold for villages to pay taxes, villagers take excess (after deducting taxes) of gold back to the village. That gold will be available for village to trade and will transfer to prosperity with time.
If villages are intercepted by some brigands, everything they carry will transfer to these brigands (as much as they can carry).
There should be generally
more resources and less overconsumption.
Now usual amount of everything in town is for several days.
If stocks would be larger, that will grant much more stability to economy. It will react to changes before the storage is already empty.
One of the reasons there are prosperity-food garrison death waves - is that towns consume the food much, much faster when they have surplus, and starve when they have eaten everything, as their granary is small (one-two days worth).
Granary should be around one dozen times larger, and
prosperity should not rise when food quantity is decreasing (that should be already “
food shortage” in prosperity change calculation, not when there is nothing left in granary anymore). That should help to shift prosperity-food equilibrium towards full granary, not towards empty granary and dead garrison. Together with turned off overconsumption (“trading goods” food is consumed more than standard demand only to compensate town food shortage) that should solve the problem.
Overconsumption should appear when there is just so much goods that surplus is maintained for a long time. So I guess
it should need time to increase, while it can drop drastically much faster and can be turned off as soon as there are less than Optimal stock amount in the town.
While there should be
minimum demand for raw resources without workshops, workshops should be more productive and gain levels to produce even more.
Local caravans should always have in mind that they will return to their town and prioritize trade offers profitable for that town, especially their own workshop needs.
There should be some non-local
“neutral” caravans travelling everywhere. Generally there should be considerably more “neutral” caravans. And caravans should transfer more resources.
Diplomacy could allow an option to prohibit caravans of specific faction entering the lands of kingdom. Making it possible to attack them freely when they disregard that restriction and making economic situation for enemy harder.
Roads could be added to map, allowing to travel with better speeds, but brigands could ambush caravans at roads. There could be road maintenance and security policies at cost of militia quantity.
Then, when the economy is stable enough, you could set up your trade routes for the caravan to follow and note what and where should it buy.
4. More interactions
To make interacting with economy even more interesting, there may be a way to
change village production. For example, adding secondary village production, which player can choose and invest in. For every village there may be efficiency coefficients for different production types. Primary and secondary production could be the same.
I believe there should be no restrictions for player to own
many workshops (especially at owned fiefs). There could be income penalty for workshops when you have too many of them.
There should be a way for workshop owner to
change workshop production, for village to change production (if that option would be added) without order from the player. To better react on the current market situation. And that could help with cases when player purchases all workshops, change their production to something bizarre and sells them again. Another way to deal with it is to
just return the workshop production to the default one.
For the cases when the player will have too much of an income, some
additional gold sinks could be added: player can increase village production/prosperity for gold, train recruits better, start feasts, festivals, tournaments, invest in new clan formation for your companions, militia training, road maintenance, there could be many ways.
If prosperity increase would be slower, player can boost it with denars. Everything could be upgraded. There could be more policies to decrease taxes/income for better prosperity/production/militia/whatever.
5. Current issues and possible solutions
Prosperity-food garrison death waves is pretty much another topic. I touched it here too, but more in depth discussion is
there.
Equipment has no demand. It just stockpiles in towns in crazy amounts. Recruits can make demand. Some equipment could be slowly consumed by town, and while there is enough, workshop produces tools instead.
You/towns gain
no hide by slaughtering cows.
Demand should be reconsidered with less raw resources consumption without workshop, with higher workshop productivity, other suggestions check above.
Amounts of everything is too small, leading to instability. You have only one-two days worth of reserve. Overconsumption should be avoided (until it is necessary), stocks increased, especially granary volume.
“Long-term” (changed daily) prices can fluctuate too fast with sudden stock changes, which leads to instability (especially together with little stock amounts and overconsumption). Maybe speed, at which price is approaching “stable” value should be decreased (details see above), especially for huge stocks lowering prices greatly. I did write some other equations too, but the ones used in game at this time could be tuned, I assume.
The reason I did write so much is that I like how economy in this game looks, and will appreciate if its potential will have a solid realisation.
Best regards.