A review of a popular game from an algorithmic point of view
Developer Michael Shalit has published material in his blog in which he deconstructs the mechanics of the popular mobile game Clash Royale from an algorithmic point of view. Editorial «Game Marketplace» publishes a translation of the note.
This is probably the longest unscientific article I have ever written, because I specialize in scientific articles. Let me begin, perhaps, with the brief conclusions I've come to.
Clash Royale — This is a pay-to-win game? Technically, that's exactly what it is. But in the article, I derive formulas according to which a player's personal abilities can at least slightly outweigh the power of the wallet.
It turns out that a resource that limits player development and map improvement — is gold, not the number of copies of any map at all. Chests contain only 60% of the gold required for the cards they contain. So choose the cards you want to improve with great care.
Don't buy cards in the store unless you are absolutely sure you need them.
Don't forget to share cards with your clan members. It's in your own interest.
Almost half of the gold players receive is dropped from «free» Chests and crown chests that can be obtained without even winning the game.
Player chests are not completely random. Supercell has created a system that may seem fair, because good chests fall at strictly defined intervals, obeying a pseudo-random law.
We also calculate how long it takes a player who doesn't spend money on the game to get a certain level. It takes days to reach level five. But it will take years to reach the twelfth. Literally.
What is Clash Royale
You may have heard of Clash of Clans, even if you're not a gamer. After all, not every mobile game can afford a commercial in the middle of a Super Bowl broadcast with Liam Neeson:
But don't let the cartoonish design of the game mislead you. In 2015, Clash of Clans was bringing in about $1.5 million a day to Supercell, its creator. And now the company has released its new hit — Clash Royale.
The game was released worldwide just a month and a half ago, and it has already been downloaded by more than ten million users. The game's active community is constantly creating YouTube videos, streaming games, writing tutorials, filling out wikis. Isn't it every developer's dream? Part of the game's resounding success is due to the popularity of the Clash of Clans brand (Clash Royale takes place in the same world, with the same characters and the same visual design). Part of it is a huge marketing budget invested in the game. But I think the main reason is that the game is really good.
There is a certain depth to the battles in Clash Royale, but in this article I will only touch on a few strategic issues. And I'll answer them with my special power — Mathematics.
Tale of two development systems
I usually play more hardcore strategy games. But somehow it turned out that dynamic PvP battles based on attack and counterattack somehow managed to capture me. Click here — And in just three minutes you can familiarize yourself with the main «stuffing» of the game. The winner gets (and the loser loses) about 30 trophies per battle. Trophies represent the rating system of the game (similar to the star system from Hearthstone).
This is the first development system in Clash: the more you «better than», the more trophies you have (note that «better» doesn't always mean you're a better player.). Players encounter opponents who have about the same number of trophies. Generally speaking, the number of trophies — is the MMR (rating) of the player. He gains and loses trophies until he reaches a state of equilibrium, when his average number of wins and losses equals.
The trophy system gives players a certain purpose, an opportunity to brag about their merits. But don't forget that progress is reversible: if you suddenly start playing outright badly or abuse low-quality decks, constant defeats will lower your rating. But that can't happen with the second development system. The second system — is a slow, grind-filled (repetitive actions) journey to increase your card levels and gain experience and player levels.
Playing Clash Royale gives you different quality chests. They contain cards and gold. You can sacrifice multiple copies of one card to create a stronger card. The new map will be 10% better, in addition, the player will get some experience for each improved map. A player's ranking is determined by his number of trophies, and his true strength progression is determined by his level. Each player level strengthens the towers on your side of the field by 7-8% in addition to the stronger cards. So getting more chests makes you objectively stronger.
Note: maps get better a little faster than towers, so at higher levels destroying towers is a little easier. As a result, the defending player gets less of an advantage and has to fight enemy soldiers more with his soldiers than with towers. A rather curious design solution.
It is this process of gaining and improving cards that is the main mechanism for incremental progress through the game.
Simple deck. Pay attention to the levels of cards, the number of cards needed to improve them next, the rarity of the cards (from low to high: blue — orange — purple), the level of the player in the upper left corner, as well as the cute drawings on the cards
It's no surprise that chests and gold can be bought with real money. Which, naturally, causes a negative reaction in some players. It doesn't seem fair that your opponent has objectively stronger cards and towers just because he's putting money into the game. Isn't that right? So, first important question:
Clash Royale — is a pay-to-win game?
In a nutshell: yes. Your cards and towers get stronger depending on how much money you put into the game. But if you get the hang of it, the answer depends on what you consider to be a victory.
Let's say I want to find out how good I am at the game, what my skills and understanding of its mechanics are. As of this writing, I haven't spent a dime on Clash Royale yet. I play around 2–3 weeks almost every day. I'm currently at level 6 (which doesn't mean I'm good at anything), I have about 1500 trophies (which is exactly what it means). 1500 — it's a lot of? Well, the best players in the world are kept at 4000. A rating above 3000 counts «legendary». There's a pretty big chasm between 1500 and 3000, but the same chasm is between 1500 and 0. Maybe I should just say that my personal skill can be counted solely by the number of my trophies?
No. My true strength in combat is measured as the sum of three main factors: strength = player level + quality of play + deck choice.
My level determines the strength of my towers, and also roughly shows the level of my cards. Obviously, the stronger my cards and towers are, the better my chances of winning. But that doesn't mean I'm good or bad.
Deck Selection — this is an indicator of how well the cards in your deck work with each other, and how well your deck works against popular decks. Some skill plays a role here too, but sometimes you just might not be able to build a deck for lack of certain cards. Quality of play — The most obvious and reliable indicator of game skill: how well I control my deck and how I respond to my opponent's moves. You can't buy that with money.
At the moment I'm in a state of equilibrium, meaning I lose and win about the same percentage of battles, which means that my strength level and my opponents' strength level are equal. The average game level of my opponents — 6.3-6.4 (of which 30-40% are level seven, the rest are level six, occasionally there are level five players). Since I beat opponents slightly above me 50% of the time, according to the equation, we can conclude that my playing skills (quality of play + deck choice) are higher than theirs. If the average level of my opponents was seven or even higher, and I could still beat them with the same probability, you could say I'm playing much better than them. Because I would be able to win with weaker cards and towers.
So a more objective measure of the strength of a person's game — is his ability to minimize the differences in strength between himself and his opponents. And this indicator does not take into account the number of your trophies at all: game skills ~ (average opponent's level of cards and turrets) / (your level of cards and turrets).
The resulting model is oversimplified, but despite certain inaccuracies, it gives the most honest idea of how to determine a player's strength.
Is it worth buying cards
In Clash Royale the gold from the coffers is mostly used to improve cards, but you can also buy the gold in the store for the card you want.
Cards available for purchase. The more you buy, the more they get expensive
At first glance the question may seem rather silly: if you need a certain card and have the money for it, what's the problem? But it is more correct to think ahead: our goal — Improving our cards. Why do we need gold and a large number of copies of the same cards. What's the limiting factor?? In the long run, which comes first: the gold or the cards? Let's use the power of math.
Let's take a look at the number of cards and gold needed to improve rare and regular cards:
The following chart shows how much gold per card is needed to get one high level card:
Note that the amount of gold per card becomes constant (10) after the sixth level of improvement for regular cards and almost constant (40-50) after the third level for rare cards. Yep. I sense a hidden order in all of this.
So, if we want to improve every card we need, each chest should contain, on average, about 10 gold for every common card and 40 — For each rare card. If there is more gold in the chests, we can safely buy cards to spend the excess gold, but if not, we have to «cast» Our least favorite cards.
The statistics of items falling out of chests is a bit counter-intuitive, but the in-game wiki details everything. We'll use their data, and where they don't exist, we'll replace the blanks with assumptions. Most Chests — is «silver» и «free» chests. They yield roughly equal amounts of rewards. Rewards from chests also depend on your number of trophies when you get them. For me, at this point each chest contains seven common cards, each card with a 10% chance of being rare or epic.
Note: this means that for every seven cards, there is a 50% chance that at least one of them is better than the average.
The chest also contains 46-58 gold (simplify and assume an average of 52 gold from the chest, though the actual average, if you do the math, will be less).
Let's compare the two resources. Using the most likely distribution of cards and gold, and setting aside the rare possibility of an epic card falling out, we calculate the total amount of gold needed to improve each card falling out of the chest.
Gold needed per chest = number of cards * [(odds of getting a regular card * gold per regular card) + (odds of getting a rare card * gold per rare card)] = 7 * (0,9 * 10 + 0,1 * 40) = 91.
It's important to say that all data and calculations are approximate and may contain 10–20% error. But the 91 gold you need to improve all your cards, versus the 52 gold you get from your chest — quite a big difference. If you include epic cards in the calculations, the result is even worse, because each epic card needs about 200 gold to improve.
«Gold» Chests and crown chests — the next level of chests. At the same trophy level, a gold chest contains 161-184 gold (average of about 172) and 23 cards, two of which are guaranteed to be rare or epic. If you do the math again, you'll find that it takes about 320 gold to improve these cards, which, again, is a lot more than what comes out of the chest.
At higher levels the situation is even worse: from the silver chest falls on average 85 gold and 11 cards. It takes 143 gold to improve cards. 85 gold is only 60% of the required amount.
The first conclusion we can draw is that I can only improve 60% of all my cards in the long run (if I only use chests to progress). Which means I have to prioritize and plan ahead for what I want to improve. Second, I don't have to buy cards from the store, except in situations where I really, really need certain cards. The limiting factor of the game — gold, not the number of cards.
Another game-changing mechanism — is the ability to give cards to members of your clan. Every eight hours, any participant may ask their allies for a particular card. If you agree and donate a card, you get some gold and player experience in return for your efforts. The mechanism is extremely useful for the player who gives cards. You can ask for the same card together with your friend, and without losing any cards, just exchanging them, you will get gold and experience.
There are many positive things to say about the developers' efforts to make player interactions extremely pleasant and positive, but I will only focus on the mathematical side of the matter: you simply have to give your cards every time you have the opportunity, for purely selfish reasons. Like I said, the limiting factor in the game is — amount of gold. Therefore «sell» unnecessary cards — Good decision, even if you don't want to help anyone at all.
Some readers found my intuitive conclusion that you shouldn't buy cards from the store, even at a discount, to be wrong. They said that if you give away the cards you bought cheaply to clan members, the result will be a small profit. So, let's assume we bought the first regular card of the day (for a total of 3 gold units). The calculations are simple: sale price – purchase price = 5 gold units and 1 XP – 3 gold = a profit of 2 gold units and 1 XP.
Can't argue with that, right? And here are some not quite. First, I told you to give those cards that came out of your coffers and you already have anyway. The result will be an even greater gain: 5 gold and 1 XP – 0 gold = a gain of 5 gold and 1 XP
Pretty simple, isn't it? The only situation where the first equation works — When someone in your clan needs a card that you don't have, but happen to have it in the store right now. You don't need to buy a card to sell it.
Second, not every card is requested by someone. In my clan, about 4-5 cards are requested 80% of the time (half the people want a card «Barbara»). So if you suddenly buy an unpopular card, you won't even be able to make a profit of two gold coins.
How fast a player who does not pay money progresses
Almost at the very beginning at the first start of Clash Royale the player sees a sign saying something like «Clash Royale — free to play, but you can speed up your progress with in-game purchases». What is the player's progress rate?
It's pretty hard to predict how fast your personal game skill will grow. Main parameter that measures progress — Is the amount of experience gained. Let's see how quickly it is gained.
The primary method of gaining experience — card improvement. Epic cards are pretty rare, so let's not count them. Let's take a look at the table for gaining experience per card level.
As we've already figured out, the limiting factor is gold, so let's assume we have enough cards to improve, and focus on how much experience you can get per coin. Divide «Experience for improvement» at «Improvement Cost» and get the following:
Let's note that after the first few levels, the ratio «experience for gold» levels up to a certain value: 0.05 experience or less per coin. It is worth noting that fast progress in the first levels is very important to attract players in the first hours of. Since most of the gold is spent on high-level cards, we can use a ratio of 0.05 as a fairly accurate approximation (so as not to account for too many choices).
How fast we get gold? Assuming that we do not invest money in the game, and for the time being forget about the mechanism of donating cards to clan members (I remind you that it brings some experience and gold). As a result of money gold we get only from the chests. Of which there are six types:
The gold falling out of the chests is calculated for a level of ~1500 trophies
What it means «Opening time»? One of Supercell's best solutions for Clash Royale — is the system of opening chests and chest storage. For each victory you get a chest, but you can't just open them and get the contents immediately. Chests open for a while. This time varies, it depends on the type of chest, and only one chest can be opened at a time. Furthermore, you can only have four chests in your vault at a time (and one of them is likely to open), so if you win the game with a full vault, you get trophies, but not a chest.
The mechanism not only limits a player's progress to real time rather than game time, it also keeps players willing to play only a few battles in a row. Most free games limit users to the energy mechanism: in short, you can't play more than X times in Y time (unless you pay real money), which usually only annoys users. Such systems are made not only to increase profits from the game (few players invest real money), but also to prevent players from spending too much time in the game.
Imagine a big delicious pie, it's so good you can eat it in one day and then you'll think you'll never want to touch the pie again in your life. Clash Royale (like Fallout Shelter) eliminates the problem of boredom without artificially restricting players. After all, the decision not to play if the result of winning will not be obtained chest, any person will seem sensible and reasonable.
The chest storage system can seem pretty annoying. But really, it is what makes you go into the game several times a day for a small amount of time
Free chests and crown chests the player gets separately, they don't need to be stored anywhere, and they open instantly, so they can be considered an additional source of gold.
The second thing I should explain is why I wrote the word «random» in quotes (in the chest table). The type of chest obtained after a victory may seem random, but in fact it is determined according to a cycle of 240 chests recorded in the game. Each cycle contains exactly 180 silver chests, 54 gold chests, 3 magic chests and 3 giant chests. Suppose you open the chests in the most optimal way (which is unrealistic), and keep one chest open at all times. Then it will take you exactly 1,044 hours to open all the chests in the cycle, which is 43.5 days.
Since we know the exact order in which the chests fall from the table I linked to, we can tell how much gold the player will be getting from the different chests each hour of the 1044-hour cycle.
Gold from the chests in an hour. High spades standing for giant chests, and medium spades for medium chests — magical, and small — gold
Note that the gold acquisition rate is kept at the same level most of the time (about 39 gold per hour). Silver and gold chests generate approximately the same amount of gold per hour, because silver chests are opened faster. In fact, the average player gets 43.5 gold per hour thanks to the contribution of special chests. About half of the gold comes from free chests and crown chests, so don't underestimate them.
It is worth noting that the fall time of the special chests is not chosen randomly. Supercell designers have distributed them wisely. Each special chest triggers an emotional outburst in players. The first magical chest is usually won very early in the game. And it's very likely to draw the player deeper. But then, within the first 500 hours of play, the player only gets one giant chest. Supercell's chosen tactics show their confidence that the core gameplay is addictive enough to keep players from quitting the game in those three «desert» Weeks without special chests. Then, in the second half of the cycle, it is as if the player is being rewarded for his patience and trying to rekindle his love for the game, which may have already faded. Another reason for choosing a pseudo-random order for the rewards to fall may be that the pseudo-random distribution seems to be more «random». The frequency of silver and gold chests is not randomly chosen. For every two gold chests, there are usually 1-4 silver chests.
So we have calculated the approximate speed of getting gold. Let's multiply it by the amount of experience you get for one gold chest: experience/hour = experience/gold * gold/hour = 0.05 * 43.5 = 2.175 experience/hour = 52.2 experience/day.
Note that it is quite possible to get 10-15 or more experience points per day if you give cards to clan members. This takes into account the experience a player can get directly, and the experience he gets from the gold he receives for the gifted card. That's why I can't help but recommend this tactic, as it speeds up gaining new levels by 20-30%.
Now let's compare our data to the amount of experience required to get each level. And let's calculate how much (minimum) time a player will need. In my calculations, I took into account 25% of the experience per day obtained by giving their cards to clan members (as well as for achievements).
In a few days of active play a player can reach level five, but the higher the level, the more time it takes to develop (if the player does not pay). Reaching level 8 at optimal game speed will take about 2 months, ninth — for about 4 months. About 10-12 levels it is not necessary to speak, they are unattainable.
On the other hand, it is logical to assume that a player with a higher level of trophies will get more experience and levels. So for accuracy we will take into account that they will get chests with more gold and faster earning experience. But unfortunately I think even at high trophy levels (2000+) progress is only 20-25% faster. It still takes years to get to level 12.
So I guess the most accurate answer to the question «How fast can I get levels without investing money in the game», will be «not fast enough». Perhaps our goal will be to reach the eighth level, where we will stop.
Or even better: our goal will be to reach level eight and continually defeat «purse warriors» Tenth level to show them that game skills can't be bought with money.
How to Use Crystals
Clash Royale Premium Currency — are crystals. You can buy them directly at a rate of 80-140 crystals per dollar, depending on the size of the purchase. Crystals can be used in three different ways: speeding up the opening of a chest (the worst use of crystals), buying high quality chests (the most popular option) and buying gold (the best option, since we have found that gold is the limiting factor).
As a non-paying player, you can get crystals for one-time achievements, as well as about 2-4 crystals per «free» chests and chests with «the crown». I couldn't find any solid statistics on the chances of getting chests out of «free» chests (chests with «Crown» always give out crystals), so I have to use a very rough estimate of about 1 crystal per «Free» chest and 3 crystals – for a chest of «crown». Which means approximately 9 crystals a day in the best case.
There are three options to buy gold: 1000 gold for 60 crystals (the most inefficient), 1000 for 500 (the most logical), and 100000 for 4500 (the most profitable option, but the player who is not investing real money into the game will need 17 months to earn that many crystals). 500 crystals can be accumulated in about two months of play, or one and a half if you consider the 150 crystals you get for achievements.
Assuming we choose to spend the crystals this way, then each crystal is worth about 20 gold, which increases the gold earning rate to an average of 51, that is 7.5 gold. The 15% Difference.
Unfortunately, the first time we get to use the crystals is after a month and a half of play. Around the end of level 7 we will suddenly get 10,000 extra gold — about 500 experience points, — and almost immediately reach level 8, saving 10 days. Super.