Friday, March 25, 2011

Trade

1)
Last post was about the possible implementations of a "siege mechanic" in a MMORPG. The preliminary conclusion was that a MMORPG, that doesn't aim at the pure hardcore market, cannot make it's players meet and fight it out.

Players that log in every second day between 5pm and 8pm cannot be forced to log in at 3pm at a specific day, just because the enemy lives in a different time zone. They might be at work or, during Saturday, they might want to have a walk with their family. It is certainly not easy to accept: But every good "siege mechanic" for a mainstream game needs to work with factions that potentially never meet in grand scale; while still allowing them to meet and fight it out.

Instead of a NPC-heavy implementation, I suggested to use the economy to create such a non-synchronous gameplay in way that is compatible with the simulation aspect. And by doing so, I needed to assume some characteristics about the economy. Among other things, I needed to assume that something like trade routes exist and that these can be blocked.

So, let's assume that we have a working buy/sell order system. Let's also assume that goods can be stored and sold safely at player-owned shops by player-employed merchants. Considering this environment and keeping in mind that there are no teleports of anything, but information, what should trade look like ?

2)
For trade to happen it must, on average, be beneficial for the trader. This may be obvious, but it is overlooked by many developers who tend to look at trade as an aspect of the bandit gameplay. And while I consider bandit gameplay to be a valuable addition to any game, I must point out that it is the wrong way to look at it.

There cannot be any bandits if there are no players willing to trade. And since the majority of players rather plays bandit compared to the more boring trader, anyway, a developer needs to assume a trader's point of view first, and a bandit's point of view second.

3)
Luckily, this whole topic can be put in quite simple mathematics which are very helpful for the designer.
Let p1 be the price at location 1, p2 the price at location 2, c the amount traded, M the profit the trader demands for the whole thing being worth his time. What is the highest probability of being robbed q, that doesn't put the trader out of business?

(1-q)∙(p2-p1)∙c-q∙p1∙c>M => q<1-p1/p2-M/(c∙p2)

To make things more simple, assume either M=0 or c=∞. It follows

q<1-p1/p2

So, if the price is p1=20 gold at location 1 and p2=21 gold at location 2, it follows that q<5%. This is the absolute maximum probability for a successful bandit attack any trader can bear without going broke! Also, if the probability is higher, the prices will turn out to differ more

=>p2>p1/(1-q)

So if q=20%, it turns out that p2>25 gold!

4)
Realistically, traders don't want to break even, but make a profit M. Otherwise, the trade were pretty pointless. If M is not 0, like above, the amount traded c, becomes important. This c is a rather interesting thing to look at, because if it is very large, the term becomes less important. However, the risk for the trader also becomes higher.

That is, because a real trader only has a limited amount of money. To lose it all due to a very high c, is a real problem! It becomes much easier if he has access to insurance. But, unfortunately, insurance is a real problem in a MMORPG. I haven't found a way to introduce it in a way that works well, yet.

The above term M/(c∙p2) can be guessed, though. The denominator is the revenue and, thus, the term is the fraction of the revenue the trader aspires to make on average with each run. It is also called the operating margin per trade run. If we assume that this is about 2%, we can, finally, conclude that

=>1-p1/p2-2%

Thus, we have to subtract 2% from each q. The above example turns from q<5% to q<3% and the calculation of p2 turns to

=>p2>p1/(1-q-2%) = p1/(98%-q)

So, if q=20%, it turns out that p2>25,64 gold!


5)
I am pretty sure I lost almost every one by now. And it is probably not very important to remember these calculations. What is important is that a developer can set a price deviation to determine the required probability of successful robbery.
So, if you consider a well oiled-economy to have no higher price fluctuations than some percentage, you can now calculate the required probability of successful robbery.

The other way round, you can determine the price fluctionations that will come to be, due to a certain probability of being robbed.

One last thing. If you are tempted to argue that players do not do these calculations, you are probably right. However, they will behave according to them, because whether trading feels 'pointless' or 'great' is determined by them.

