0
\$\begingroup\$

I am making a slot game with 3 x 5 reels. The RTP I am targeting is 99%. My reel data is given as (yaml):

99: - [11, 5, 10, 2, 7, 5, 9, 1, 7, 3, 8, 4, 11, 12, 6, 10, 3, 8, 2, 11, 3, 8, 5, 12, 6, 9, 12, 4, 10, 13, 2, 7, 6, 9] # 34 - [11, 12, 3, 9, 8, 4, 9, 5, 7, 2, 9, 6, 7, 2, 8, 5, 11, 6, 8, 10, 3, 12, 2, 10, 11, 1, 10, 4, 13, 6, 7, 5, 12, 3] # 34 - [8, 5, 11, 3, 12, 6, 9, 7, 3, 10, 4, 8, 13, 2, 7, 4, 11, 2, 9, 5, 12, 3, 10, 9, 2, 12, 1, 7, 5, 8, 6, 11, 10, 6] # 34 - [3, 10, 5, 11, 6, 7, 11, 6, 7, 2, 13, 3, 9, 2, 10, 1, 12, 11, 3, 12, 4, 9, 8, 5, 10, 2, 8, 5, 7, 12, 4, 8, 6, 9] # 34 - [6, 7, 10, 9, 1, 12, 6, 11, 2, 9, 3, 8, 2, 7, 5, 10, 7, 4, 8, 3, 12, 13, 6, 11, 5, 8, 2, 10, 5, 12, 4, 9, 3, 11] # 34 

The win lines are 20 :

{2, 2, 2, 2, 2}, // 1 {1, 1, 1, 1, 1}, // 2 {3, 3, 3, 3, 3}, // 3 {1, 2, 3, 2, 1}, // 4 {3, 2, 1, 2, 3}, // 5 {1, 1, 2, 3, 3}, // 6 {3, 3, 2, 1, 1}, // 7 {2, 1, 2, 3, 2}, // 8 {2, 3, 2, 1, 2}, // 9 {1, 2, 2, 2, 3}, // 10 {3, 2, 2, 2, 1}, // 11 {2, 1, 1, 2, 3}, // 12 {2, 3, 3, 2, 1}, // 13 {2, 2, 1, 2, 3}, // 14 {2, 2, 3, 2, 1}, // 15 {1, 1, 2, 3, 2}, // 16 {3, 3, 2, 1, 2}, // 17 {2, 1, 2, 3, 3}, // 18 {2, 3, 2, 1, 1}, // 19 {1, 1, 1, 2, 3}, // 20 

and the paytable is as:

var LinePay = [13][5]float64{ {0, 10, 200, 2000, 10000}, // 1 wild {0, 2, 25, 100, 750}, // 2 bitcoin {0, 2, 25, 100, 750}, // 3 usdt {0, 0, 15, 100, 400}, // 4 doge {0, 0, 10, 75, 250}, // 5 shtkoin {0, 0, 10, 50, 250}, // 6 hold the pain harrold {0, 0, 10, 50, 125}, // 7 chad {0, 0, 5, 50, 100}, // 8 polygon {0, 0, 5, 25, 100}, // 9 sol {0, 0, 5, 25, 100}, // 10 jack {0, 0, 5, 25, 100}, // 11 ten {0, 2, 5, 25, 100}, // 12 nine {}, // 13 scatter } 

Short description:

  1. I am setting the game which is too long to be posted here
  2. I spin (choose random 5 elements from the reels above)
  3. I am checking win lines (may be more than one in the 20 lines scenario)
  4. I am calculating the win via the pay table

I am running a test with a histogram to calculate the rtp via the suggested formulae (total_wins / total_bets) * 100 per each spin. The test reports a starting RTP of 1500% and slowly degrades when approach around 20,000 spins but remain like consistent 1300%. What I've read I may need to run more than 300,000 spins to normalize the RTP and to get it close to the target RTP (99 in my case).

So my question is how can I measure that my reels are indeed 99% rtp given that gameplay, and also does the random plays a significant role in the scene? I am using a default random call from golang runtime, but I may change it with marsene twister or dev/random if it is a key factor.

Not a slot game professional so if I am missing some info please correct me and I will provide it.

P.S. Scatters give free games and are omited for now and I don't change reels I am using only those.

\$\endgroup\$
8
  • 2
    \$\begingroup\$ This question definitely needs more information: 1) What do the numbers in the "reel data" represent? Are they just placeholders for different results? 2) What are the win lines? What do the numbers represent? Are they which rows should give a payout? If there are multiple rows that match do they all pay out? 3) What is the pay table? What do the numbers and columns represent? 4) You say you "choose random 5 elements from the reels above" but there are 5 rows in the table which presumably represents the 5 columns, so shouldn't you be choosing 3 random elements for a 3x5 reel? \$\endgroup\$ Commented May 8 at 23:25
  • \$\begingroup\$ We're not slot game professionals either! You're going to have to explain some of this terminology. Your explanation or RTP as (total_wins / total_bets) * 100 is clear enough, but how much is a bet? Do you bet 1 per spin? 1 per line? Some other amount? \$\endgroup\$ Commented May 9 at 7:09
  • \$\begingroup\$ Separately: if your game is so complex that you don't understand the probabilities then how do you expect the players to understand it when they play? \$\endgroup\$ Commented May 9 at 7:18
  • \$\begingroup\$ reels are like array data that is choosen randomly for in a loop. In more details when you select element X from array A , you also pick A[X-1] A[X] A[X+1] that is like most slot digital machines work. The lines describe which rows/cols must match the indexes in order to give a win, pay table is the multiplier of the bet. Bet is usually multiplied by lines selected (for simplicity assuming all 20). I am not having a trouble with the game play itself since it spins, show lines, gives the respective pay outs The problem is that I can't verify the payback is indeed 99% for the player. \$\endgroup\$ Commented May 9 at 7:39
  • 1
    \$\begingroup\$ OK. The user sees a 3x5 window, and the "win lines" are which lines are checked to see if they award a prize, i.e. {2, 1, 1, 2, 3} means row 2 of the first column, row 1 of the second column, row 1 of the third column, etc. are checked for wins. And for example if all five have symbol 1 (wild), the player wins 10000. Is that right? What happens if a line has 2 of one symbol and 3 of another, do they both win prizes? Are all the win-lines checked independently, and if several award prizes they are added together? \$\endgroup\$ Commented May 9 at 7:43

