Forums » Suggestions

Thoughts on dynamic economies.

Dec 04, 2003 Phaserlight link
*bump*
Nov 01, 2003 Celebrim link
Some of you know that I’ve never been found of the idea of dynamic economies. I find them too difficult to balance, and prone to odd quirks. However, the devs – being far braver than me – appear determined to take on the challenge.

Needless to say, the first economy doesn't seem really that interesting, though granted it wasn’t supposed to be. I have no idea what the underlying algorithm the devs are using is. This is my overly wordy essay on dynamic economies in order to offer what little inspiration I might have toward modeling a dynamic economy in a way that won’t get broken too often.

One of the problems with modeling dynamic economies in a game, is that unlike real sellers, most game ‘merchants’ have too little information about what something is actually worth. There are a couple of ways to handle that. For example, you could assume there is a ‘galactic commodity market’ where all NPC’s have access to how much something has been bought and sold everywhere in the galaxy and adjust their prices accordingly. That model works, but in order to keep this under 50,000 words, I’m not going to fully describe that model or how to overcome its limitations. Lets just say that that model is I think further removed from the model we have now than what I am going to describe, and isn’t I think quite as interesting as the ‘local demand’ model. Provided you do some price caps and floors, and add some interaction between the economy and the mission structure, I don’t think it will be that much harder to balance and it will encourage people to visit the whole universe and not just a few ‘prime spots’ while leaving most sectors ignored. Spreading people out is I think good for the dialup players, who just won’t have the bandwidth to handle big clumps of people in just a few sectors.

Let me define a few terms so I can use abbreviations:

