GrimR
GrimR
  • Threads: 1
  • Posts: 7
Joined: Feb 27, 2011
February 27th, 2011 at 12:34:07 AM permalink
Hello,

I am from Sydney, Australia and have recently decided to pick up Delphi (Object Pascal) programming for windows again to take a shot at programming a PC version of an Aristocrat Pokie Machine by the name of "Where's... The Gold", a favorite of mine and many friends and family members here in Australia.

The images and sounds will be original even if not very good to begin with (graphics and sound are not my thing haha!).

So scouring good old Google for the past few days, I have found little information until I hit Wizard Of Odds and the Atkins Diet game, which is quite similar (WTG has 9 symbols and no sub, Atkens 11 symbols with a sub), WTG also has scatter symbol but feature is quite different (something that might be challenging later in development).

The major thing is, I have been following the PDF document available with this game to get an idea on the reel configuration (I have no idea how many symbols per reel WTG actually uses), where for the symbol reel table I substituted 2 of the Atkins Diet symbols that have the same payout for 2 different symbols for a double up of Jack and Queen symbols.

I am unsure of how well this will work in practice, and what the return will be, I do not know or understand the math of how to work these things out.

Could someone possibly explain?

The PDF in question is

The figures I mean are how the return was worked out based on the reel config etc.
Wizard
Administrator
Wizard
  • Threads: 1520
  • Posts: 27126
Joined: Oct 14, 2009
Thanked by
MichaelBluejay
February 27th, 2011 at 8:01:41 AM permalink
The easiest way to get the return for a video slot (what you would call a "pokie") is to do five nested for loops and score every way the reels could stop. With the wild symbols a formulaic solution is too messy.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
GrimR
GrimR
  • Threads: 1
  • Posts: 7
Joined: Feb 27, 2011
February 27th, 2011 at 5:22:30 PM permalink
Hi, thank for the reply.

Im actually stuck with the math figuring out the combinations and
pay back percentages etc, I spent several hours researching permutations
but can't seem to find something to produce the same results that you
have in the pdf (using the table in the pdf not my modified one)

I did manage to get 1 percentage for 4 in a row of Atkins symbol just
before I gave it up for the night but the calculation involved 5 reels, which
seems strange as 4 in a row can only happen left to right, first 4 reels for a
practical figure anyway?
nmacgre
nmacgre
  • Threads: 14
  • Posts: 84
Joined: Aug 23, 2010
March 1st, 2011 at 5:28:16 AM permalink
I had just posted a question about this yesterday. Thanks for the info. Grim you have to consider that on the 5th reel there are not 32 options. For four Atkin symbols in a row the last symbol cannot be an Atkins (cause that would give you 5 atkins in a row, a diffrent pay) and it also cannot be a steak, cause that would be come 5 steaks in a row. This would pay more than 4 atkins, so you dont count it as a 4-atkins possibility. So an example is you could get A-A-A-A-Mayo or A-A-A-A-Butter or A-A-A-A-Cheese.

What the wiz is saying he did is use a program that loops through every possible combination and tabulates the frequencies. The first tieration would check the first spot on each reel:
1-1-1-1-1
then
1-1-1-1-2
1-1-1-1-3
1-1-1-1-4
....
32-32-32-32-32.
Wizard
Administrator
Wizard
  • Threads: 1520
  • Posts: 27126
Joined: Oct 14, 2009
March 1st, 2011 at 5:41:58 AM permalink
Again, the math gets very messy with the wild symbols. It is by far the easiest to do five nested loops and score all 32^5 ways the reels can stop, and then take the average. If you don't program, then you'll have to learn, or take my results on faith.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
GrimR
GrimR
  • Threads: 1
  • Posts: 7
Joined: Feb 27, 2011
March 1st, 2011 at 11:08:44 AM permalink
Fair enough, yeah I could program something for it.

I thought there might of been some simple statistical math to work
out return (e.g 97%) etc.

Luckily my main game will have no wild symbols, the feature however is
riddled with them! Which is going to add more fun to payout line checking.