11 comments:

  1. erm .. to play bandit..

    brigand, criminal, crook, desperado,
    forager, gangster, gunperson, highwayperson, hijacker, holdup person, hooligan, marauder, mobster, outlaw, pillager, pirate, plunderer, racketeer, raider, ravager, robber, villain

    :) to rob innocent merchants.

    ReplyDelete
  2. Something to keep in mind: Is the profit caused by Buy being low and Sell being high or Buy being high and Sell being really high? In isolation these are obviously the same, but if the Buy price is high (relative to the economy), that is going to increase the required initial investment, and make banditry more profitable and therefore more common.

    In other words, if I buy for $1 and sell for $500, I'm willing to lose a lot of stuff because each one has an investment cost of only $1. In contrast, if I buy for $10 and sell for $5000, then the investment cost, and therefore loss from a robbery is higher, possibly encouraging me to go to the less expensive $1 route.

    Of course we could argue that the bandit could just carry the $1 over to the $500, but if he's going to do all that hauling, why not just be a hauler? In this scenario, the 'savings' the bandits gets is a mere $1, hardly worth the risk, whereas in the $501 scenario, the bandit can take a much higher profit regardless of hauling to the ideal sell point.

    ReplyDelete
  3. Klepsacovic, it is not really the price that determines the incentive to rob you, but the price times quantity.

    A a cart full of 1000 goods that each cost 1 gold is a higher investment for the trader and a higher incentive for the bandits to rob, than a cart with 5 goods that cost 100 gold each.

    Also, whether the bandits do the robbery near the town where the trader bought the stuff or near the town where he is going to sell it, determines what they consider valuable.

    The equations are not sufficent to describe the whole situation, though. Bandits will generally have a higher q to rob an expensive cart, and merchants don't know q, but have to guess.

    q also varies with time of day and day of week. Quite a lot of other things can be thought of, like the speed of the cart, which increases profit per hour, but doesn't increase profit per trade run, which I looked at in this post.

    ReplyDelete
  4. Price x capacity, of course, but I'd guess these carts are in some way limited, either by volmue, weight, or some mix, meaning that there are items of a higher price/capacity, so a cart of that will be worth more.

    ReplyDelete
  5. The carts are limited in these ways, but that does not mean that these limits always apply. If you transport diamonds you'd probably decide against using a cart, in the first place. And if you use one it certainly won't be full.

    With low-quality swords it would be the other way round. Guessing what is inside a cart can be a character skill.

    ReplyDelete
  6. This is assuming that when a player gets robbed they loose everything on them. To solve your problem in number 4 how about have money/loot/etc distributed among different storage bags? Maybe they invest in locks on certain bags? If there are locks involved then the bandit would have to be able to pick the lock in order to get anything, and if there are multiple bags then it might not make sense for the bandit to even attempt going through the hassle (especially if they don't know what they are getting, if anything).

    Also there is another factor you could add in, the trader could have an escort to protect him from bandits.

    The escort could get a % of the profit if the deal goes through (which would make the escort want to insure that the deal goes through to the best of his or her ability).

    ReplyDelete
  7. I think all these profit calculations might wait until you can come up with a good model of how trade routes would actually work :). Noone is going to invest their cash in a trade caravan along some well known trading route when they know that everyone else on the server will be waiting just outside the city gates to jump on the loot.

    If you want a game where factional conflict leads to territory gains on either side, the problem as you say is that in RL defenders don't log off. Also, I think you need the principle that a faction can only gain advantage in conflicts where both sides have roughly equal power - otherwise zerg mechanics will rule.

    Perhaps there is a primitive model of how conflicts might occur in Guild wars factions alliance battles, where territorial boundaries shift according to relatively equal (roughly equal numbers) battles. If one could take this idea and somehow get it to work in open world then that would be start. Warhammer Online made some attempt to do this in city battles where they used a sort of average over multiple instances method to determine conflict results.

    ReplyDelete
  8. Roq wrote:
    I think all these profit calculations might wait until you can come up with a good model of how trade routes would actually work :

    I think it is the other way round. I first need to explore what demands a trade system needs to meet before I write down the mechanic in detail.

    In this case we can see that the system must allow traders to be protected up to (an order of magnitude of) ~5% of the time. Quite a demand to design a mechnic that allows such a thing without overshooting and making trade 100% safe.

    Also, I am not sure I'd post details on the blog ;)

    ReplyDelete
  9. The absolute profit isn't as important as the profit per hour. Let's say you have a route that takes H hours to complete. The trader's profit per hour is M/H. Let's say I'm a bandit in a group of B bandits. What is my profit per hour? It is dependent on the number of passing traders that he can attack and defeat with impunity. Let's say the number of such traders is T. Then the bandit gang's hourly profit is T*(p1*c)/H, and each bandit's hourly profit is T*(p1*c)/(H*B)

    As long as T*(p1*c)>M (and remember M at max is (p1-p2)*c), then banditry is more profitable than trading. Otherwise trading is more profitable than banditry.

    Where will banditry take place? At the weakest leg of the trade route: the leg where the government police force is at its weakest (for instance at borders). So the trick for bandits is to identify this place and hang around there.

    Now the trouble with banditry is that you are shitting in the place you are eating, so to speak. In other words, by attacking traders, you ensure that the number of traders per hour will drop as soon as word gets out. Depending on the policing mechanism, you should also expect an increase in the number of police around, which in turn further reduces the number of traders that it is safe for you to attack (to zero, usually). So bandits have to live a nomadic existence. But at least it's fun. They get to gank traders for a living. Plenty of players will do this even if the profit is zero!

    What does the trader get out of it? He can have a boring time and make a profit, or he can have an exciting/terrifying time and lose everything (remember, the bandits get to pick and choose the fights, and only fight when they think they can win). This is not a good model for the PC trader, so a mechanic has to be introduced to make trading exciting when no bandit attacks happen.

    When you think back to your D&D days, imagine you were part of a caravan of traders that were transporting a precious cargo from one city to another, across an unknown expanse. Your DM played out with you your preparations and your setting out, and maybe an encounter along the road. However, then he moved on to "as evening falls, you see an oasis in the distance" or something like that. In other words, in a tabletop game, the boring bits of travel are skipped, while still giving you a sense of duration. This isn't possible in a real-time game.

    Moreover, your DM had some incidents and adventures planned for your caravan. You were exploring new land, seeing new tribes, meeting new people, dealing with new situations, including a bandit attack. These were bandits of the stupid variety: they only attacked a caravan that could defeat them! So the caravan had a great time, and the stupid NPC bandits got their come-uppance.

    In an MMORPG, this fun can only be had once (for instance, the introduction to Uldum, or the beer-delivery daily for the Dwarves). The next time down that route, you're more like the lorrydriver driving from Ostend to Ankara. You've done the exploration, you've met the new characters, yawn, another stupid NPC bandit attack, when will they ever learn? Real PC attacks will be no fun for the trader, because smart bandit players only initiate battles when they know they will win.

    So, in summary, traders who actually haul goods from market to market will get bored and ganked.

    ReplyDelete
  10. Thanks for the thoughtful comment, Dàchéng.



    (remember, the bandits get to pick and choose the fights, and only fight when they think they can win


    This is not necessarily true. All it needs is a mechanism that prevents the bandits from having access to all information. An example would be guards whose strength cannot be known.

    ---
    This is not a good model for the PC trader, so a mechanic has to be introduced to make trading exciting when no bandit attacks happen.

    I strongly disagree. This would be a recipe for disaster. If I want action I go for some action and not for trade. Trade can never beat an activity like combat when it comes to action. What can be done, however, is to confront the trader with interesting decision during his trade run. But that also depends on the kind of trade he his doing.

    ---

    So, in summary, traders who actually haul goods from market to market will get bored and ganked.


    I will have a post soon with more details on how to make trade worth doing. But you are right in that it requires some work.

    ReplyDelete