Market (supply and demand)

Started by
14 comments, last by Acharis 12 years, 4 months ago
Market manipulation is fine as long as your gains come from other players. If you can make money in such a system, it means someone else lost it and it was the player's inability to properly use the system that led to his loss or your profit came from your ability to plan ahead and provide a service to the other players. You gave them resources now in exchange of money or money now in exchange of resources. Your profit is your risk for holding these resources hoping to turn around and sell them for more.

If you can manipulate a non-player controlled system due to a flaw, then those who refuse to exploit the flaw will be at a disadvantage. That one is bad for your game.
Developer for Novus Dawn : a [s]Flash[/s] Unity Isometric Tactical RPG - Forums - Facebook - DevLog
Advertisement
I did a simple test to see if I can force a price to hit rock bottom. Based on following formula.

If selling amount outnumbers buying amount price reduce by 1 gold.

A manipulating player who understands this formula can just continuously sell more then buyers, one way to achieve this is to go some remote places where other players will not take note and since there is no actual goods (30 tons of iron) I can just buy and sell any amount in this remote kingdom, I can basically force the price down by making large amounts of selling, or if there are no buyers in this kingdom just selling 1 unit will be sufficient. Assuming I have the resources to keep selling (buying from other kingdoms to make up for the amount I am selling). After a number of ticks (in your case is 8 hours), the price hits rock bottom of 1 gold (assuming that is the minimum price for any object).

This is basing on a few assumptions, like having enough resources, other players have not discovered this and attempt to buy in on the cheap which disrupts the manipulator's plan.

I tried to tweak this by using the following formula:
If selling amount outnumbers buying amount price reduce by 1 percent of current price.

This does not solve the problem at all, only makes it harder for a player to manipulate the market as he needs more ticks to make the price of an item drop to rock bottom.

That's when I drop this idea and started exploring tracking the actual goods.
Maybe like this:

* Virtual Merchant (VM) - buys goods and put goods on sale (both prices are different of course). It owns actual goods (can't put on sale whe he has not). The algorithm is trying to make a small profit (won't attempt to optimize for profit or monopolize).
* Virtual Client (VC) - is buying a certain volume of goods on regular basis. How much he is willing to buy depends on number of players in that kingdom and on the current price (will buy more if price is low). Has unlimited money.

So, the player is mostly adding goods to the economy (producer) while getting money from it (the game will take the money back via various costs not related to the trading part of the game).

The Virtual Merchant would base his decisions on the Virtual Client. Like, he will stockpile goods up to 1 week worth of current VC's buying volume. Also, he will never buy at the higher price than what at maximum VC is willing to pay. The VM would always put on sale 60% of his goods (keeping a reserve for the next cycle). VM will buy goods up to 1 days worth of VC buying volume (as long as stockpile is below 7 days). The price depends on the VM's stockpile volume compared to VC's spending volume for that price point.

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

Spotted a potential problem in the Virtual Client where the client "will buy more if price is low" this sounds to me like price fixing. What is interesting is who is controlling the VM? AI? How is VM creating his goods?

You need to be careful not to create a market that excludes the player, example, you will always have a VM selling to the VC thus a player can never sell more then what the VM is selling else will the VC buy from the player? You will always have a VC buying from a VM thus ensuring the VM's survival. Correct me if I am wrong, cause I am very interested in your VM/VC idea.


For me I am now looking at having a proper supply and demand.

Demand = Population will buy a fixed amount of item categories every tick (e.g. 2000 pop will buy 2000 tons of grain every tick) depending on the size and prosperity of the population. The population will give a higher priority to necessities over luxury goods (e.g. grain over expensive clothes). The population will generate gold every tick, basically the formula to generate the gold is based on the prosperity of the town and region it is in. Using this gold the population will try to fulfill all its demand spending money wisely to fulfill as much demand as possible.

Supply = Players transporting goods to population centers and sell it on its market or buying contracts (e.g. deliver 2000 tons of grain to ton by this date) and fulfilling it.

Still very much a work in progress for me as the demand portion is really quite complicated, but I have already spotted a few problems.
1. How is gold generated without causing inflation, exploring a few ideas nothing concrete yet.
2. If no player is willing to supply some out of way towns, the towns can literally die out (if necessities are not met, population will shrink over time). Your idea of a virtual merchant is interesting, let me crack my brains on this to see if I can find a solution to this.
VM is an algorithm (AI).
VM can not go bankrupt (he has unlimited money, althrough, will try act as if he has them limited, for example if the balance goes negative it will trigger emergency mode and the disparity between buying and selling price will be increased).
VM does not produce any goods, he buys goods from players.
VC can not die out, lack of goods won't affect him at all, he buys because he buys, not because he needs it.

You are right about the "excluding player" part to an extend. I will counter it two ways, first, the buying power if VC would be like 10% of all players (althrough I might have trouble model it that way) and second, VM will be desperately trying to stockpile goods at least a bit above VC demand and will try to optimize so at least a few units of goods are left unsold at the end of a cycle. And yes, the price will be partially fixed (based on VC min-max), but I think I would want min and max prices even without it.

The VC volume will be not equal on all goods. For example he will buy a tiny bit of grain and a lot of flour. Therefore, some players will buy grain to make flour for sale (so grain will be mostly player based good while flour will be VC based good). Generally, VC will have a low demand on all things players need (and on half products) and a high demand on things they don't need (and on finished goods).

In my case the gold inflation won't be a problem at all. It will be spent on the non economy parts of the game.

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

OK, I coded the market system. You can check it at www.europe1300.eu (click 3rd button, you will be able to access "marketplace", also you can get raw resources to put on the market from "outskirts") if you are interested in that topic.

For now I'm concentrating on making it hard to speculate (please attempt to break/explain how it could be theoretically broken), in short trying to avoid making infinite money by the player (some smaller volume short term gains by the player from price speculation is OK and even desirable).
Market works in cycles (hourly right now), each cycle the price is altered. The price is based mostly on how many goods are stockpiled by the market. There are also selling/buying limits (market try to stockpile some goods and keep a reserve so something is reserved for further cycles). The market algorithm works as a selfish selfcentred one (it tries to make a not too big/not too small stockpile of all goods and earn money from the selling price and buying price difference, it does not concern itself with players needs).

Also, if you have made some market model too drop a link and explain how it works.

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

This topic is closed to new replies.

Advertisement