Also playing the particular machine yesterday after work I noticed some
odd line combinations, e.g two in a row bottom, then one at the very top
on center reel which pay, but even if two of the same symbol line up the
top with the middle one they are ignored. Seems a strange way to consider
a valid line and then negate anything beyond it even if lined up perfectly.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 2nd, 2011 at 7:49:13 AM permalink
Quote: GrimR

Fair enough, yeah I could program something for it.

I thought there might of been some simple statistical math to work
out return (e.g 97%) etc.



There's nothing simple about it; the question of whether a wild actually counts in a pay has to do with the context of the rest of the symbols around it. You can do it in a spreadsheet, but it's a very error-prone calculation.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
GrimR
GrimR
  • Threads: 1
  • Posts: 7
Joined: Feb 27, 2011
March 4th, 2011 at 12:52:19 AM permalink
Yeah I'm not too worried about wild's in regards to the other symbols, I don't use them in the main game, although the feature would be riddled with them (1-3 symbols can turn out to be wild symbols during the feature spins).

What about the return percentage, is there a reasonable way to do it, or does this require the combination and/or pay probability values to calculate?
DJTeddyBear
DJTeddyBear
  • Threads: 211
  • Posts: 11063
Joined: Nov 2, 2009
March 4th, 2011 at 5:06:13 AM permalink
I meant to say this days ago...


When I started work on my Poker For Roulette side bet, I was trying to use Excel to do my probability calculations. In my first version, I was trying to calculate things such as various hands with or without flush possibilities, etc. My head started to hurt, and I was never sure if I had it right.

When I added wilds to the mix, my head exploded. I threw up my hands and instead created a program to cycle thru all 79million combinations of 5 Roulette spins, to evaluate them individually.

This is identical to what is being suggested for this slot machine question.


Thanks to the Wizard and MathExtremist for making me feel better about my "failure" to get the calculations right.
Last edited by: DJTeddyBear on Mar 21, 2021
I invented a few casino games. Info: http://www.DaveMillerGaming.com/ ————————————————————————————————————— Superstitions are silly, childish, irrational rituals, born out of fear of the unknown. But how much does it cost to knock on wood? 😁
DJTeddyBear
DJTeddyBear
  • Threads: 211
  • Posts: 11063
Joined: Nov 2, 2009
March 4th, 2011 at 5:14:22 AM permalink
Return percentage?

Because my Poker For Roulette idea uses a progressive jackpot, the only way I could accurately project the return / house edge, was to run several 500million spin simulations, then take those results and feed them into Excel, tweaking the paytable to get the bottom line I wanted.

Basically, my simulation produced two output files. One contains the total number of hits for each winning combination. Simply multiply by the paytable to find my result.

The other is a log of each partial and full progressive winner. It contains the spin number and the type of winner. The spin number is needed to calculate the meter increment before the progressive payment is made. If the progressive was a full jackpot, I reseed it. If it was a partial, but causes the jackpot bank to fall below the reseed value, I top it off. Thru an Excel worksheet that's some 50,000 lines long, I track each of these events, and add them to the non-progressive totals to come up with my progressive analysis.

You probably need to do something similar.
Last edited by: DJTeddyBear on Mar 21, 2021
I invented a few casino games. Info: http://www.DaveMillerGaming.com/ ————————————————————————————————————— Superstitions are silly, childish, irrational rituals, born out of fear of the unknown. But how much does it cost to knock on wood? 😁
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 4th, 2011 at 9:27:07 AM permalink
Quote: DJTeddyBear

Return percentage?

Because my Poker For Roulette idea uses a progressive jackpot, the only way I could accurately project the return / house edge, was to run several 500million spin simulations, then take those results and feed them into Excel, tweaking the paytable to get the bottom line I wanted.

Basically, my simulation produced two output files. One contains the total number of hits for each winning combination. Simply multiply by the paytable to find my result.

