Reputation:
I'm designing a rpg/mud game with merchant NPCs and I want their prices to adjust dynamically based on supply & demand.
What I have already figured out:
The problem is: What type of formula would be the "best" for this kind of multiplier?
Disclaimers:
Upvotes: 3
Views: 2505
Reputation: 1563
I'm a game developer who has studied economics, so I can give you the economists two hands answer.
On the one hand you have economics where the formula is remarkably simple. Just look it up on google or browse chapter 1 of any econ book. You could use this formula, but since economics is about personal behavior, it ignores the complexities of human decision making and just calls it maximizing(enter whatever is being maximized here). This means that in order to use a really simple formula you must implement really complex AI unless the players are going to be the only producer/consumer. Unless you are building a simulation, this is not a good way to go.
On the other hand, you really care about fun. So no formula anywhere close real is perfectly fine. Use a linear distribution so it becomes a line function and your variables to play with are slope and Y. Use a curve function and you add an exponential to play with. Put these in a data file and play with them till it's fun. Trust me if you get fun then very few people will notice it's not right.
Start by assuming a base cost for the item. This should be no unusual supply or demand. Determine a reasonable inventory. This inventory does not need to be the amount available at one shop, but available in general. Next determine the max anyone would pay for the only one of these. Again this is just to make it fun. take available on the x axis and cost on the Y and compute the slope.
A sword is pretty widely available so lets say that at any given time you can get 10 at 5 gold. Now lets say that nobody would ever pay more than 20 if there is only 1. You have two point 10, 5 and 1, 20. when the line crosses y=0, merchants will no longer buy a sword.
Linear "curves" are pretty common in economics. most curves like the famous Laffer Curve when plotted are really almost flat.
Upvotes: 4