I've been working on a game the past few months and I'm finally starting to approach issues regarding the in-game economy. The game is sort of like an MMORTS, players create their own nations and they have cities all over the world map. I want players to be able to trade resources between their cities and other players' cities. For the sake of this example, let's say the cities are trading oil. One city might be right next to a few oil deposits, so they're going to sell to other cities that don't have any oil deposits next to them.

Instead of the game having a fixed price for oil, I want the price of one unit of oil in the game to reflect the current supply and demand of it in game. How can I go about doing this within the virtual economy of my game?

My first thought was to take the average price payed for oil between trades among players; however, how do I protect from friends working together to continuously trade oil at higher prices between each other to artificially inflate the prices for their gain?

Note: I have little to no knowledge on how an economy works in-depth, so I hope this question isn't too silly.

  • The best game ever written to demonstrate economic principles is M.U.L.E. Every price in the game fluctuates entirely based on player actions (production, selling, purchasing, consuming). It's worth looking at if you want to do a little research. – Ask About Monica Jul 13 '15 at 17:49
  • Does your price for goods use a common currency or do you barter by trading goods for goods? It matters quite a bit as to the model you would end up with. – Dunk Jul 13 '15 at 18:35
  • Not that gbjbaanb's answer isn't good, but it is generally a good idea to wait a few days before accepting an answer in order to encourage more answers. Once an answer has been accepted then people tend to not add their own answer unless they feel particularly strongly about their own opinion. – Dunk Jul 13 '15 at 18:40
  • 1
    I'm voting to close this question as off-topic because the question is asking for a from scratch design of a virtual economy. Such questions are not about the design or architecture of software (as described in the help center) and instead need significant expertise on game design and economics. – user40980 Jul 15 '15 at 0:09
  • In general, I would suggest that you look for information on the faucet / drain economy (one of many models) and possibly pursue the economy tag at gamedev.se. – user40980 Jul 15 '15 at 0:10

Whilst setting prices based on trade values works (the stock market works this way for example) it is (or should be) self-regulating by having a very large number of traders involved in the setting of the price. So a few players cannot rig the market because they would be a small factor in trading. However, this still cannot prevent abuses caused by very large players trading or by a lot of traders all deciding to trade (eg someone with a lot of money makes a trade, that will affect the price disproportionately, similarly see tulip bubbles for examples of how prices were set irrationally by many traders)

So for a game, you need to put brakes on these, just to ensure stability in the game that would not come from the usual routes in real life.

Perhaps the easiest way is to introduce a large number of NPC players who trade on a moving (ie historical) average. Then PCs cannot manipulate the market as their trades are simply lost in the mass of other trades. Unfortunately this would also prevent the kind of price fluctuation you want. You'll have to tweak the number of NPCs to find the right balance.

The other aspect is supply and demand, you can have prices set according to the quantity of some resource. If a banana costs me $1 today, and tomorrow someone finds a new supply of bananas doubling the number present in the universe, the price of a banana will (theoretically) drop overnight to 50c. You can use the same mechanism (which won't be as extreme) to regulate prices. (obviously the opposite holds true too). If you also introduce a localisation effect, where supply is greater or lesser in various areas, you create trading routes - ie my island that makes bananas has lots of them, so price is low, whereas the city that has none, the price is high. As more of the bananas are moved from island to city, the price rises in one and drops in the other, finding a balance.

So set an arbitrary price for each resource, allow NPC movement of goods from low-price areas to high-price areas, introduce consumptions and production of these resources and let the game stabilise itself. Then the players, and random effects (eg natural disasters, increase and decrease in production, NPC attacks on trade routes, etc) will de-stabilise the prices all by themselves.

Its important to handle quantity here, rare items will hold their value regardless of where they are and won't be affected by economies unless you want to get advanced and set prices through the supply of money - that introduces inflation which will destabilise things further and require an equal continual influx of currency to keep the economy moving. This isn't such a bad thing as it means nobody can sit on their wealth and expect it to retain its value, so they have to keep working.

  • Very, very awesome reply! I'll be looking for ways to implement a few of these safeguards into my game. Also, what do you think about preventing prices from getting too destabilized by limit how far prices can deviate from their previous prices? e.g.: economy prices update every 4 hours, and with each update, the price can only deviate a maximum of 5% of the previous price. – X33 Jul 13 '15 at 8:40
  • In a way the price should fluctuate in individual shops (or small, localised areas) This can be updated as goods are bought or sold - eg a shop with a glut of bananas may sell them at a discount, though it might be easier to set the price for the town with all those bananas in it. No reason to limit prices though so they move slowly, might be easier to simply cap the calculation as goods are traded each time, and impose different caps according to the goods shelf-life. – gbjbaanb Jul 14 '15 at 7:33

One of the biggest challenges is making the trade worth while for players.

Consider monopoly for example. players randomly aquire streets and are supposed to trade them amonst themselves. the streets aquire value because there is a bonus if you can get a whole set. However! In fact the winning strategy is never to trade. As there is a finite number set of streets and only one winner there is no incentive to trade when you are in a winning position.

Another good example is settlers of catan. Here the trading is more advantagous. But still aquiring a monopoly and not selling at any price is a viable strategy.

Trade can also be made worthless in the other direction. Sins of a solar empire lets players sell thier resources to a market. however as you can always buy or sell and the price fluctuation is limited essentialy resources and money are interchangable.

To hit the sweet spot of trade being important but not so much that it stops taking place is a real balancing act. In my view there are a number of key factors you need though.

1: win/win deals. This is where resource X is worth more to me than it is to you and resource Y is worth more to you than it is to me.

2: indirect competition. My gain shouldnt nessecarly be your loss

3: secrecy. you shouldnt know the exact value of your resources to me. If you know I need 3 sheep to win, tjat trade isnt going to happen

Not the answer you're looking for? Browse other questions tagged or ask your own question.