Load (L): The number of widgets that a merchant expects to be delivered. This is a derived play tested value tweaked to get a stable economy.
Interval (I): The amount of time on average it is assumed that players spend between selling a Load of goods. This is another value derived from play testing and tweaked to get the best results.
Population (Pop): This is a play tested value which is on average 1 which is tweaked according to how regularly you expect or want this merchant to be visited. In can be thought of as representing how many NPC consumers exist in the sector.
Players (Traders): This is the number of players logged on at the moment. This is probably the most important number in the calculations. The whole economy should scale to however many people are playing.
Stores (Stores): This is the number of merchants in the galaxy. Right now, at one merchant per sector, this is the number of sectors.
Buy Value (Buy): This is the price that an average merchant would sale the commodity at if supply for the product was ‘average’ in that sector.
Sell Value (Sell): This is a price fractionally above Buy which is the price that an average merchant would buy the commodity at if the demand for the product was ‘average’ in that sector. A good Sell would be flat 1.04% of Buy across the board.
Local(Local): This is a flag that can be placed on a commodity for each merchant that indicates that the commodity is produced locally, and thus the merchant’s Sell value is only a fraction of normal. This prevents you from buying something somewhere and selling it in the same place. For example, Local flagged items might have ˝ normal Sell.
A more complex local flag would be a floating number indicating the relative price of the time locally, and where 0 indicated ‘not local’.
Commodities (#): This is the number of commodities in the universe. My instincts say this should be fairly small relative to Stores, although the current number of Stores (1 per sector and only 18 sectors) is low enough that it doesn’t present a problem. The problem you run into if # is as large or larger than Stores when Stores is large, is that I think the economy will spike unevenly very often in an unrealistic fashion. In the real world, if say there is only one producer of a high demand commodity, then there is strong market pressure to add producers to the economy. But this is the sort of complex dynamism seen in the real economy that will be difficult to model in game. It's bad enough having dynamic prices without having producers being created and destroyed as need demands.
Equally importantly, keeping # small prevents database bloat and keeps the server running smoothly.
One way to increase the number of widgets while keeping # small would be have different names and pictures for widgets, but have each have an underlying commodity type so that several different widgets (iron ingots, steel I-beams, and scrap metal for instance) all have the same underlying commodity number. You could do that for low and high grade xithricite, for instance.
Demand (D): This is a value which is dynamically adjusted according to how often a commodity is sold to a merchant.
Supply(S): This is a value which is dynamically adjusted according to how often a commodity is bought from a merchant.
Increment (Inc): This is a value which determines how rapidly the dynamic economy responds to changes in what is being bought and sold.
Cap (Cap): This is the maximum Demand. The better your system works, the higher you can raise cap, but it should not be more than 2 IMO, and really 1.3 is pretty good as an initial value.
Floor (Floor): This is the minimum Supply. The better your system works, the lower you can sink floor, but it should not be less than .5 and really .75 is pretty good as an initial value.

The basic algorithm is this:

Calculate a value called Expected Wait (Wait) as follows: (I*Stores*#)/ (Traders).

Whenever a player docks or logs into a station, check the table of commodities which are not Local. For each commodity that is not Local, if the time between now and when a Load*Pop of that commodity was last sold here exceeds Wait, increase Demand by Inc (to a maximum of Cap) for each Wait which has transpired and set last time to now – (transpired time mod Wait), otherwise do nothing. For each commodity that is Local, if the time between now and when a Load*Pop of that commodity was last Sold, decrease Supply by Inc (to a minimum of Floor) for each Wait which has transpired and set last time to now – (transpired time mod Wait), otherwise do nothing.

When the merchant as purchased a Load*Pop of stuff, set the time the merchant last purchased a load of that commodity to now, and decrease Demand for that commodity by Inc.

When the merchant has sold a Load*Pop of stuff, set the time the merchant last sold a load of that commodity to now, and increase Supply for that commodity by Inc.

The base purchase price of an item is Buy*Supply and would probably further be modified by such things players reputation with that merchant's faction and the player's effective negotiation skill.

The base selling price of an item is Sell*Demand and would probably be modified as above.

You really only have to for each store maintain a list of which commodities are local (and thus for sale), and for each commodity maintain current Supply or Demand (a low precision floating point number), the number of commodities sold mod Pop*Load (a small integer), and a time. Once you allow mining or other resource production, you’ll probably want to maintain both Supply and Demand for all local commodities, but that’s not really essential.

One problem that this runs into is that players will tend to overlook opportunities to send certain commodities to certain locations, resulting in Demand being unmet for long periods. A really cool solution to this ties in with the first steps in a mission structure. Whenever a player docks with a station and the server generates a mission list for the player, one really cool thing to check would be the list of all Demands higher than a certain number. For each such demand, have a chance that a ‘contract mission’ is created where the merchant offers some lucrative rate per widget for X widgets provided the player agrees to deliver them in Y time. If the player agrees to the mission, and fulfills it, he is locked into a profitable rate no matter what happens to normal Demand. On the other hand, if he defaults and doesn’t bring enough widgets in time he pays a small penalty fee on each undelivered widget. The shorter Y is, the better the rate the merchant is willing to pay.

Of course, there really is no limit to the number of things that can make trading cooler. One hi priority for me would be an ‘ownership flag’ for each widget so you can support ideas like ‘Shipping Missions’ (moving cargo that doesn’t belong to you) and dishonorable merchants where you can sell stolen goods. The second thing I’d like to see implemented is a legality table for each sector, to support the idea of contraband and smuggling.

Ok, I got it out of my system. Criticisms? Thoughts? Input from the devs?
Nov 03, 2003 incarnate link
I'm not going to reply very in-depth, I don't have the time to make that kind of post right now. Anyway, a lot of what you've said is similar to what we're implementing. To cut it down to there bare essentials, we have a concept of "demand" that can increase from a number of factors, primarily as a rate over time. Demand is the basis for the prices of trade items, monetary compensation for missions, and various other things. Missions and the economy are intended to be tied together very closely, with those stations with high demand for a given item being able to create a mission to supply said item (much as you suggest). The concept of NPC traders that maintain a certain standard level of active supply is also important (thus, said convoys could be preyed upon by pirates, potentially causing an increase in price of the traded item at the destination, etc). NPCs would also be able to take trading missions. Anyway, the economy that we're implementing is actually pretty simple. About as simple as we could get and still have it actually be dynamic.. but it's intended to be tied into the mission and faction systems pretty deeply. So, as with other areas of gameplay, implementing one part without the other may end up pretty half-assed and broken, but we'll just have to do our best as we go along. I think the economy will require considerable tweaking, regardless, but I think it'll be a better choice for the long run. I wanted to create a universe that was impacted by the actions of the users in some measurable sense, and the economy is part of that. The key, of course, is making sure things don't get too out of hand, and that some self-stabilizing factors are available. We'll see how it goes.

I like some of your ideas, like the concept of being able to determine whether a cargo item was illegally acquired. That could add some interesting gameplay possibilities. Keep the ideas coming, they're always welcome. I don't always reply, but I do pay attention to the suggestions you guys make. I'll post more details on our economy, mission and faction system design at some later point.
Nov 03, 2003 Magus link
I have a feeling tying the economy significanly into the faction fighting and missions will create "The Rise of the Marauder." Think about it, the ship is not only a good trading vessel, but if you think of it in this respect it becomes a craft designed to excersize influence over the economy. It's excellent for trading, can hold its own in a fight, and is an ideal pirating craft. The marauder may need to be toned down like the valk is now. The fact that the marauder's advantages make it only useful in a very large, very well organized plan, however, may naturally balance it out. In contrast to the Valkyrie, which actually encourages misanthropic tendencies. But that's a topic for another post. . .
Nov 04, 2003 incarnate link
Err. That's not really the kind of faction/mission/economy linkage that I meant. I'm referring more to triggers. A mission is completed, which causes a standing change between two factions, which brings about economic sanctions, which causes a cessation of trade, which causes an increase in demand, which causes an increase in "smuggler" missions, etc etc. Interwoven impact on the universe based on triggered events or general changes. Obviously not the sort of thing one wants to go haywire with a large userbase pushing the limits of what's possible. But something that is feasable if implemented in a very careful manner. The full explanation of which would require some considerable discourse.

I'm not terribly concerned about weapon or ship balance, at this time. All that will change, things are only balanced (or unbalanced) currently to the game as it stands right now. And the game as it stands right now still differs pretty greatly from the game we're trying to create.
Nov 04, 2003 Durgia link
I created a new char to test how the economy is now. In 20mins I had enough money from botting to do cargo runs safetly imo. So I took a load(6) from 4 to 14 and made 40k...so in 30mins I had enough for a valk. In one hour I had enough for a great many valks. So whatever you guys change I hope it will take people more time to get the so called uber ship, or in a few days money will be right back where it is now.
Nov 04, 2003 Celebrim link
Durgia: Right now the economy inflates out of control. There are two reasons for this. First, the price caps are not conservative enough IMO. IMO profit should cap out at no more than 400% in the situation in which the purchase price of something is about half normal because no one is buying it, and the sell price is about double normal because no one is selling it. That is hopefully easy to fix though.

The other problem is the economy appears to have made bad assumptions about how often people are going to trade. I can't say what the games algorithm is, but it probably has some number equivalent to 'Interval' above, and basically right now that expected interval is set far shorter than it should be - resulting in all the merchants 'thinking' that they are not being traded with often enough. In all fairness, this isn't anyone's fault. Even if the devs had a good guess to begin with, right now the economy is in a very unrealistic state in which almost noone needs to trade because everyone has so much money. That's one of the reasons we desparately need a reset so that the devs can start collecting data about how often people will trade in more normal circumstances.

And beyond that, incarnate is absolutely right (as usual) in that any functional dynamic economy is intrinsicly tied to a mission structure and other aspects of the game in a way that makes it really hard to separate them out.

Nov 04, 2003 Forum Moderator link
Durgia/Celebrim: As was posted elsewhere, the dynamic economy really wasn't intended to be presentable yet. Suggestions are helpful, but lengthy testing in its current state is probably not worth your time.

2003-11-01 09:49:19 incarnate
Heh, the dynamic economy may be a bit.. broken, at present. We didn't even really mean to release it, it was a side effect of doing some server-side updates (sometimes it's hard to do a partial-release that reflects some of the development changes, but not others). Anyway, it's probably for the best, now we can tweak it a bit and have it more workable by the time it really begins to matter and we reset everyone's characters.
Nov 04, 2003 incarnate link
Yes, the current numbers are pretty.. arbitrary, and the price increase rate is quite large to permit easy testing on our internal development server. Plus, a number of the factors that are supposed to decrease the prices.. are not doing so, due to bugs and other issues. That should all be worked out soon, and we'll be able to get a better idea of whether the economy works or not. Right now, things are broken for a wide variety of reasons unrelated to the actual economy design.
Nov 05, 2003 Phaserlight link
Don't forget the NPC traders that are eventually supposed to be part of this dynamic economy. That oughta make up for the current short 'Interval', Celebrim.