The other is a log of each partial and full progressive winner. It contains the spin number and the type of winner. The spin number is needed to calculate the meter increment before the progressive payment is made. If the progressive was a full jackpot, I reseed it. If it was a partial, but causes the jackpot bank to fall below the reseed value, I top it off. Thru an Excel worksheet that's some 50,000 lines long, I track each of these events, and add them to the non-progressive totals to come up with my progressive analysis.

You probably need to do something similar.



No, for a progressive jackpot you only need to do this:
1) Calculate the RTP on the base game,
2) Determine the % of coin in you accrue to the meter
3) Add (1) and (2).

You can determine the average time to hit the progressive, and therefore the average jackpot size, based on the probability of that award. But as long as your accrual rate is constant (which, from your description, it may not be?), you don't need any fancy math. Just base game % plus coin-in %.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
DJTeddyBear
DJTeddyBear
  • Threads: 211
  • Posts: 11063
Joined: Nov 2, 2009
March 4th, 2011 at 10:01:04 AM permalink
I assume RTP means Returned To Player.

Accrual rate? I assume you mean the portion of the bet that goes towards the jackpot.


I wanted to estimate the maximum jackpot size. I keep getting the feeling that the casinos don't mind paying winners - as long as the casino is winning too. But what they do mind is paying large sums at one time, regardless of how much they pocketed in the meantime.

For that, I needed the jackpot size.

Additionally, because initial simulations revealed that the partial jackpots can cause the jackpot bank to fall significantly below the re-seed value, I had to add a top-off option. I doubt that can easily be calculated.

So, even if all I wanted was an estimate of the House Edge, I think my long analysis is required.

On the other hand, if the casino uses a smaller increment until the seed money has been replenished, and a higher increment afterwards, then the seed doesn't affect the edge, so simple math will work, I think.


Bottom line: Even if simple math would work, I kinda like doing it the long way. Interesting things became apparent when I did that - like the Top-Off requirement.
I invented a few casino games. Info: http://www.DaveMillerGaming.com/ ————————————————————————————————————— Superstitions are silly, childish, irrational rituals, born out of fear of the unknown. But how much does it cost to knock on wood? 😁
GrimR
GrimR
  • Threads: 1
  • Posts: 7
Joined: Feb 27, 2011
March 4th, 2011 at 4:04:09 PM permalink
Actually DJTeddyBear what your saying has given me an idea.

So far I have a basic screen, symbols, nice little reel effect with sounds and I have already started the lengthy and fun conditional branching for payouts of the main game (not started the feature yet).

But based on what you said, I could quite easily run background (non visual) simulations millions of times and come up with some figures that way, quick and dirty :P.
frankl
frankl
  • Threads: 0
  • Posts: 7
Joined: Mar 27, 2011
April 5th, 2011 at 7:35:50 AM permalink
Hi there,

miplet pointed me to this thread, because i had the same questions about the math behind the Atkin's slot like the thread starter.
I have experience with VB.net and programmed 5 nested for-loops.
First i checked if the program calculated correctly the 32^5 combinations (it did).

Next consideration... how do i tell the program what combinations he should count?
If i see how many combinations in the PDF of Atkins slot are listed... my 1st thought was... should i code a select case which has all lets say 55.000 cases from the symbols included?

Has someone a hint or idea for me, how i could teach the program to recognize the combinations?
So that the program knows: Steak-Steak-Wild-Steak = 4 in-a-row with steaks // Steak-Steak-Cake-Steak is not legal // Wild-Wild-Wild-Steak = 4 in-a-row and so on...

Any idea for me? I really have no clue how to do it!

Thanks for any help, best regards
Frank
nmacgre
nmacgre
  • Threads: 14
  • Posts: 84
Joined: Aug 23, 2010
April 5th, 2011 at 9:02:50 AM permalink
I actually wrote a program that takes in all the aspects of a slot (reels, rows, stops per reel, symbols, wilds, pay combinations, pay lines, x scatters required giving an n times multiplier with y free spins, etc). I had it go through each possible outcome (32^5 in your case), and for each possible outcome I compare it to an array of pay combinations. I have the pays sorted, and when it identifies a match it exits the pay array. This guarantees you always get the highest pay associated with a given combination.
GrimR
GrimR
  • Threads: 1
  • Posts: 7
