Author Topic: Mucking about with prosperity & production  (Read 4138 times)

0 Members and 1 Guest are viewing this topic.

Konrad von Richtmark

  • Veteran
  • *
    • View Profile
  • Faction: Swadian
Mucking about with prosperity & production
« on: January 14, 2011, 06:52:56 PM »
I've been thinking lately of what could be done to make prosperity more relevant, as well as solve the now infamous village-town prosperity drain problem. I'm not much of a M&B modder (and I've already undertaken a major modding effort for another game), but I thought I could see if the issue could be solved with a few quick & dirty tweaks (which could then be ported into other mods, if successful). I have, however, zero experience of Python coding, my native languages are C and Matlab. If anyone wants to jump in, feel free to, and we'll brainstorm and experiment together!

I went digging in the code, and found the following snippets that might be relevant:

From module_scripts.py:
#script_game_get_item_buy_price_factor:
(click to show/hide)

Konrad von Richtmark

  • Veteran
  • *
    • View Profile
  • Faction: Swadian
Re: Mucking about with prosperity & production
« Reply #1 on: January 14, 2011, 06:53:37 PM »
(continued due to post being split for being too big due to stuff under spoiler tags)

Initialize the economy. This seems to be where it's hardcoded what stuff is produced where. I was surprised to see that towns seem to produce a bit of grain too, representing surrounding fields "included" in the town according to the comments. It seems like this modest grain production is what makes towns keeping going even when the villages around have been burned. How do you think it would work to remove this grain entirely? It's not like any fields, no matter how close, would be immune to getting torched by raiders without capturing the town itself. If this grain was removed (and other production facilities increased to compensate), I suspect we might get a situation where a town being fed by the countryside would be an awesome centre of industry, but one whose villages would burn (and caravans raided) would turn destitute from food getting ludicrously expensive. That might reverse the absurd situation where looting of the villages actually benefits, rather than harms, the town.
(click to show/hide)

Konrad von Richtmark

  • Veteran
  • *
    • View Profile
  • Faction: Swadian
Re: Mucking about with prosperity & production
« Reply #2 on: January 14, 2011, 06:55:23 PM »
(continued)

Center production. I'm not understanding exactly what goes on here, but it seems like it's the ratios for how much stuff actually gets produced per "production building" in the above code. Convenient, I suppose, for changing general production volume of a specific good by a simple change of one variable.
(click to show/hide)

And the consumption side of it. Can't think right now of what help it might be, just putting it here in case it'd turn out to be relevant.
(click to show/hide)

The script for what happens when a caravan or peasant arrives at destination. I interpret the code as meaning "when caravan goes from point A to point B, the prices in point B drift towards those in point A by a proportion equal to the variable percentage_change (set to 30% always in this case). This would determine the "strength" with which caravans equalize prices around the world, am I right?
(click to show/hide)

From module_triggers.py:

First I noticed were the following constant definitions:
merchant_inventory_space = 30
num_merchandise_goods = 36
As far as I've understood the "supply" of a good isn't directly dependent on what the merchant has in stock, it's rather defined by the relative prices (the values that indicate shortages when over 1000 as listed by the guildmaster). Thus, the size of the merchant's stock would only determine how much the player can affect things by buying and selling stuff. Would (say) doubling these values have any detrimental effect? I can't think of any right now. The merchant would though have to be given more money on hand to be able to buy the masses of goods you haul in.

From module_simple_triggers.py:

Here's a script which apparently also triggers when a caravan or a peasant party arrives at a town. There's apparently a 35% chance that a village's prosperity increases by one point when the peasants arrive. Could a simple addition of code make there be a (separate) 35% roll for the town? That'd at least make the trade give a fairly constant prosperity increase regardless of the price equalization.

(click to show/hide)

That's all I've found by sifting through scripts, triggers and simple_triggers. Is there more elsewhere which concerns prosperity?

Anyways, assuming the above is what we have to work with, my plan is currently as follows: I'll try a simple increase in village productivity / decrease in village food consumption, while taking away food production from towns (and compensating with other stuff). See if that solves the village town prosperity drain problem; even if a peasant visit ought to increase manufactured good prices, it should arguably still be made worth it as food prices would get ludicrously high in the town without. If that doesn't work, I might have to look for "arbitrary" coded increases in prosperity for the town per peasant visit (if possible), even though I'd prefer to make the prosperity follow naturally from base game mechanics rather than appear out of nowhere simply because the peasants came on a visit.

What do you think?

Jammen690

  • Regular
  • *
    • View Profile
  • Faction: Neutral
Re: Mucking about with prosperity & production
« Reply #3 on: May 09, 2011, 09:53:42 PM »
Wow!!! It seems we have had a few deep thought here on the fourm lately but i never saw one spanning 3 posts.
Very well thought out by the way.

SPD_Phoenix

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Mucking about with prosperity & production
« Reply #4 on: May 10, 2011, 10:10:45 AM »
I was doing some changes to Calradia economy, but I have not had the time to finish it. With some of my new stuff, Calradia economy will be broken within a game year. A few thing I came across:
- Raw material demand and supply: increase the finished goods production volume without increasing the raw material production will actually make the town/village poorer. For example: grain, bread and ale. Increasing the bread production without increasing grain production would make the town/village eventually run out of grain to make bread -> no more bread -> no extra grain to make ale -> lack of goods -> price too high -> town/village get poorer. However, if you increase the village production of grain to supply the town mills, sometime you can't buy anything but grain due to the limited inventory spaces of village elders.
- I'm not sure if interprise will effect demand/supply of finished goods and raw material. With 5 to 10 towns making velvet, the high demand of raw dyes and raw silk would up the price so high that it would make the business unprofitable without increasing the price of velvet. Moreover, with that much velvet flooding the market, velvet should be dirt cheap. However, it does not seem to be so.
- I don't know how much (if any at all) caravan would effect the amount of goods available (not just the price).

A few things that I added to my mod:
- Towns/villages get the same basic production based on the terrain they are in.
- Items produced are set for each type of terrain. For example: more date in desert, more grain in plain land...
- Many new improvement for both town and village. The improvement will increase either raw materials production or finished goods production. For raw materials production such as farm, it works like increasing the radius of town/village and calculate new production level based on that. Most of the raw materials (grain, raw silk, iron, ...) are produced by villages. Most of the finished goods (tools, velvet, linen,...) are produced by towns, except food items.

Since, I'm not sure how interprise effect RM/FG demand/supply, I add a fixed number of production to the town when the interprise is up and running. Have not test the effect of that yet.

Hopefully, I would have some extra tine to go back to this when the new version of MS is out.
« Last Edit: May 10, 2011, 10:14:44 AM by SPD_Phoenix »

xenoargh

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Mucking about with prosperity & production
« Reply #5 on: May 10, 2011, 07:49:47 PM »
Blood and Steel's source has a totally new economy in it.  You might find reading it worthwhile. 

Instead of "prosperity" and a screwy system of supply and demand, I built an entirely abstract economy whose results are governed by population count (i.e., real population changes result in better income from fiefs, etc.).  Simply parse through the source looking for "population" to find the relevant changes.

Basically, I don't think that the Warband economy is truly fixable.  Because it uses an actual system of supply and demand, things will inevitably go sideways at some point, because of player actions, especially the Enterprises (you can create artificial depressions via scarcity, but, ironically, Enterprises in Native won't actually improve local economics, unlike the real world). 

About the only real fix I can think of is to introduce some artificial demand and supply at given locations, but getting it to work and be reasonably stable for a long game would be an enormous pain in the neck.  Hence why I built a system that doesn't actually worry about supply and demand at all, but simply handles the macroeconomic effects of player actions (for example, if not put under siege, populations in cities grow fairly rapidly, if under siege, they fall, if sacked, they fall again, if you build a Mill, it contributes to population growth, etc., etc., etc.).  I don't have the time to walk people through all of that code, but it's there for the reading.