1 Answer 1

2
\$\begingroup\$

I am running a test with a histogram to calculate the rtp via the suggested formulae (total_wins / total_bets) * 100 per each spin. The test reports a starting RTP of 1500% and slowly degrades when approach around 20,000 spins but remain like consistent 1300%. What I've read I may need to run more than 300,000 spins to normalize the RTP and to get it close to the target RTP (99 in my case).

This sounds like you are using the Monte Carlo method to analyze your game. Monte Carlo is a good way of getting quick answers, and is very good at analysing complicated games, but its answers are only probabilistically correct. It's a good first step but you should try to get the exact answer if you can. I'm not sure where you're getting the figure of 300,000 from -- you could only know how long it takes to converge if you know the variance of your game, and you would need to know the RTP to calculate the variance.


A more accurate approach, if this is practical for you, is to examine every possible outcome in order. There are only 34^5 possible positions the reels can be in, so that's 45,435,424 cases to consider -- if your computer can calculate the payout for 1000 of those in a second, you can calculate the exact answer overnight. That'll depend a lot on how fast your program is.


OK, seriously now, here's how I'd do it. Neither the position of the win lines nor the order of the symbols on the slots affects the expected result, thanks to linearity of expectation. And we can look at each symbol independently and just add up the answers -- assuming that there's no special rules for "full houses", so scoring two wilds and three jacks will award 7 times the bet (because two wilds gives a prize of 2 and three jacks gives 5, and they're added together). That makes this game possible to analyse with a pocket calculator. Probably. Realistically I'd still use an Excel spreadsheet or something.

Let's start with symbol 8, the polygon, as an example. You said the paytable is {0, 0, 5, 50, 100}, so if the winline contains 5 polygons then the payout is 100, four polygons pay out 50, three polygons pay out 5, and two or one or zero pay nothing. (Correct me if this is wrong, I'm not familiar with the slot machine terminology in the question.)

Each reel contains 34 symbols of which 3 are polygons. Considering a single winline (it doesn't matter which one), the odds of getting a polygon on the winline in any given reel is 3/34. And we can use the binomial theorem to calculate the odds of getting any combination of polygons. I'll skip the calculation here, and just give you the answer:

  • There is a 243/45435424 chance of getting 5 polygons.
  • There is a 12555/45435424 chance of getting 4 polygons.
  • There is a 259470/45435424 chance of getting 3 polygons.
  • There is a 2681190/45435424 chance of getting 2 polygons.
  • There is a 13852815/45435424 chance of getting 1 polygons.
  • There is a 28629151/45435424 chance of getting 0 polygons.

You can check that these probabilities add up to 1 if you like.

The expected payout from the polygons alone is 243/45435424 * 100 + 12555/45435424 * 50 + 259470/45435424 * 5, which comes to 1949400/45435424 or about 0.0429.

Repeat this analysis for each of your thirteen symbols and add the results together to get the total RTP.

This tells you which of your symbols is contributing a lot to the expected payout, so you can make sure that they're the ones you intend.

\$\endgroup\$
1
  • \$\begingroup\$ This is a great answer. I will try out this one, and I don't think I actually need to test it in my app, I can mock it up in a separate program to see expanding all probabilities and contributing to the RTP. Looks like the montecarlo estimate didn't gave correct approaches. And also I was reading Kormogolv Smirnoff test can be applied on that also. But some suggested chi squared. Kind of confusing since trust me the books for that topic are extremely rare. I will try to refer to Knuth's AOP 2nd book for numerics for more ideas. \$\endgroup\$ Commented May 9 at 10:32

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.