Kailric
Jack of All Trades
I am converting this first post to detail all the changes about the Economy in M:C
-sell 25 units per worker, Wily sells 50.
-connected trade posts increase it by 25
-Each connected foreign city without a trade post should increase by 5
-Each connected domestic city should increase by 5.
-Each connected domestic city with a 'market' building should increase by 10/15/25.
Current Screen Shots
Original Post:
-sell 25 units per worker, Wily sells 50.
-connected trade posts increase it by 25
-Each connected foreign city without a trade post should increase by 5
-Each connected domestic city should increase by 5.
-Each connected domestic city with a 'market' building should increase by 10/15/25.
Current Screen Shots
Original Post:
Spoiler :
I looked though the source code for that one and it appears surprisingly simple to implement. However I started thinking if it's good enough.
First of all I want to link it to the marked on/off sales. I would also argue that at least a simple marked should be available from the start as income is really tricky in the beginning.
I also came up with the idea that citizens can use yields. Not just the units, but the city counts the number of units working in buildings and the number working in plots. It will then create an extra demand based on those. This shouldn't be linear with the number of units. Instead it should encourage building huge cities, which intentionally clashes with max population restrictions.
Some amount of randomness. The modcomp adds all demands for yield X, then it divides it with 100 and the actual demand is there. I would like it to subtract 0-50% randomly in order to make the domestic marked more unpredictable.
Store leftover points. If a demand is 20, then it would demand one of those yields every 5th turn (or every 5-10 turns with random demand). If you don't sell on the turn where the demand is, then tough luck. It's gone.
Some amount of randomness in units. Say a UnitType is set to demand 50 of 4 different yields, but have a max demand of 100. Whenever a new unit is created of that type, 100 points is distributed randomly between those 4. It should take the amount for each into account as it should be more likely to demand more of a yield, if it's set to 100 than the 3 set to 50. This mean two units of the same type might demand noteworthy differently from each other. You can then have good and bad units based on what you produce on your land.... now which one do you want to make a scout and which one do you want to stay in the city?
I think this would be the most ideal solution as it would provide the ability to have a fair amount of domestic trade while at the same time it's unpredictable enough and it will not be the same in two games even if you do the very same thing twice.
Yeah, I agree the consumption should be able to be turned on/off by the Market mechanism, and it works well to have it act like a regular use of yields as you said earlier rather than a totally separate system like in the original modcomp. The <AutoSellsYield> used by buildings like Market could be repurposed to mean that the building enables local consumption of that yield (which can be set on/off after having that building). The basic town buildings in M:C could allow trading in some basic goods, while fancier ones like Wine need a Tavern, etc. I'm not sure what the MODER_CODE_TRADING_POST currently does in addition to that though.
I guess it would be good to add some element of randomness to demand, but it could eventually get a bit fiddly for players to cope with tracking idiosyncratic demand values that remain fixed and different for many dozens of individual units. (Also, in the timeframe of Civ4Col mods the units don't represent a specific individual person with unique preferences that stay fixed forever, rather a group or class of local people many of whom continuously die and are born etc during the course of a game). But like you suggested, in addition to the base demand from units/buildings there could be some random fluctuations in local demand across time, like there are in any market. That plus the existing randomness in what emigrants you get and what yields are obtainable in local terrains should make things play interestingly different in each game.
(edit: it might eventually be interesting to add some random Events using the xml Event system that could add extra demand temporarily to a city due to a temporary shortage or disaster. i.e. "Shortage of Barley in Paris! Demand +5 for 10 turns.")
What do you guys think re this earlier proposal to let local prices vary somewhat based on supply/demand balance? It would probably take quite some doing to have local prices, but letting prices respond gradually to supply/demand imbalances could make the interplay of supply/demand and trade opportunities a lot more interesting.
I've been thinking about a mechanism for allowing supply and demand to realistically shape local prices, while allowing plenty of flexibility to balance these features however is desired using just XML. Here are the ideas I've come up with, let me know what you think!
Where iBuyPrice is the current buying price in that city, and the already existing variables below come from CIV4YieldInfos.xml:
iBuyPriceLow : minimum buying price of that yield
iBuyPriceHigh : maximum buying price of that yield
iPriceChangeThreshold : price sensitivity of that yield (how many units you'd need to sell to drive the price down to iBuyPriceLow, or how many units you'd need to buy to drive the price up to iBuyPriceHigh)
iSellPriceDifference : difference between buying and selling prices (may work best to convert this to a percentage rather than a fixed integer?)
Whenever a yield is bought from a city during trade, call the following function, thus raising the local price by a degree proportional to the amount bought, never exceeding iBuyPriceHigh.
iBuyPrice = min(iBuyPriceHigh, (iBuyPrice+(iBuyPriceHigh - iBuyPrice)*(iUnitsBought/iPriceChangeThreshold)))
At the end of the turn, add up the Demand from local units/buildings (based on Androrc's mod), and call the above function using this demand as iUnitsBought; thus generating upward support for prices based on local demand.
Whenever a yield is sold to a city during trade (or sold via its Market/Tradingpost building at the end of the turn), call the following function, thus lowering the local price by a degree proportional to the amount sold, never less than iBuyPriceLow.
iBuyPrice = max(iBuyPriceLow, (iBuyPrice-(iBuyPrice - iBuyPriceLow)*(iUnitsSold/iPriceChangeThreshold)))
iSellPrice can be updated after each transaction as follows:
if using iSellPriceDifference as a percentage margin: iSellPrice = iBuyPrice*(1+iSellPriceDifference)
if using iSellPriceDifference as an absolute margin: iSellPrice = iBuyPrice+iSellPriceDifference
The basic effects should be that local prices drift down slightly if you're earning lots of gold from selling a certain yield to a city via trade or Trading Post/Market; and drift up slightly as the city generates demand for that yield (especially if that demand goes unfulfilled by selling). The price sensitivity and min/max price for each good can be set as desired. Special markets like Spice Route could get their own set of modifiers to adjust min/max price of certain goods for their unique situation, and cities with high Prosperity can get a bonus to the Demand they generate, building higher prices and profits there. Overall it would be a cool way to generate realistic and subtle shifts in local markets in response to supply/demand, so you can benefit by satisfying your citizens' demand through good strategy, without having to micromanage to an artificially precise limit like "demands exactly 3 Cigars per turn".
The main issue I'd see with this (or any other system for price change) is that in vanilla, the smallest possible price change of 1 gold ends up being extremely large in percentage terms for many goods with low price per unit (less than 5 or so, where the smallest possible movement is 20%). And if a given transaction isn't big enough to move the price by at least 1 unit, its effects won't be stored unless we make some special remainder variable to store it. The easiest fix for both of these would probably be to "inflate" overall price levels by a set amount so small/gradual price adjustments become possible. The vanilla system seems pretty crude with a large random component, so almost anything would be an improvement..
Maybe it would be best to start simple. First step would be to add demands for buildings, get it working and then commit. After that add demands from units, commit and then we will figure out what to do from there. A great plan for a goal is useless unless you know how to get there. Just adding demands for buildings without any randomness or anything to it appears to be strait forward. Units shouldn't be too hard either.
I will postpone the whole pricing scheme until later as well. No use for price on something you can't sell anyway.
Ok, sounds good BTW once Buildings can generate demand, I think it should already become possible to implement moddable XML Events boosting local demand temporarily without need for DLL changes. (XML Events could create an invisible "Building" with that demand effect, which could be destroyed after x turns.)