This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Talk:Slot Machine

From Stardew Valley Wiki
Jump to: navigation, search
This talk page is for discussing Slot Machine.
  • Sign and date your posts by typing four tildes (~~~~).
  • Put new text below old text.
  • Be polite.
  • Assume good faith.
  • Don't delete discussions.

Strategy

I haven't seen this pattern in the game code. Can anyone else confirm the 11-13 then 5ish pattern? No harm in leaving it in for now, but if anyone has any more insight (e.g., the place in the code where it's not purely RNG) then please post!

Also, thanks to all for contributing to the wiki! margotbean (talk) 08:11, 17 May 2017 (BST)

Doing some testing with highest luck message from Fortune Teller noticed: 10-11 simultaneous loses followed by 2-3 simultaneous wins. This was tested on the Switch version so perhaps the wiki strategy is outdated now. mofear (talk) 02:43, 30 October 2017 (CST)

Thanks mofear! According to the game code it's purely random, so I'm removing the whole section. margotbean (talk) 15:10, 30 October 2017 (UTC)
For future reference to anyone reading this, the relevant code is in Slots.cs::setSlotResults. margotbean (talk) 15:35, 30 October 2017 (UTC)

I just tested it on PC, the pattern still is there. 12 loses, followed by 5 wins every other turn, then again 12 loses and so on. So I reverted your deletion of the section and added "for PC Version" for clarification. ValaDew2 (talk) 01:16, 31 October 2017 (UTC)

So, now what do I do with QiCoin.png150,000 :D ValaDew2 (talk) 01:34, 31 October 2017 (UTC)
Some more context: I had a very lucky day, and ate some luck-buff food for +2 luck. The pattern was: 12 to 14 loses in a row, followed by W-L-W-L-W-L-W-L-W. Some times even a 6th Win. ValaDew2 (talk) 01:34, 31 October 2017 (UTC)
Again, I refer you to the code for PC, which shows that the results are random. margotbean (talk) 03:32, 31 October 2017 (UTC)
I tested it for over an hour, over and over and over again. Yes, there is some kind of randomness in there, but the Pattern is there. Maybe somewhere else in the code, but it is repeating. IF it truely where random, then I and everyone else who exploits the pattern must have some magic power to "guess" the "random" result ;-) ValaDew2 (talk) 09:54, 1 November 2017 (UTC)
I'm sure you are right that the code you are refering to is responsible of the kind of Win (Only 1 Cherry or 3 Diamonds). But IF it is a W or a L follows the pattern so there is no need to keep the section deleted. Maybe reduce it a little bit, add some warning that it might change in the future or it might be "fixed" in non-PC-Version, but at of Version 1.2.33 it is present and useful information for players. ValaDew2 (talk) 10:10, 1 November 2017 (UTC)
You are welcome to write at length about the patterns you've observed on your machine on this Discussion page. margotbean (talk) 13:13, 1 November 2017 (UTC)
I was noticing the pattern too, so I spend some hours this afternoon with a disassembler. Apparently, when you click the '10' or '100' button a new "Random" object is created. The seed depends on "Club.timesPlayedSlots + Game1.stats.DaysPlayed + Game1.uniqueIDForThisGame", which is the times you played slot machine, your days played and some uuid. Interesting thing here is, the seed only increases by 1 every time and due to the way the RNG is initialised, this results in a pattern of numbers that alternates between high and low (explaining the win-loss streak). The values change minimally every time you play so you have to play a certain amount of times until you get into a range where the alternating numbers corresspond to w-l-w-l-w again etc. I tested this with a simple piece of code: creating a new Random object inside a loop thats counting from 1-100 and using that as a seed and then creating a random number from 1 to 100. The pattern resulting was something like 72-24-77-29-81-33-86-38-90-42 etc. Sleepysquish (talk) 00:47, 7 January 2018 (UTC)
So essentially the pseudorandom generation algorithm is a bit too obvious in its pattern. It might be intended to be truly random, but given that's impossible with computers we end up with this. (Addendum: Hey, I found an article on Wired (A Russian Slot Machine Hack is costing casinos Big Time) about how exactly this happens.) BreadBull (talk) 19:14, 16 May 2018 (BST)
Hello! I just wanted to contribute some data towards the slot machine WL pattern. Here's what I got from the spirits being in 'good humour' and giving me a 'little extra luck': 11L-Wcc-L-W-3L-Wc-16L-Wc-L-Wc-14L-Wf-L-Wp-3L-Wc-L-Wc-14L-Wcc-L-Wp-L-Wc-L-Wc-15L-Wp-3L--Wc-L-Wc-14L-Wf-L-Wp-L-Wc-L-Wc-L-Wc-14L-Wcc-L-Wp-L-Wc-L-Wc-15L-Wp-L-Wc-L-Wc-L-Wc-14L-Wm-L-Wp-L-Wc-L-Wc-L-Wc-14L-Wcc-L-Wp-L-Wc-L-Wc-16L-Wp-L-Wc-L-Wc-L-Wc-5L
LEGEND: Wcc = won with 2 cherries, Wf = Won with fishes, Wp = won with parsnips, Wm = won with milk
This let me grow my initial investment from 500 Qi coins to 5000 :D I also observed that no Diamonds appeared until nearing the end, maybe after I got the first 5WL streak? IceSk8 (talk) 15:54, 12 June 2018 (GMT+10)
Just had a day where spirits were 'very happy' and did 'their best to shower everyone with fortune'. Here's how my casino trip went:
7L-2C.P.C.CC 14L-2C.P.C.C 16L-P.C.C.C 14L-2C.P.C.CC 14L-2C.P.C.C 16L-P.C.C.C 13L-2C.P.C.C.C 14L-P.P.C.C 14L-Sh.P.C.C.C 13L-2C.P.C.C.C
LEGEND -- 'L' and '.' = loss, C = 1 cherry, 2C = 2 cherries, P = parsnip, Sh = shellIceSk8 (talk) 17:54, 12 June 2018 (GMT+10)
Did a long run on a max luck day with a lucky lunch before hand can't share the google sheets link unfortunately (99 rounds) however I noticed not a single win other
than a parsnip or cherry after the first win in a streak. I also ALWAYS observed a parsnip win second in the win streak. I usually had 12 L before a win, but 14 out of 99
times I had a 10L streak. 10L's would be before a big win, which would lead the streak (M,S,3C,S,D,S,M,S,F,3C,S,M,D,S) Legend: Mellon (M), Shell (S), 3 Charries (3C)
Diamonds (D), Fish (F) I also had 5-6 wins per round (Usually 6) --Rgpmtori (talk) 15:14, 26 September 2019 (UTC)

