ID:154304
 
Well, for my current project I decided to implememt a somewhat demand driven economy. Basically, it works like this: Every item has a primary material, amount of that material, and degree of complexity. Prices are determined by factoring demand for the item's material * amount of material * complexity. For example a sword might have 50 units of iron and be complexity 3. Assuming demand of 1.0 for iron, its base value would be 150. A silver coin might have 1 unit of silver(demand 5) and complexity 1, so it would be worth 5, mainly from material. Thus 30 silver coins could be traded for 1 sword.

I have encountered two problems.

1) How do I track demand for materials? My original idea was to have any BUY transactions increase demand and any SELL decrease it. But I want the change to be proportional to the number of players in the world so 1 player selling a bunch of goods would have less effect on the economy if there are say 200 players as oppossed to 5. I suppose I could track the total supply of a given material and adjust demand proportionally to the amount of material in the transaction, but this will probably not the best approach....

2) How do I ensure some items don't become unrealistically undervalued. My thought here is gems. Gems have no inherent usefulness and would probably be sold more often than purchased, thus driving down demand. Since the primary value of such goods is as a store of wealth (easier to store1 diamond than 5000 coins, for example), this devaluation would undermine their primary use. I considered having a baseline demand for every material that the demand gradually seeks to return to over time (thus restoring equilibrium from gluts and shortages).

I need a fairly robust and dynamic model because I wish craft skills and resource management to play a driving role in the game.

-James
Jmurph wrote:
1) How do I track demand for materials? My original idea was to have any BUY transactions increase demand and any SELL decrease it. But I want the change to be proportional to the number of players in the world so 1 player selling a bunch of goods would have less effect on the economy if there are say 200 players as oppossed to 5. I suppose I could track the total supply of a given material and adjust demand proportionally to the amount of material in the transaction, but this will probably not the best approach....

There are other standards you could use besides player population--in fact this could have an adverse effect if an infrequently-visited shopkeeper is responding to the size of a global economy rather than local. Time between transactions is one possibility.

However, I'm not so sure you should have demand based on the number of players. 1 player selling a bunch of goods should have about as much impact as a bunch of players selling 1 thing each. The important question is how many of the item are sold or bought in any given time period. The time periods should be on the order of a day, a week, and a month, going by the game's perception of time.

It would probably help to have staple items that are bought and sold regularly by NPCs to stabilize prices, too.

2) How do I ensure some items don't become unrealistically undervalued. My thought here is gems. Gems have no inherent usefulness and would probably be sold more often than purchased, thus driving down demand. Since the primary value of such goods is as a store of wealth (easier to store1 diamond than 5000 coins, for example), this devaluation would undermine their primary use. I considered having a baseline demand for every material that the demand gradually seeks to return to over time (thus restoring equilibrium from gluts and shortages).

Gems are only worth something because somebody buys them: Jewelers buy them for their work, which might include things from making simple necklaces to adorning fighting gear. And guilds would have a vast interest in gems, I think sometimes simple gems themselves but also in items created by the aforementioned jewelers.

To handle these things properly, what you need is some kind of background purchasing done consistently by guilds, the government, the army, the church, etc. Food has to come from somewhere too; the peasantry could bring it to market for sale. In all things you should consider that your players are likely just a few people out of hundreds or thousands who live in the area; where they would impact the economy would be in their consumption of supplies, and what they choose to buy or choose to sell--and how useful the item they choose to sell really is to someone else.

Lummox JR
I think you were are on track with the total supply idea. It's simple and it works.

You can store global values for each material. Then you can compare how relatively rare the buyer's material is to the seller's material and charge accordingly. In theory, this would take care of initial values anyway.

You can also let how much of the personal material the buyer or seller has be an influence in transactions. This could be used to give the local rates.

All of the comparisons can be done in procs. Don't bother storing any magic supply and demand values. It's a lot of work that might not give the desired result. (So says the guy that spent time making a weighted random word generator just to find out he liked pure random results better. *sigh*)
I think that you need to not have selling devalue the item in question. In real life selling is just the opposite end of buying, for every sale there is a buy.

In a computer game this tends to be a little different, because players often sell stuff that they have no need for. Generally in games these items simply dissapear from the economy.

However, in the situation where one player sells to another, then you will have one character adding to the value by buying, while the seller causes the value to decrease, a net change of zero. However, in this situation, buying and selling between players indicates a highly valued item.

I would instead suggest that you keep track of the number of transactions that an item type is subjected to. This might be simpler, and also be a better indication of the robustness and longitivity of a particular item.
In response to ThreeFingerPete
This is a good point. I guess I assumed I was talking about player to world vs. player to player transactions. Usually, players only sell goods to nonplayer vendors to get rid of the item. Thus, unless someone subsequently buys it, I think that probably would indicate a lack of demand. Now let's further say that people are selling off all the dirty clothes they find on monsters but buying alot of anvils, swords, and frying pans (metal goods). I would think the demand for cloth would plummet (good time to buy some new clothes) and the cost of metal goods would skyrocket (best hold off on that new plated mail). Whereas with players, as you mentioned, the transaction is much more subjective.

Okay, that doesn't clarify much. Maybe I should say demand primarilly tracks non-player economics based on player activity. And the gradual change to original values represents inter-NPC commerce. Make sense?

I hoped such a system would reward more believable playing and create a more immersive game. But, as was pointed out it would also make the assumption tht all NPCs have perfect information on the economy (which would be highly unbelievable). So maybe I could factor in personal demand factor as well.

Who knows:-) I think I just confused myself!

-James(it's been a long week)
In response to Jmurph
Its been a long week for me too!

It also seems to me that players will tend to assess risk/value in deciding which items to collect and sell. Like mechants everywhere, they will attempt to aquire and sell items which give the greatest return on investment. As the value of some items drops, players will cease to make use of it, which will basically cause that item to vanish from your game in terms of relevance.

It might be necessary to artificially pump up the value of stock that has been depleted. I've got some crazy ideas on how to do this, but I dont want to post them here, obviously. Find my email address in 'people' on the left if you want to hear them.