Balance "rock - scissors - paper" Mathematical approach to solving the problem

About once every six months, I go through articles on game design and game analytics. Unfortunately, they contain many subjective experiences and little reproducible solutions. Today I decided to write a short article about the β€œrock-paper-scissors” balance based on the soulless theory of probability. The approach is available to any diligent reader. Of course, in the absence of a minimal mathematical culture, you will have to sort out

The article consists of 3 parts:

  1. Formulation of the problem

  2. Formalization (transition to formulation in mathematical language)

  3. Decision

Formulation of the problem

Let there be three classes of ships - battleships, cruisers and destroyers. Each of them has hit points, damage done to the enemy on hit and accuracy. It is necessary to adjust these parameters in such a way that in 60% of cases, each type defeats its antagonist:

  1. Battleships defeat cruisers

  2. Cruisers are defeated by destroyers

  3. Destroyers defeat battleships

Formalization

As an initial assumption, we will assume that the opponents are shooting at each other in turn, with the antagonist shooting the second. This assumption does not affect further reasoning and can be modified for a specific task. My goal is to show the way, not to provide a comprehensive solution for all possible variations of balance problems.

:

  1. 1 . – p1

  2. dam= dam1, dam1 – , . dam= 0. 2 dam

  3. 2 0 (hp2 <= 0), 1, 2

  4. 2 . – p2

  5. dam= dam2, dam2 – , . dam= 0. 1 dam

  6. 1 0 (hp1 <= 0), 2, 1 1

3

  1. 1 k

  2. 1

1

(hp1, dam1, p1), (hp2, dam2, p2). , hp dam k=hp/dam. , 6 4, (k1, p1), (k2, p2).

(, , ; , , ).

, , 1 k k2

C_ {k-1} ^ {k_2-1} p_1 ^ {k_2} (1-p_1) ^ {k-k_2}

(.. k-1 k2-1 , k- ). 2, k-1 k1 .

\ sum_ {i = 0} ^ {min (k_1-1, k-1)} C_ {k-1} ^ {i} p_2 ^ i (1-p_2) ^ {k-1-i}

(.. 2 min(k1-1, k-1) ). , 1 , k

\ begin {cases} p (1wins | k) = [C_ {k-1} ^ {k_2-1} p_1 ^ {k_2} (1-p_1) ^ {k-k_2}] \ sum_ {i = 0} ^ {min (k_1-1, k-1)} C_ {k-1} ^ {i} p_2 ^ i (1-p_2) ^ {k-1-i}, \: if \: k \ geq k_2 \\ p (1wins | k) = 0, \: if \: k <k_2 \ end {cases}

2

, 1

p (1wins) = \ sum_ {i = 0} ^ {\ infty} p (1wins | i)

, 1, , . , ( , 0,0001).

3

2 – . 3 , .

  1. , (hp, dam, p) , . :

      1. 0.595 <= p(, ) <= 0.605

      2. 0.595 <= p(, ) <= 0.605

      3. 0.595 <= p(, ) <= 0.605

    1. : 60, – 200 ( , , )

    2. : 8, – 15

    3. 0.01, – 10, – 1.

  2. (k1, p1), (k2, p2) , 0.595 <= p(x, y) <= 0.605 (p(x, y) – x y . 2)

  3. (k1, k2, k3, k4, k5, k6, p1, p2, p3) , 1.1

  4. , , .

\ begin {cases} {hp_1 \ over {dam_2}} = k_1, {hp_2 \ over {dam_1}} = k_2 \\ {hp_2 \ over {dam_3}} = k_3, {hp_3 \ over {dam_2}} = k_4 \ \ {hp_3 \ over {dam_1}} = k_5, {hp_1 \ over {s \: dam_3}} = k_6 \ end {cases}

s – 0 1,

(hp1, dam1, p1), (hp2, dam2, p2), (hp3, dam3, p3) – .

4 . .. () . () . s , , s= 1.3 – 30% .

  1. , . , , . , ..

  2. , ,

  3. , , , . . ,

, , . , , ;)




All Articles