The test game. The examples use one test game. It is not a real product. It has 5 reels, and each reel shows 3 symbols. Three scatters start 10 free spins, and a multiplier grows by 2.29 after each winning spin. The feature starts in 1 of 151 spins.
The earlier parts measured one round. A player comes with money for a period of time. This post measures that visit: the session. One term first: the RTP (return to player) is the part of all stakes that the game pays back in a long run.
The session model
A session is a sequence of rounds with a clock and a bankroll. The model has 5 rules.
- The player starts with a bankroll of 100 stakes.
- The stake is the same in each round.
- The session stops after 30 minutes, or when the bankroll cannot pay the next round.
- The game draws each round independently from the book table. The weight of a book sets its probability.
- Each round has a duration. A spin takes 2.5 seconds. A feature adds 6 seconds for its start and 2.5 seconds for each free spin.
With these durations, the mean round of the base game takes 2.72 seconds.
Five metrics for a session
Two of the metrics use belief. Belief is the fair value of the round at one moment: the average payout of all books that agree with the events so far. Travel is the sum of all changes of belief in one round, in stakes.
The symbol c is the cost of one round. The values are for the base game of the test game.
loss per minute = 60 · c · (1 − RTP) / E[seconds of a round]This metric is the price of play in time. The RTP does not show it. A game with the same RTP and shorter rounds costs more for each minute.
Multiply the price of a round by the part that the game keeps. The result is the mean loss of one round. Divide it by the mean duration of a round in seconds, and multiply by 60.
c- The price of one round, in stakes.
1 − RTP- The part of the price that the game keeps. If the RTP is 0.96, the game keeps 0.04.
E[seconds of a round]- The mean duration of one round.
a · b- a multiplied by b.
a / b- a divided by b.
mean_seconds = sum(r.seconds for r in rounds) / len(rounds)
loss_per_minute = 60 * price * (1 - rtp) / mean_seconds # in stakesUse it. Set a maximum for this value before you set the speed of the game. If the value is above the maximum, make the rounds longer or decrease the price of a round.
median time until a bankroll of 100 stakes falls to 50 stakesThis metric tells how long the money lasts. It joins the RTP, the volatility, the speed and the stake into one number. A player can understand it with no mathematics.
Play many sessions. For each session, find the time when the balance first falls to half of the bankroll. Sort these times and take the time in the middle of the list. Half of the sessions lose half of the bankroll before that time.
def half_time(session): # minutes until half of the bankroll is gone
for minute, balance in zip(session.minutes, session.balance):
if balance <= bankroll / 2: return minute
return float("inf") # this session did not fall to half
times = sorted(half_time(s) for s in sessions)
half_life = times[len(times) // 2] # the time in the middle of the listUse it. Decide how many minutes a bankroll of 100 stakes must last. If the half-life is shorter, decrease the volatility or the price of a round.
thrill per minute = 60 · E[travel] / E[seconds of a round]Travel is the raw material of thrill. This metric gives the intensity of the game. It tells how far belief moves in one minute.
Add the size of each move of belief in a round: this is the travel of the round. Divide the mean travel of a round by the mean duration of a round in seconds, and multiply by 60.
mean_travel = sum(sum(abs(news) for news in r.news) for r in rounds) / len(rounds)
mean_seconds = sum(r.seconds for r in rounds) / len(rounds)
thrill_per_minute = 60 * mean_travel / mean_secondsUse it. If the value is low, add steps that show information, or make the rounds shorter. Shorter rounds also increase the loss per minute, so read the two values together.
thrill per stake lost = E[travel] / (c · (1 − RTP))This metric gives the value for money. It tells how far belief moves for each stake that the game keeps. A mode can increase the intensity and decrease this value at the same time.
Divide the mean travel of a round by the mean loss of a round. The mean loss is the price of the round × the part that the game keeps. You get the same value if you divide the thrill per minute by the loss per minute.
Example. In the base game: 94 stakes of thrill per minute ÷ 0.87 stakes of loss per minute = 108.
mean_travel = sum(sum(abs(news) for news in r.news) for r in rounds) / len(rounds)
mean_loss = price * (1 - rtp) # stakes that the game keeps in one round
thrill_per_stake_lost = mean_travel / mean_lossUse it. Calculate this value for each bet mode. If a mode has a lower value than the base game, decrease its price or add steps that show information.
½ · min(largest win, 500) ÷ bankroll + ½ · (end balance − start balance) ÷ bankrollPeople remember the best moment and the end of an event better than its average. The psychologist Daniel Kahneman calls this the peak-end rule. The score is a rough model of that memory.
Take the largest win of the session, but not more than 500 stakes, and divide it by the bankroll. Take the end balance minus the start balance, and divide it by the bankroll. Add half of the first number and half of the second number. The value of a game is the mean score of all its sessions.
min(a, b)- The smaller of the two numbers.
½- One half.
Example. The bankroll is 100 stakes. The largest win is 60 stakes, and the session ends with 30 stakes. The score is 0.5 × 60 ÷ 100 + 0.5 × (30 − 100) ÷ 100 = 0.30 − 0.35 = −0.05.
peak = min(session.largest_win, 500) / bankroll
end = (session.balance[-1] - bankroll) / bankroll
score = 0.5 * peak + 0.5 * end # then take the mean of all sessionsUse it. Use the score to compare two versions of a game with the same RTP. If the score is low, test a feature that starts more frequently.
The first metric has an exact formula.
60 · c · (1 − RTP) / E[S]. S is the duration of one round in seconds.Add the loss of all rounds, and divide by the total time. In a long session, the result comes near one value: the mean loss of a round divided by the mean duration of a round. A short session can be far from this value.
Example: a round costs 1 stake, the RTP is 0.95, and a round takes 3 seconds. The game keeps 0.05 stakes for each round, and 1 minute has 20 rounds. The loss is 20 × 0.05 = 1 stake for each minute.
- Let the player play
nrounds. Roundicostsc, paysXᵢand takesSᵢseconds. - The total loss is
n·c − (X₁ + … + Xₙ). The total time isS₁ + … + Sₙseconds. - The rounds are independent. The law of large numbers says that
(X₁ + … + Xₙ)/ncomes nearE[X] = RTP·c, and(S₁ + … + Sₙ)/ncomes nearE[S]. - Divide the total loss by the total time. The result comes near
c·(1 − RTP) / E[S]stakes for each second. - Multiply by 60. The result is the loss per minute.
Consequence: if two games have the same RTP and the same stake, the faster game costs more per minute.
For the base game: 60 × 1 × (1 − 0.9606) ÷ 2.72 = 0.87 stakes per minute.
Bet modes: one RTP, three products
A bet mode sells the same game for a different price. The test game has 3 modes. The base game costs 1 stake for each spin. The ante costs 2 stakes for each spin, and the feature starts in 1 of 46 spins, not 1 of 151. The bonus buy costs 66 stakes and starts the feature immediately.
The RTP is almost the same in the three modes: 96.1% in the base game, 96.1% with the ante and 96.6% with the bonus buy. A report with only the RTP shows three equal games. The session metrics show the difference.
The ante gives 2.1 times the thrill per minute of the base game. The bankroll half-life is 5.5 minutes in the base game and 2.0 minutes with the ante. The ante also gives more thrill for each stake lost: 134 against 108.
The bonus buy has the most thrill per minute (254 stakes) and the least thrill for each stake lost (60). With the bonus buy, 71% of the features pay less than their price. Its bankroll half-life is 3.3 minutes.
After 30 minutes, 31% of the base-game sessions are still in play. The value is 17% with the ante and 5% with the bonus buy.
Some modes give more thrill per minute and less thrill for each stake lost. Such a mode spends the bankroll faster for the same entertainment.
Independent rounds have no momentum
Players speak about hot periods and cold periods of a game. The session model can test this idea, because it draws each round independently.
P(result of the next round | all past rounds) = P(result of the next round).The chance of each result in the next round is the same after each history. A sequence of losses does not make a win more probable. A sequence of wins does not make a win less probable.
Example: a real win comes in 1 round of 5. After 20 rounds with no real win, the chance of a real win in the next round is still 1 in 5.
- Let
Bbe the book of the next round. LetHbe the sequence of books of all past rounds. - The draws are independent. The definition of independence is
P(B = b and H = h) = P(B = b) · P(H = h). - The definition of conditional probability is
P(B = b | H = h) = P(B = b and H = h) / P(H = h). - Put step 2 into step 3. The term
P(H = h)divides out, and the result isP(B = b). - The payout and each event of a round are functions of its book. As a result, the same equation is true for them.
Consequence 1. Let p be the probability of a real win in one round. A real win pays the stake or more. The number of rounds before the next real win is k with probability p · (1 − p)ᵏ. This is the geometric distribution. It has no memory: a long time with no win does not make the next win more probable.
The rounds do not depend on each other. For this reason, multiply the chances. Take the chance of a round with no real win, one time for each such round. Then multiply by the chance of a real win.
p- The chance of a real win in one round.
1 − p- The chance of no real win in one round.
(1 − p)ᵏ- The product of k copies of 1 − p. For k = 2, it is (1 − p) × (1 − p).
k- The number of rounds with no real win before the next real win.
Example. In the base game, p is 0.150. The chance of exactly 2 rounds with no real win and then a real win is 0.850 × 0.850 × 0.150 = 0.108.
# the chance of a real win in one round
p = sum(r.payout >= stake for r in rounds) / len(rounds)
# the chance of k rounds with no real win, then a real win
chance = p * (1 - p) ** kUse it. Decide how long a time with no real win your player accepts. If the times in your game are longer, increase the chance of a real win.
In the base game, p = 15.0%. The geometric formula gives a median of 4 spins and a 90th percentile of 14 spins between two real wins. The simulation gives 4 and 14.
Consequence 2. A hot period or a cold period has only two possible sources. The first source is chance. The second source is state that the game keeps between rounds, for example a meter or a collection. A book table has no such state.
In one round, the designer controls the sequence of events. Between rounds, the designer controls nothing.
The feel vector of a session
One number cannot describe a session. Two sessions can end with the same balance and feel different. In the first session, the balance falls slowly and no feature starts. In the second session, the balance falls fast, and then one feature brings it back.
For this reason, the series describes each session with 12 numbers. Together, the 12 numbers are the feel vector of the session. Some numbers measure money, some measure time, and some measure belief.
The selection follows the brain science of Part 3. Thrill, letdown and delight count the prediction errors. Blank teases count the near misses. The largest win and the last 3 minutes are the peak and the end of the session, and memory keeps these best.
Three names in the table need a definition. Letdown is the fall from the highest belief in a round to its payout. Delight is the rise of the payout above the highest belief before the end of the round. A blank tease is a tease in a round that pays less than the stake.
| Name | Meaning | Mean | 10th pct | Median | 90th pct |
|---|---|---|---|---|---|
| Minutes played min | The time until the session stops. | 18.1 | 7.47 | 15.0 | 30.0 |
| Net result × | The end balance minus the start balance. | -16.2 | -99.8 | -99.2 | 208 |
| Largest win × | The largest payout of one round. | 95.3 | 7.40 | 45.4 | 244 |
| Thrill per minute ×/min | The travel of belief in one minute. | 87.0 | 65.0 | 86.3 | 109 |
| Letdown per minute ×/min | The sum of all letdowns in one minute. | 34.9 | 29.7 | 34.9 | 40.1 |
| Delight per minute ×/min | The sum of all delights in one minute. | 6.64 | 1.65 | 6.64 | 11.9 |
| Blank teases per minute /min | The number of blank teases in one minute. | 0.79 | 0.51 | 0.77 | 1.11 |
| Longest drought s | The longest time with no real win. | 69.0 | 47.5 | 65.0 | 95.0 |
| Time to first feature min | The time until the first feature starts. The value is the session length if no feature starts. | 10.7 | 1.23 | 4.97 | 30.0 |
| Features count | The number of features in the session. | 2.67 | 0.00 | 2.00 | 7.00 |
| Largest drawdown × | The largest fall of the balance from a peak. | 125 | 99.1 | 104 | 185 |
| Last 3 minutes × | The net result of the last 3 minutes. | -24.6 | -48.9 | -36.6 | -3.57 |
The table gives the values for 30,000 sessions of the base game. Part 10 groups these vectors with e-means clustering. Each group has a centre, and each centre is one archetype: a typical session. Then a designer can count how many sessions of each type a game makes.
Do it with an AI agent
You do not write the simulation. You give the instructions, and you read the checks. The numbers in the instructions are the values of the session model of this post. Replace them with the values of your game.
Read my books and my weights. Simulate 30,000 sessions of the base game. Each session starts with a bankroll of 100 stakes. A session stops after 30 minutes, or when the balance cannot pay the next round.
Draw each round independently: the weight of a book sets its chance. A spin takes 2.5 seconds. A feature adds 6 seconds for its start and 2.5 seconds for each free spin. After each round, record the time and the balance.You get. One record for each session: the time and the balance after each round. The first balance is 100 stakes, and no session is longer than 30 minutes plus one round. For comparison, a session of the test game has a mean of 400 rounds.
Calculate the loss per minute in 2 ways. Way 1: add the loss of all sessions, and divide by the total minutes of all sessions. Way 2: calculate 60 × the price of a round × (1 − RTP) ÷ the mean seconds of a round. Print the two values.
You get. Two values that are almost equal. Way 2 is the formula of this post. In the base game of the test game, it gives 0.87 stakes for each minute, and way 1 gives 0.89. If your two values are far apart, the durations or the RTP are wrong.
For each session, find the first minute when the balance is 50 stakes or less. Sort these times, and print the time in the middle of the list: the bankroll half-life. If a session does not fall to 50 stakes, put it at the end of the list.
For each minute from 1 to 30, print the part of the sessions that are still in play. A session is in play until the balance cannot pay the next round.You get. The bankroll half-life, and a curve like Figure 2. The curve starts at 100%, and it does not go up. Where it goes below 50%, half of the bankrolls are empty: minute 15 in the base game of the test game. The half-life of that game is 5.5 minutes, and 31% of its sessions are still in play after 30 minutes.
Do instructions 1 to 3 again for each bet mode of my game. Use the books and the price of a round of that mode. Print one table with one row for each mode. The columns are the loss per minute, the bankroll half-life, and the sessions in play at the end.
You get. The price of each bet mode in time and in bankroll. In the test game, the RTP is almost the same in the three modes. The bankroll half-life is 5.5 minutes in the base game. It is 2.0 minutes with the ante and 3.3 minutes with the bonus buy.
Next: Part 10. Clusters and control: design toward a feel.