Dynamic Economy: Difference between revisions
Line 17: | Line 17: | ||
All items sold by NPCs have a quality of 50, while player crafted items go from 0-300, but usually if you get a quality 30 means you made something wrong. So a player made item is generally better than an NPC one. This is made to avoid having NPCs competing with the player crafted items. | All items sold by NPCs have a quality of 50, while player crafted items go from 0-300, but usually if you get a quality 30 means you made something wrong. So a player made item is generally better than an NPC one. This is made to avoid having NPCs competing with the player crafted items. | ||
== Item Types == | |||
We have to consider there are at least two major categories of items: | |||
- the items produced by the players (like mining ore, crafting swords, mixing a potion) | |||
- the items sold by NPCs. This second group is mainly used to provide basic equipment to new players or supply of raw materials for other player crafting activities | |||
We want to apply the economy manager to both items | |||
== Boundaries == | |||
We want to have a minimum and maximum variability of the prices, to avoid completely disrupting the economy based on some silly players actions. So the Economy Manager needs to have a % variance variable configured. | |||
Let's say we have a sword which is costing 100 coins as base price. If that variable is at let's say 30%, then the economy manager can at maximum change it by +/-30% | |||
== Economy Manager == | == Economy Manager == |
Revision as of 15:37, 22 March 2011
(Go back to the main GSoC 2011 page)
Skills needed
Our server and client are all coded in C++ and the database is MySql. For this project C++ knowledge is needed with some knowledge of mysql.
How does the economy work in PS today
Today every item in game has a fixed price, stored in the database. The price never changes and it's identical between all cities and all merchants.
The merchants are NPCs (controlled by the server) and they have a fixed list of categories they sell and buy, for example: swords, helms, plants. This means you can sell them anything which is in their category, no matter of quantity. They will buy any quantity today, even millions of pieces. For selling they are restricted to those categories defined on them, but in addition they also have a list of items to sell within those categories. The items they sell are defined in the db and those rarely change, so we can consider those basically static today. They supply is infinite, so they can sell any quantity of the same item, and the price stays the same.
There are no players owned shops. Players can still sell items to other players just by trading an item for money.
Players can mine and can craft items, in that case the final price of the item is determined by the "quality" of the item. So for example a 1 kg of iron can be more or less pure, and that determines its quality. The quality is determined when the ore is extracted and depends on the mine itself plus the skill of the miner. The same happens with crafting a sword, the quality of the components are summed up and the skill of the crafter as well, to result in a final quality of the sword. The final quality determines also the price of that item. So a merchant will pay more for a quality 300 sword compared to a quality 50 sword.
All items sold by NPCs have a quality of 50, while player crafted items go from 0-300, but usually if you get a quality 30 means you made something wrong. So a player made item is generally better than an NPC one. This is made to avoid having NPCs competing with the player crafted items.
Item Types
We have to consider there are at least two major categories of items: - the items produced by the players (like mining ore, crafting swords, mixing a potion) - the items sold by NPCs. This second group is mainly used to provide basic equipment to new players or supply of raw materials for other player crafting activities
We want to apply the economy manager to both items
Boundaries
We want to have a minimum and maximum variability of the prices, to avoid completely disrupting the economy based on some silly players actions. So the Economy Manager needs to have a % variance variable configured.
Let's say we have a sword which is costing 100 coins as base price. If that variable is at let's say 30%, then the economy manager can at maximum change it by +/-30%
Economy Manager
As the team balances and rebalances the game, changes probabilities and tasks required to produce crafting items, mining items or loot items, really what is being affected is the value of the items—how much time something takes and how rare it is determines what it is worth to a player to spend the time and effort required to get the reward.
With a static pricing system, the Rules team will be faced with rebalancing the prices of all items after every change, or can forego this task at the risk of having players under utilizing game features because they just don’t think it is worth it. If we make mining take twice as long to generate 10 items, the majority of players will probably stop doing it unless the prices go up as production goes down.
What we need instead of static pricing is an actual living economy where the prices respond in near real-time to the behaviors of the players and their actual production. This way if the miners stop mining because of a Rule change, mining items will start to be on short supply and prices of mining products will rise. These rising prices will motivate people to get back into mining again.
Player Behaviors – Supply Side
For every item in the game, players are by their behaviors, defining a supply curve for every product they produce. For example:
In this chart stolen from the Net, the players will produce 10 Iron Ore’s per day if Iron Ore is $1 each, or produce 140 Iron Ore’s per day if it is $4 per day, as shown by the red bar.
The beauty of MMORPGs is that we do not have to set the supply curve explicitly for each item ourselves. This is determined naturally by player behaviors reacting to the prices set by the game. Demand curves are another story, however.
Economy Manager – Demand Side
For each item, we must define a demand curve such as the blue one shown in the graph above. Demand curves indicate in a system what ‘people’ will buy when offered items at a given price. For example in the above graph, the world will demand 40 Iron Ore’s if they are as expensive as $4 apiece, but will demand 100 Iron Ore’s if they get as cheap as $1 each.
In the PlaneShift instance, merchants are the demanders of products produced by players. The demand curve of the item is representing the hidden demand of an entire world of Yliakum residents. We design each demand curve to get the types of prices we want from the evident supply curves the players are displaying.
Each demand curve will be represented as a line. P = mQ + K. Each item stat record in the database with this feature enabled must store the downward slope of the line “m” and the offset to get the line where we want it, “K”.
Economy Manager – Finding Equilibrium
The EconomyManager is notified of every exchange made in the game. The purpose of this is to measure “Q” per period. The period will be set for 3 real-time hours but we can adjust this as necessary to get smooth behaviors. Q will be stored per period, per item and will be normalized by the average number of players online during the period, relative to 100 players.
At the end of the period, we evaluate our Demand Curve to determine the equilibrium price. (P = Stored m * Measured Q + Stored K) If the new P value is higher than the current P set for this item, we adjust the price of our items upwards by 20% of the difference. Thus, if players do not detect the change and hence do not adjust their behaviors in the next periods, the official price for this item will steadily and asymptotically march up to the equilibrium point, which is the Demand Price.
If, on the other hand, players start to notice the new higher price, they will respond by producing more of the item for our merchants. Thus Q is higher in the next period and the equilibrium price yielded by the equation is lower. This means that on the demand side our engine is seeking equilibrium and on the supply side, our players are seeking the same thing.
If our rules change, our players’ behaviors will change entirely—in effect creating a entire new supply curve for the item. This will result in a new and sensible equilibrium point for the item within hours of the rules change.