Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesGame Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 9th, 2006, 03:48 AM
brett777 brett777 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 8 brett777 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 43 m 9 sec
Reputation Power: 0
Fruit machine simulation - question

I was thinking about how a fruit machine simulation would work and one question that has always puzzled me is how they adjust the odds for winning (or perhaps I should say losing). I.e. the person that owns or is renting the fruit machine can adjust the odds to a particular percentage payout. E.g. 70% payout would equate to the punter gets back 70p (on average) out of each pound that is inserted. It's a well know factoid in the UK that certain fruit machines, e.g. where there is a high volume of passing trade, like a fast food place, have very low payouts - which is to say that the payout percentage has been set low.

One way that I could simulate this would be to set up three arrays that would represent the three (just three for now) reels and populate the arrays, e.g. array1 = { "melon", "pear", "apple", etc }, and likewise for array2 and array3, then have a payoff array. We pick an index at random in each of the three arrays (reels) and then compare this value to the payoff array, so we might get "pear", "pear", "pear" and check in the payoff array where three pears pays 2.00. In this case the frequency of the fruit symbols and their combinations will determine the average payout over time.

Rather than just apply a percentage factor to the winning amount, imagine that there is a payout list on the front of the machine that says "Three pears pays 2.00", "Three apples pays 3.00", so we can't just say 2.00 / 70%. One way that I could change the payout percentage would be to have say 50 fruit symbols in each reel array and change the frequencies of the different fruit items. A bit of tweaking and this should do.

But bearing in mind that reels in a real fruit machine are fixed, how do they change the payout percentage? If I know this then perhaps I could think how this would work in an analogous way in a simulation.

Anyone have any ideas how this works in RL?

Reply With Quote
  #2  
Old July 9th, 2006, 12:33 PM
Schol-R-LEA's Avatar
Schol-R-LEA Schol-R-LEA is offline
Commie Mutant Traitor
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Location: Lost in the suburban jungles of Atlanta
Posts: 1,419 Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level)Schol-R-LEA User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 6 Days 13 h 23 m 8 sec
Reputation Power: 997
For a moment I was confused by this, but then I remembered that 'fruit machine' is British slang for 'slot machine'. Gotcha.

Yeah, it's certainly possible to simulate slots, and in fact (in US casinos at least) mechanical slot machines have largely been replaced with 'video slots', which are cheaper to buy and maintain, can be reconfigured to different styles, and are more easily set to give the desired odds (desired by the casino, that is. The players usually want rather better odds than those, but tampering with game odds in most places carries penalties ranging from a stiff fine, to nice long swim under the boardwalk in a cement overcoat, depending on where you are and who you've crossed.)

As for how you would do it, there are several possible approaches that I can think of. If you want to simulate how mechanical slots work reasonably closely, what you'll want is to have 'reels' with several entries for the lower-paying items, and only a few or even just one for the higher-paying ones. For further realism, you can keep track of the position of the reels after each draw, and then use the random value as a modular offset from the current position; though to do that well, you would have to interpolate the least common values between the most common more or less evenly. to get the odds of a payout would require a bit of calculating, as you would have to get the combinatorial odds of the combination coming up over the range of all possible permutations; you'll have to pardon me if I can't recall the exact way you would do this offhand, but it isn't too difficult of memory serves. This article covers the basic methods though it focuses more on roulette and poker than on slots), while this one gives a bit more of the theoretical basis of probability calculations.

A simpler method, closer to how (AFAIK) some modern video slots work, would be to have a range of values for each combination, with the most common having the largest range and the least common the smallest. Needless to say, you can give more or less arbitrary odds of a combination coming up this way. To calculate the payout odds, you would simply take the ratio of the number of values assigned to a combination over the total range of possible values. So, if you have 1728 combinations (equivalent to three reels with 12 possible outcomes per reel), you might assign three triple bars (the top payout in most US machines) to a value of 0 (zero), three double bars to an outcome of 1, 2 or 3, two triple bars and a seven to 4, 5, 6, 7, and so on, up to 1727, with most of the range taken up with garbage combinations such as 'orange bar cherry'; the odds for the first would be one in 1728, the second 3:1728, the third 4:1728, etc.

You might want to check out the Wikipedia entries on slot machines, odds, probability and similar topics for some additional information on the terminology, odds calculations and so on. The Institute for the Study of Gambling and Commercial Gaming may have some articles which would be of interest as well, I suppose.
__________________
Rev First Speaker Schol-R-LEA;2 JAM LCF ELF KoR KCO BiWM TGIF
#define KINSEY (rand() % 7) λ Scheme is the Red Pill
Scheme in ShortUnderstanding the C/C++ Preprocessor
Taming PythonA Highly Opinionated Review of Programming Languages for the Novice, v1.1

FOR SALE: One ShapeSystem 2300 CMD, extensively modified for human use. Includes s/w for anthro, transgender, sex-appeal enhance, & Gillian Anderson and Jason D. Poit clone forms. Some wear. $4500 obo. tverres@et.ins.gov

Last edited by Schol-R-LEA : July 9th, 2006 at 12:40 PM.

Reply With Quote
  #3  
Old July 9th, 2006, 02:44 PM
brett777 brett777 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 8 brett777 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 43 m 9 sec
Reputation Power: 0
Hi. Well that certainly is a lot to think about so I'll consider it over the next few hours and see what I can come up with. Thanks for the references as well.

b.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesGame Development > Fruit machine simulation - question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT