
It will be about games in which you need a random, but controlled balance of some elements that often appear on the screen and have both positive and negative properties. For example, take the game
Doodle Jump . There are several types of steps in it - some help me jump higher - others can make it difficult for a character to move up or even kill him. At first the game is very simple - there are a lot of steps, positive ones are much more than negative ones, everything seems easy. But after a while the gameplay becomes more complicated - there are more negatives, there are few steps, they are scattered across the screen.
I will try to explain how to achieve such a result in a very interesting way - *
by the anchor method *.
')
And so: let's say we have 3 positive steps and 6 negative ones. We need to give each step weight. Positive will be with a plus sign, negative with a minus sign. At the same time, the weight of positive ones should be significantly greater if we want them to appear less often than negative ones, or vice versa if we want to achieve the opposite result.
Positive | Value | Negative | Value |
---|
Positive 1 | +100 | Negative 1 | -ten |
Positive 2 | +300 | Negative 2 | -50 |
Positive 3 | +80 | Negative 3 | -20 |
| | Negative 4 | -eight |
| | Negative 5 | -50 |
| | Negative 6 | -15 |
Positive and negative steps are essentially one type of steps — one that obeys the
rule of anchor *. Neutral steps (standard) and killer steps should be derived from this formula. They can be set either as an absolute value (if you know how many steps there can be in a game or on a leveler), or as a percentage.
Now about the anchor itself.
It should have a maximum and minimum value (or an arithmetic average). For our example, you can use this:
- MAX: 100 MIN: 20
- MAX: 40 MIN: -20
- MAX: 0 MIN: -80
What will come of it? The minimum and maximum values do not mean that steps beyond this range will not appear at all. This means that the anchor will try to align the appearance of all the steps between the maximum and minimum value. When generating a level, we have the sum of the weights of the steps on the platform (or on one screen) and the current value of the anchor. Here's what it looks like:

The current and absolute value of the anchorIf the current value of the anchor falls in the range between MAX and MIN, any steps are generated. With their weight they shift the anchor in some direction - he resists and tries to shift the balance back in the very next step. In our example, this means that when several positive steps have been generated, which have significantly more weight than negative ones, the anchor will shift to the plus side. In order to align this value, the next will generate steps with a negative value in order to align the position of the anchor until it reaches the MAX-MIN range again.
If we need - the value of the anchor can be shifted in any direction as we need it. It does not matter if we generate steps for an endless game or within a level. It all depends on what kind of balance we want to achieve. You also need to be very careful about setting weights on the steps themselves - since it is from their ratio that the anchor will either deflect quietly or with significant jumps to one side and then level itself with the opposite value.
His behavior also depends on the width of the anchor range. If you set a very wide range - the absolute value will constantly fall into it and will be more random when generated. If the range is set to be very narrow - the value will jump it then plus plus to minus - it will be hard to achieve a controlled result.
In any case, all the balance values need to be adjusted to fit your needs. But having such an instrument and a final goal is very easy to achieve.