Joined: Feb 27, 2011
April 5th, 2011 at 11:34:32 PM permalink
Use a loop basically.

I use a procedure, which makes a call to a function (for the sake of simplifying the procedure I created a function to handle some of the checking).

The loop will check every pay combination from top to bottom (best paying to worst) , it sends the symbol type of the particular
combination to a function (e.g. R1-C1, R1-C2, R1-C3, R1-C4, R1-C5 which would be the top line) and my function will then elaborate and loop check all symbols including feature wild symbols to find a left to right 3-5 in a row combination.

Then it steps to the next combination etc.....

It executes pretty quickly, the win/loss is calculated long before the reels stop.

Well it's something like this:


// I have 9 symbols 0-8, let's check them all.
For i := 0 to 8 Do
Begin
CalcPayLine(R1_C1, R1_C2, R1_C3, R1_C4, R1_C5, i);
//...... done 25 times for all 25 combinations obviously the R-C arrangement changes for each one.
End;

// The CalcPayLine function, The Seed is i from above ^.
// An insert from my own:
case Seed of
0:
begin // Handle the scatter.
if (gold_bonanza.Disp[1] = 0) OR (gold_bonanza.Disp[2] = 0) OR (gold_bonanza.Disp[3] = 0) then Inc(Symbol, 1);
if (gold_bonanza.Disp[4] = 0) OR (gold_bonanza.Disp[5] = 0) OR (gold_bonanza.Disp[6] = 0) then Inc(Symbol, 1);
if (gold_bonanza.Disp[7] = 0) OR (gold_bonanza.Disp[8] = 0) OR (gold_bonanza.Disp[9] = 0) then Inc(Symbol, 1);
if (gold_bonanza.Disp[10] = 0) OR (gold_bonanza.Disp[11] = 0) OR (gold_bonanza.Disp[12] = 0) then
begin
if (Symbol >= 1) then Inc(Symbol, 1);
end;
if (gold_bonanza.Disp[13] = 0) OR (gold_bonanza.Disp[14] = 0) OR (gold_bonanza.Disp[15] = 0) then
begin
if (Symbol >= 2) then Inc(Symbol, 1);
end;
end
else
begin // All but scatter, also checking wild/substitutes.
if (S1 = Seed) OR (gold_bonanza.Sym[S1].Sub) then Inc(Symbol, 1);
if (S2 = Seed) AND (Symbol >= 1) OR (gold_bonanza.Sym[S2].Sub) AND (Symbol >= 1) then Inc(Symbol, 1);
if (S3 = Seed) AND (Symbol >= 2) OR (gold_bonanza.Sym[S3].Sub) AND (Symbol >= 2) then Inc(Symbol, 1);
if (S4 = Seed) AND (Symbol >= 3) OR (gold_bonanza.Sym[S4].Sub) AND (Symbol >= 3) then Inc(Symbol, 1);
if (S5 = Seed) AND (Symbol >= 4) OR (gold_bonanza.Sym[S5].Sub) AND (Symbol >= 4) then Inc(Symbol, 1);
end;
end;
[/code\
frankl
frankl
  • Threads: 0
  • Posts: 7
Joined: Mar 27, 2011
April 6th, 2011 at 6:20:58 AM permalink
Hey GrimR & nmacgre,

thank you very much for your replies. It helps a little bit.
But to not spam my questions about the programming i sent you @GrimR a PM.
Thanks for posting the piece of code you did, it's a bit hard to understand :) because this kind of programs is really new to me.

Best regards
Frank
akkadian50001
akkadian50001
  • Threads: 0
  • Posts: 4
Joined: Jan 28, 2013
February 20th, 2013 at 12:52:14 AM permalink
Fantastic website....I have done the formulaic solution easily with no vba nested loops for all payline combos including wilds for quickhits platinum slot machine, doing some math research and hope to post results in next few months
  • Jump to: