Time management games: how to make calculations and go through a tricky level

I recently tried time management game. The plot is typical for games of this genre - using certain opportunities to dispose of a limited number of resources to achieve a given goal in a limited time. I liked the toy, but at the 11th level a plug happened. In order to achieve the desired star (what can’t you do for the sake of virtual goodies?), I decided to go wisely and do some calculations in order to discard worthless strategies and still meet the allotted bonus time. This article is about what I did and what results I got.

Level Description and Task


Here is the initial level 11 map:



I’ll start by describing what is on it and what you will encounter when solving the problem.
  1. Castle. Here are units under our control: builders and tax officials. Builders build, improve and demolish objects, clear rubble, dig up treasures, and extract wood at a sawmill. Tax officials collect rent from residential buildings, enter into market transactions for the sale of wood, and pay ransom to pirates.
  2. Cottage. One of the two types of residential buildings available. In addition to them, you can build cheaper, but less profitable huts.
  3. Market. Here you can change the tree for gold. Within one transaction, you can choose one of three offers.
  4. Blockage. Restricts movement of units. When eliminated, it adds 10 units of wood to the warehouse.
  5. Treasure. By digging it, you can get rich (freebie sir!).
  6. Pirate. Restricts movement of units. He leaves after he is paid a bribe (he must not be offended by the State).
  7. Warehouse. Resources and units available to us.
  8. Tasks of the level. In this case, you need 5 houses (cottages or huts) with a garden.
  9. Bonus time indicator. We want to complete the task before it runs out.

Also available for construction:

Sawmill. Here you can, having a sufficient amount of gold, cut the wood necessary for the construction of all other buildings.
Hut. One type of residential building. Cheaper but less profitable than a cottage.

Resources


Initial Resources:
  • Units: builders: 3 pcs. / tax authorities: 3pcs.
  • Gold: 0 units (or 5,000 including treasure)
  • Tree: 0 (or taking into account the analysis of all blockages 110) units

Resources required for the construction and improvement of buildings, rent:
Building or improvement Gold Tree Builders Rent
Hut 75 1 100
1 hut improvement fifteen 1 125
2 hut improvement thirty 1 175
3 hut improvement 45 2 250
Hut garden 25 1
Cottage150 1 200
1 cottage improvement thirty 1 250
2 improvement of the cottage 60 1 350
3 cottage improvement 90 2 500
Garden for the cottage fifty1
Sawmill1000 1
Market 2501

Sawmill (cost of tree extraction)
The amount of tree to getPrice in units of gold
fifty500
1001000
2002000

Time:
ActTime to complete the action (in seconds)
Collapse analysis10
Digging Treasure10
Announcement Update20
Rent rent3
Market offer update20
Market transaction8
Making a deal with a pirate10
Building construction10
Building demolition10
Wood sawing8
Garden breaking8
Building Level Up6

Treasure. The map shows two treasures. The one on the left side of the screen is 5000 gold, and the one on the right is 1000 gold.

In order to open the passage to the right side of the screen, you need to pay the pirate 10,000 gold.

Bonus level time - 320 seconds.

Search for a solution


The choice of a line of behavior at this level is complicated by the fact that offers in the market are formed randomly. In order to understand what is best to do in this situation, I compiled a sample of 100 market offers:

