xkeeper

welcome to my personal hell

dragon warrior iii for the game boy color describes me as "stubborn", and i'm tempted to agree with that assessment


co-owner tcrf.net. i run an old forum, jul.
i've been around the internet since '01.
i generally feel like the internet
peaked somewhere around '07.


private: @xkeeper-PLUS
18+: @xkeeper-TI


plural / some kind of digital therian thing.
still discovering myself.
all of this is new to me.


discord / telegram
@xkeeper
signal
Xkeeper.99

rgmechex
@rgmechex

Happy 2024! After a holiday season hiatus, let's get back into the swing of things.

After the video and article on the Super Mario Bros. 3 roulette game, a few people asked about the Super Mario Bros. 2 slot machine game. So let's take a look at that today! However, let's go back to the original build of the game, Doki Doki Panic.

The Bonus Chance screen from Doki Doki PanicI just love how plain this screen is by the way, what a lovely shade of green.


So, fittingly, this slot machine is programmed just as simply as its graphical presentation was. There really are no tricks or anything; it's as basic as you can get.

There are three slot reels, each of which has eight different icons. Each icon displays for four frames. Here is the entire meat of the slot machine code:

; $7DDE: routine to process the ticking
; of each of the reels
ProcessSlots:
  LDX #2 ; number of reels minus 1
- LDA ReelState,X
  BEQ +
  DEC SlotCounter,X
  BNE +
  LDA #4 ; number of frames each icon displays
  STA SlotCounter,X
  DEC SlotIcon,X
  BPL +
  LDA #7 ; number of icons per reel minus 1
  STA SlotIcon,X
+ DEX
  BPL -
  RTS

And there's nothing special about how the slots are stopped either:

; $7DC4: routine to check if a reel should
; be stopped when the A button is pressed
CheckStopReels:
  LDA Buttons
  BPL +
  LDX #0
- LDA ReelState,X
  BNE .stop_slot
  INX
  CPX #3 ; number of reels
  BCC -
+ RTS

.stop_slot:
  LDA #0
  STA ReelState,X
  LDA #4
  STA SoundEffect
  RTS

Every reel will stop immediately upon the player pressing the A button. Interestingly there is no memory address dedicated to which slot is the "active" reel--that is, which reel will be the next for the player to stop. The game just scans through each reel and looks for the first one that is not already stopped. Nothing bugs out if you poke the memory and stop the reels out of order.


What are the odds for the slot machine? Well here is a full look at each of the three reels:

The eight icons on all three reels from the Doki Doki Panic slot machineA pretty even distribution of icons.

If you get a match, you get an extra life. However, the cherries are bonuses. If you match three cherries, you get five lives instead. And even if you only get a single cherry in the first slot, you still get one extra life. If you get cherries in the first two slots, you get two lives. Everything else is a fail and nets you nothing.

So here's a breakdown of the full odds of this slot machine:

ResultPayoutCalculationOdds
One Cherry13×7×8168/51232.8%
Two Cherries23×1×721/5124.10%
All Cherries53×1×13/5120.586%
All Big Veggies12×2×312/5122.34%
All Small Veggies12×2×28/5121.56%
All Snifits11×3×26/5121.17%
Fail0294/51257.4%

This results in an expected value of 0.49 lives per attempt, which is honestly not that bad!


Super Mario Bros. 2 didn't change too much about the slot machine game other than just making it look a lot more appealing (even if it did just copy the title screen layout). However there was one small tweak that greatly nerfed the payout:

The eight icons on all three reels from the Super Mario Bros. 2 slot machineBig veggies were turned into stars, and the small veggies were turned into a... medium veggie that doesn't show up elsewhere in the game?

Two of the cherries on the first reel were changed into a veggie and Snifit. Considering that getting just a single cherry made up for almost a third of total plays (three quarters of total wins!), this is a massive shift towards the house. The new odds are like so:

ResultPayoutCalculationOdds
One Cherry11×7×856/51210.9%
Two Cherries21×1×77/5121.37%
All Cherries51×1×11/5120.195%
All Stars12×2×312/5122.34%
All Veggies13×2×212/5122.34%
All Snifits12×3×212/5122.34%
Fail0412/51280.5%

This brings the expected value down to just 0.22 lives per attempt, less than half of the original. Which I guess implies that Doki Doki Panic coins were worth about 2.26 times more than Super Mario Bros. 2 coins. Shrinkflation impacting Subcon as well, I see.

Now, these slots aren't exactly random--you can try to time each reel to land on exactly what you want, since the same eight icons appear in order again and again. This means you can probably get a little better than the expected value for each of the slot machines. Still pretty difficult though!


The slot machine got a huge upgrade in Super Mario All-Stars, so we'll have to look at that one another time!


You can support Retro Game Mechanics Explained on Patreon here! Any and all support is greatly appreciated!


You must log in to comment.

in reply to @rgmechex's post:

Thanks for this article! It seems like the text in the code snippets is black-on-black when I view the site with my browser on Dark Mode.

As much as I love hidden black-on-black secrets like in Robot Odyssey, it'd be nice to be able to read the code snippets without changing my browser to Light Mode. :)