The problem lies in incorrect random seeding. At the start of each play, the code increments a timesPlayedSlots variable and seeds the random number generator with timesPlayedSlots, DaysPlayed, and uniqueIDForThisGame. I've recreated the code for playing the machine in an independent project with and without reseeding on each play. Without reseeding, the results are what you would expect to see from a slot machine. The problem can be partially fixed by commenting out line 211 in StardewValley.Minigames.Slots.cs. The constructor still seeds based on timesPlayedSlots, so the issue would still arise if the interface is reopened after each roll. However, if timesPlayedSlots is removed from the constructor seeding, the same sequence of rolls will be repeated after reopening the interface. Pickle lobster (talk) 16:08, 24 August 2018 (BST)

This, exactly. For others interested, you can read more about it here: (link was blocked because "This action has been automatically identified as harmful, and therefore disallowed.", but if you just google "C# random class" the microsoft doc is the first result.)
Avoiding multiple instantiations
Initializing two random number generators in a tight loop or in rapid succession creates two random number generators that can produce identical sequences of random numbers. In most cases, this is not the developer's intent and can lead to performance issues, because instantiating and initializing a random number generator is a relatively expensive process.
Both to improve performance and to avoid inadvertently creating separate random number generators that generate identical numeric sequences, we recommend that you create one Random object to generate many random numbers over time, instead of creating new Random objects to generate one random number.
Guye (talk) 18:52, 7 October 2018 (BST)
That *particular* problem (multiple instantiations of Random in short succession) doesn't occur when you seed them with specific values, as Stardew Valley does. However, getting the first random number while incrementing the seed value might not have the same guarantees of randomness as getting the first N values from a single instance. (I think the rationale here is to prevent save scumming behavior, but that's actually counter productive for slots, where you could reload the save after determining the sequence.)--Starwed (talk) 17:30, 20 October 2019 (UTC)

Repeating Pattern

The slot machines have certain patterns that can be exploited. By betting QiCoin.png100 when expecting a win and QiCoin.png10 when expecting a loss, you can quickly obtain enough coins to buy an item from the shop. It's also Important to note the best win (highest payout modifier) is usualy first in the win streak, exceptions are low payout wins: Double cherries can sometimes come first before Parsnips. Therefore it's important to find out how long your loss streak is so you can lead into your wins.

The occuring pattern consists of two parts

  • A slightly varying number of continuous losses (at least 12, up to 18, maybe higher)
  • A series of Win-Loss-W-L-W-L - also varying from only 3 Wins till the loss-series begin again up to 6 Wins.

As soon as two losses follow each other you are back in the first part of the pattern.

One Example of this may look like:

  • L-L-L-L-L-L-L-L-L-L-L-L-W-L-W-L-W-L-W-L-L-L-L-L-L-L-L-L-L-L-L-L-W-L-W-L-W-L-W-L-L-.....

Following some observations from other users:

On a day with a little Luck there are three patterns that occur in some order:

  • 16 losses then W-L-W-L-W-L-W
  • 14 losses then W-L-W-L-W-L-W-L-W
  • 14 losses then W-L-W-L-W-L-W

From playing 8 repetitions of the above patterns (14 or 16 losses followed by 4 or 5 W/L) the 5 W/L happened once. The highest observed match at the time was 3x shells.

(Observed: at the begining of a 5 W/L on a day with little luck, first win was 3x mellons.) --Gke96 (talk) 10:01, 24 March 2019

On a day where the spirits are displeased this pattern was observed:

  • 12 losses then W-L-W-L-W-L
  • 16 losses then W-L-W-L-W-L
  • 18 losses then W-L-W-L-W-L
  • 18 losses then W-L-W-L-W-L
  • 16 losses then W-L-W-L-W-L
  • 18 losses then W-L-W-L-W-L
  • 18 losses then W-L-W-L-W-L
  • 18 losses then W-L-W-L-W-L
  • 18 losses then W-L-W-L-W-L

The highest observed match at the time was 3x parsnips.

(Observed: in the middle of the above pattern, 3x shells was observed. No Luck bonuses active, not even Special Charm.) --Wills4545 (talk) 22:36, 10 November 2019 (UTC)Wills4545

Starting a new round of slot play will require QiCoin.png300 (18 losses x 10 = 180 + 100 high bet).

Contributions by:

ValaDew2 (talk) 17:00, 1 November 2017 (UTC) Rgpmtori (talk) 19:30, 29 September 2019 (UTC)

Luck weight?

Has anyone determined the luck weight for the slots, and if it's possible to gain over the casino edge by simply eating a [Lucky Lunch] on a day of good [Luck].--Ruedii (talk) 22:32, 19 July 2019 (UTC)

I don't have the luck weights, but it seems that using a [Lucky Lunch] may help the odds. It took me 6 losses before I hit a win starting from scratch, and it evened out that I would have 12 losses in a row before I hit a win. I'd then have on average 6 wins before going back to a loss. BerryFarmer (talk) 12:33, 28 July 2019 (UTC)

I don't have luck weight either but I have experienced the same thing with a lucky lunch as Berry, I tested this for 23 rounds so far and am continuing with my goal to get 1M --Rgpmtori (talk) 18:06, 24 September 2019 (UTC)

Roll Probability

I added this section based on source code I found on GitHub, but it's 2 years out of date (at least, since it was committed at the end of August 2017). I'm unsure if there have been material changes. Yoho (talk) 17:40, 28 December 2019 (UTC)

I really loved the table -- it's compact and clear. And then I read that it's 2 years out of date. Version 1.4 explicitly changed the odds of minigames in the Casino to favor the player instead of the house. So, I'm going to remove the changes until they are verified/updated. The current source code can be viewed using ILSpy or JetBrain's DotPeek. Your edit will always be in the page history, for reference. Thanks, margotbean (talk) 17:50, 28 December 2019 (UTC)