Selection of market offers
Gold, Wood, Gold, Wood, Gold, Wood
100,10,500,40,500,20
1000,40,100,10,200,10
200,10,800,20,100,10
500,20,500,10,100,10
200,20,800,20,500,20
100,10,500, 40,200.10
200,20,100,10,800,40
100,10,200,10,800,20
500,40,200,20,500,20
800,20,200,20,100,10
800,20,800,40,100,10
200,10,800,40,500,10
100,10,200,20,500 ,
20,200,20,100,10,500,20
500,40,100,10,200,20
800,40,500,20,100,10
100,10,200,20,500,10
800,20,200,10,100,10
500,20,100,10,800,20
200,20,800,20,100, 10
500,10,800,40,100,10
100,10,500,10,200,10
1000,40,500,20,800,20
100,10,1000,40,500,10
800,40,500,10,200,20
500,40,200,20,500,20
500,10,200,20,800,20
100,10,500,20,500,40
200,20,500,40,500,10
500,40,800,20,800, 40
200,20,500,40,800,20
100,10,200,10,200,20
100,10,800,20,200,10
500,40,500,10,200,20
800,20,500,10,200,10
200,20,500,40,800,40
100,10,200,20,800,40
200,20,500,10,500,40
800,20,100,10,200,20
200,20,100,10,200,10
800,20,200,20,500,10
500,40,1000,40,100,10
500,40,800,40,100,10
800,40,100,10,500, 40
200,10,200,20,800,40
200,20,800,40,100,10
800,40,200,20,500,40
100,10,800,20,500,10
200,20,500,10,1000,40
200,10,100,10,800,20
800,40,200,10,200,20
100,10,800,20,500,40
500,10,200,20,800,40
800,40,500,20,200,20
800,40,200,20,100, 10
500,20,800,20,500,10
500,10,200,20,500,20
200,10,100,10,1000,40
100,10,200,10,500,20
800,40,100,10,200,20
200,20,500,10,800,20
200,20,500,20,100 10
200,20,200,10,100,10
100,10,500,10,200,10
200,20,800,40,100,10
800,20,800,40,1000,40
500,10,200,10,500,20
200,20,800,40,1000,40
200 20,500,20,100,10
500,20,800,40,500,40
100,10,200,20,500,20
800,20,200,10,200,20
500,10,100,10,200,10
100,10,200,20,500,20
800,20,500,40,100,10
200,10,500,10,500,40
200,20,100,10,800,20
200,20,800,20,100,10
200,20,500,40,200,10
100,10,800,20,200,20
1000 , 40,800,20,200,20
500,10,100,10,200,10
100,10,500,20,500,10
200,20,100,10,500,20
800,20,500,40,200,20
100,10,500,10,500,40
100,10,500,10,800,20
500, 20,100,10,500,10
800,40,100,10,200,20
200,20,500,20,500,40
100,10,500,10,500,40
200,20,1000,40,800,40
200,10,800,40,100,10
100,10,200,20,800,40
500 , 10,200,10,500,40
100,10,200,20,800,20
100,10,1000,40,200,10
200,10,800,40,200,20
200,20,500,10,800,40
800,20,1000,40,500,20

Based on the data obtained, it is necessary to draw up a trading strategy (i.e., a strategy for choosing random market offers). As such, I took the following:
  • Among the three proposals we choose the one that brings the maximum net profit;
  • If the net profit of several offers is the same, then we choose the one that brings more gold;
  • It is permissible to skip the offer only if the net profit of the available options is 0.

Net profit is calculated taking into account that 10 units of wood are worth 100 units of gold. Now you can analyze the data and get a table of profitability frequencies:
Net profit from the transactionFrequency of occurrence of an option with such profitability
1000.06
3000.13
4000.41
6000.4

From here we get that the average profitability of one transaction is 450 units of gold!

In order to accomplish the task of the round, it is necessary to build 5 residential facilities, and in the accessible part for us there are only 4 potential construction sites, so the right part is absolutely necessary to open. Thus, our task falls into two stages:
  1. Open the right side of the screen (i.e. earn 10,000 as soon as possible);
  2. Build the required number of objects.

Consider the first stage. How to quickly earn 10,000 gold? To solve this subtask, several options can be proposed:
  1. Demolish the market, build a sawmill in its place and combine rent from the cottage with profits from trade transactions.
  2. Demolish the cottage, in its place to build a sawmill and receive only trade income.
  3. Demolish markets and build cottages or huts in their place, receive only rent.
  4. Do not demolish anything, but sell the tree obtained from the analysis of the rubble, with the greatest benefit.

Let's consider these strategies in order.

Strategy No. 1


We have 110 units of wood and somewhere around 6,000 gold (it is assumed that the cottage will bring 1,000 gold during the first stage). As a result, we plan to get 11,000 gold (10,000 for redemption + 1,000 for the construction of a sawmill) and 350 units of wood (for the construction of 4 huts, we need 400 units of wood, for the garden in the cottage - 50, the missing 100 units of wood we intend to produce from a second dug treasure).

In order to calculate how long it may take to accumulate the necessary amount of resources for this strategy, we use the Monte Carlo method .

The simulation results, answering the question: “What is the probability that N market transactions will be enough for us to achieve our goal?”, Are shown in the table:
The number of required market transactions (N)Number of favorable casesThe probability that there will be exactly N deals (in%)
thirteenthirteen0.0
147480.7
fifteen64086.4
161968819.7
172915729.2
182437124.4
191311413.1
2048284.8
2113301.3
222880.3
23fifty0.1
2450.0

In this case, we have 2 markets available. One transaction lasts about 35 seconds (20 seconds to update the transaction, 3 seconds to make a choice of the transaction, 4 seconds for the tax officer to reach the market and 8 seconds to complete the transaction).

It turns out that you have to do from 7 to 12 calls to get the required number of transactions. We will calculate the time required to complete such a number of visits.
Number of visitsThe likelihood that so many calls is enough (%)The time required to implement this maneuver (seconds)
70.77 * 35 = 245
826.18 * 35 = 280
953.635 * 9 = 315
1017.935 * 10 = 350

We calculate the time spent on further actions. We need to make a ransom, dig a treasure and build 4 huts with gardens, having previously liquidated 2 markets. 10 (demolition of 2 markets and redemption) + 10 (dig a treasure and build 2 huts) + 8 (sawing firewood and setting up 2 gardens) + 18 (building 2 more huts with gardens) + 20 (operating expenses and expenses for moving units) = 66 seconds. We add here more time for the analysis of blockages at the beginning of the level (15 - 20 seconds) and we get that it takes about 80 - 85 seconds.

As a result, we get that, guided by this strategy, we have no chance of completing the task.

Strategy No. 2


We have 110 units of wood and about 5,200 gold. As a result, we plan to get 11,000 gold and 400 units of wood. Having done similar calculations, we got:
The number of required market transactions (N)Number of favorable casesThe probability that there will be exactly N deals (in%)
161230.1
1716911.7
1887458.7
192089420.9
202726427.3
212214522.1
221236212.4
2348564.9
2414441.4
253850.4
26790.1
27100.0
2820.0

Given the fact that we have 3 markets, you need to do 6 - 9 calls.
Number of visitsThe likelihood that so many calls is enough (%)The time required to implement this maneuver (seconds)
610.46 * 35 = 210
770.37 * 35 = 245
818.78 * 35 = 280

In this case, compared with the previous one, we need to build 1 more hut with a garden more, that is, it will take about 20 - 25 seconds extra (in total 100 - 110 seconds).

Thus, when implementing this strategy, the level can be passed in 10.4% of cases.

Let's try to implement this approach in practice:



It took 5 attempts to achieve this result. As a result, the goal has been achieved. We could dwell on this, but let us consider briefly the remaining strategies.

Strategy No. 3


This strategy seems completely hopeless. The cycle time for annuity is comparable to the cycle time for a market transaction, but trading has been shown to bring more than 2 times more gold.

Strategy No. 4


This strategy, most likely, will not work because it prefers waiting to active actions. In general, it could be investigated in more detail. I have no doubt that an interested reader will be able to do this on his own.

Conclusion


The task set has been solved, the goal has been achieved, but the results are somehow not particularly encouraging ... It was

not possible to find a strategy that would lead to success in at least 50% of cases. The question of the existence of such a strategy is also open. There is no guarantee that it exists at all in this particular case.

The results obtained suggest that it might be worth making some adjustments to the conditions of the round in order to make it more passable, because we have a casual game. What can be done to increase the probability of passing?
  1. Increase the round bonus time. If you increase the bonus time of the round by 35 seconds, then patency (strategy number 2) will exceed 80%.
  2. Reduce the size of the ransom or increase the amount of the treasure. If you reduce the buyback by 1000 gold, then patency (strategy number 2) will increase to 65%.

Despite the fact that the results did not please me, the game, nevertheless, delivered a lot of pleasant sensations. I think that anyone who plays this game has found it fascinating and will enjoy the gameplay, and this is the most important thing.

Also popular now: