Yes, the value is whatever the market will bear, but the thing is, supply and demand is not something we humans follow in making our civilization, supply and demand is a way of explaining how we already behaved, which more-or-less fits our behavior patterns. Our actions created it, but now we're talking about making it create the actions and thinking patterns of simulated shoppers.
:3 Well put.
I believe the best way to go about this is to take the reverse route as much as possible, i.e. model the behaviors of the individuals and from this have the phenomena of supply and demand emerge. Allow me to emphasize as much as possible, since I think it will be impossible to model each and every individual entity's behavior in a given DF world and their contribution to everything... so some sort of larger scale approximation of how larger social units/groups/whatever behave and influence the perception of value on the individual scale of dwarves in your fort would inevitably be needed. I'll get to that...
In this thread (http://www.bay12forums.com/smf/index.php?topic=69644.msg1721432#msg1721432) me and some others have been discussing sort of how to go about this. There are some ideas I really want to get back to and offer some concrete idea of how to model it, as in how it would look like and be in game.
One thing I would like to suggest is making value more than simply how many arbitrary dorfbux something is worth as a trade good. I think "value" should be a bit more nuanced than that. Instead of value referring to the explicit numerical value of an object in arbitrary units, I suggest value be looked more at as the value of making a particular decision, as in the decision of trading X amount of cows for Y amount of *microcline mugs*, or the decision of attending a party Urist McLazyass is putting on vs. doing a mandated construction job. You could still have "value" in the sense talked about before in this, with the going price of something in a particular currency (like dorfbux or gold coins or whatever) being the average amount of dorfbux/coins/whatever most average Urists would agree to part with for it in any situation***. So, it would be the average "value" of the trade decision more than simply the price of the object in question itself.
I hope I make sense.
***this could be something either calculated behind the scenes and reported to the player directly, or could be determined by someone in game (an economist dwarf anyone?) who would report their findings to you (which could be inaccurate or accurate!) ...just brain farting here...***
So, how to model this idea of value... in the thread I linked earlier, I suggested looking at all facets of what would influence value. I had some categories of value I threw out there to get the ball rolling. This idea could really use some more discussion and development. The categories I threw out were:
Sentimental
Utility/situational
Quality
Cultural/societal
???... other motivating factors ...???
A somewhat poorly thought out example of how this might play out that represents sort of what I am trying to get at:
Urist is hungry. His hunger somehow influences some "value" variable in some process (in the code) that pushes the "value" value or seeking food over value of doing other things.
Any edible object that is within view (or memory) of Urist is assessed for its general desirability (influenced by personal preferences (palatability), cultural norms, etc.).
Urist sees a Plump helmet, a lavish prepared meal of his favorite ingredient (deer meat), a sweet pod, and a moldy piece of bread.
Next, Urist assesses who owns each item.
Plump helmet: owned by an acquaintance
Lavish meal: owned by a person who hates him
Sweet pod: owned by a friend
Moldy piece of bread: owned by himself
Next, each owner is assessed for whether or not interacting with them is a good idea (social standing, distance, fear, etc.).
Next, an idea of what general prices would have to be paid is assessed (which could be influenced by social standing between the two... perhaps this could be telepathically determined for simplicity as if each had sat down and made their conditions for trade clear... this would remove having to meet with everyone individually).
Plump helmet = will trade for 2 -microcline mugs-
Lavish meal = will trade for first born or a ridiculous sum of money or something
Sweet pod = will give for free depending on social standing, outstanding debts, whatever; will trade for 1 -microcline mug-
Moldy piece of bread = free
Next, Urist decides if trading, begging, or stealing is the best way to go about things (punishment vs. reward, fear, cultural norms, available resources, personal ethics); what consequences other than getting food and losing traded resource...
Plump helmet = trading: increase in standing, loss of last 2 -microcline mugs-, one of which is needed for a mandate (which would bring its own consequences!); begging: possible decrease in standing; stealing: possible decrease in standing, punishment, guilt (goes against ethics)
Lavish meal= trading: possible increase in standing; begging: possible decrease in standing, increase in owner's spiteful happiness, loss of standing with others maybe; stealing: could get caught (depends on some other factors...), punishment undesirable (i.e. head smashed in), loss of standing, increase in happiness from stealing from enemy
Sweet pod = trading: increase in standing; begging: possible decrease in standing (unlikely); stealing: possible decrease in standing, guilt (goes against ethics)
Moldy bread = trading: wouldn't really be a trade, but would be free!; begging, stealing: N/A
All of these steps generate a series of possible decisions to make, each with a calculated value. The decision with the highest value is the one that is executed.
In addition to the consequences listed earlier for each decision, each decision could be modified by things like distance to make trade (inconvenience) and perhaps other things.
In this case, Urist decides to trade for the sweet pod.
The above example hopefully isn't too complicated... and it does have a whole assload of interdependencies that I am not sure are feasible to account for with current computing power... but they might be. And I am not formally educated in matters of psychology, so I might be positing a very incorrect model of decision making. I dunno.
Anyway...
The way I'd see it, there would be some arbitrary behind-the-scenes "value" unit for the underlying math that governs the decision making process modeled... but yeah. Ideally, I'd like to see a value system that takes things into account like peer pressure (cultural and social norms included), urgency and utility, fear of punishment, immediate pleasure, and stuff, and from this have value procedurally emerge. And this value system would not only work for trade matters on the individual level but could be co-opted for all value judgements (maybe not pathfinding, though). Check out the thread I linked and the spoilered example for more info.
Ideally, this would be modeled for everyone individually. For the fort, maaaaybe this is feasible. For things outside the fort, not so much. Larger social entities (villages, cities, armies, whatever) could be treated as individuals in these cases and I think it would still work. The same underlying factors would still apply, but would be sort of averaged out in the process, reflecting the general psychology and motivations of the social entity. I'm going to think this through some more and come up with a concrete system hopefully.
Government could stem from this, but that is probably beyond the scope of the present discussion, though it has a huge bearing on economics and the like. I will get into that later.
The more major complication on elasticity of demand is "substitutables". In real life, beef is the most heavily demanded and pricey meat. Pork is a substitute for beef - it's cheaper, but people want beef more, so they are willing to pay more for beef. Cereal is an even cheaper substiute than either of them.
I think there are ways to deal with this without making our computers cry.
Dwarf Fortress has, essentially, four classes of goods:
Leather
Rock and clay**
Ore
Flux
Cloth
Wood**
Bars**
Blocks*
Seeds
Anvils*
Pump works*
Picks*
Animals
Dyes
Cooking-required raw foods (flour, sugar, QB leaves, etc.)
Gems
Bags*
Thread
Ropes**
Barrels*
Sand
Raw glass
Coal
Lye and potash
Pearlash
Buckets*
Nest boxes, hives, jugs*
Mine carts and wheelbarrows*
Food
Drink
Clothes
Some furniture* (beds, chairs, tables, coffins, doors, armor stands, hatch covers, grates, etc.)
Slabs
Weapons and Armor*
Ammo
Plaster
Splints, crutches*
Waterskins, Quivers, Backpacks*
Mechanisms, Trap Components and Cages*
Crafts, toys, instruments, mugs (would become civilian goods if used in skill training, etc.)
Other furniture (statues, windows, etc.)*
Blood, extracts, golden salve, gnomeblight (ditto)
Anything with decorations
Stuff that does not break and is not consumed (capital goods, if you will) is marked with an asterisk. A double asterisk denotes goods which have both consumption and capital uses (e.g. rocks can be both a building material and a raw material, chains can be both furniture and input into traction benches).
Just from skimming the list, we can already arrive at two rules:
Demand for non-perishable goods must be based on stock variables, demand for perishables on flow variables. Supply of non-perishables is the available stock, while supply of perishables is the available flow.
A farming village of the human civilization The Rusty Buckets with a population of 26 and a wealth level of Subsistence will need a number of barrels in total and a number of meals per year. Prices of barrels will depend on the number of barrels available in the center of trade relative to the number of barrels needed by the entities using that CoT. Prices of meals will depend on the number of meals brought into the CoT per year, relative to the number needed by the users of the CoT.
(This is a key part of what is called "stock-flow consistency" in econospeak. Failure to observe stock-flow consistency is the single fastest way to put your model on the crazy train to la-la-land.)
Demand for luxuries should be based on the level of wealth of the community. Demand for military goods should depend on the (desired) level of military preparedness. Demand for the necessaries of life should depend on population size and species.
In the real world most prices adjust only slowly, for a variety of reasons. Quality can be treated simply as nested subsets:
The base price for a category evolves as [category base price, this year] = [category base price, last year] x(1/(1+[constant specifying ease of stockpiling]x[last year's relative surplus, if any]) + [constant specifying urgency of making up shortfalls]x[last year's relative shortfall, if any]) - [constant related to fungibility between quality levels]x[absolute markup over next-best quality level (if any)]
A "category" is defined by fungibility and quality. "Weapons, + or better" could be a category, if entity military doctrine is not specified. Alternatively, "short swords, + or better" could be a category, if each entity has a preferred TOE for its armed forces.
This model provides a computationally simple algorithm which is able to produce quite complex behavior. Depending on supplier behavior, it can generate Lotka-Volterra-style cycles, you can see higher-quality items crowding out lower-quality items as the manufacturing base becomes more skilled, etc.
That should about cover it for the demand side and the pricing mechanism. Next in line is the supply side, a market structure and a bit of wrap up of some loose ends in defining the precise demand functions.
I have a few thoughts about the currency idea. In the process of typing this, I've actually convinced myself against coins as a trade good.
Assuming supply-and-demand is implemented, the Human caravan demands goblets with a multiplier of 110% and your civ's currency for 133%. If you immediately put in a work order for 20 iron goblets (with all goblets forged as exceptional quality), and let them sit for the full year until the next Human caravan. Then, once the caravan arrives, you see that the price of goblets has since plummeted to 25% of their value from 1 year ago, and the trading value for your civ's coins is 3% below what it was one year ago (modest inflation?). If you made only goblets, your trading value has fallen from ☼13 300 to ☼3 325, or 166/each ([Iron Value 10* Goblet Value 10 * Exceptional 5 *20 * 1.33 Demand] ). Fun. However, what if you had made 20 batches of silver coins as a reserve? Those coins would recouperate only ☼2 580 to trade, or 129/stack. (Silver Value 10 * Coin Stack Value 10 * Demand 1.33 * Deflation 0.97 * 20). It's hard to justify coins as a trade good without a different trading system altogether. Even with the massive plummet in goblet prices and the lesser demand multiplier, it's just not worth it since they have no quality multiplier.
Firstly, in line with both rampant inflation, counterfeiting, and illegal printing, there should be incentives and demands on the amount of currency that your fortress mints. Perhaps the liason or mayor/duke/king could even issue a minimum or maximum minting quota, as the situation demands, as you are just a fortress of a civilization and not an independent city-state (assuming friendly relations, of course).
Secondly, what if you exceed the minting quota or melt down to many coins which you imported? Should your civ declare war upon your fortress, rather than minting coins with the civ's name and imagery, do you mint coins with your fortresses' name and imagery with their own demand and supply?
Third, what are the demands of the treasurer? Should the mayor/duke/king demand a tresurer, and then the treasurer demand X amount of coins be minted?