How Do Online Casinos Work?

Inersha

Dormant account
Joined
May 27, 2008
Location
UK
Hey everyone,

Firstly, don't worry -- my actual question isn't as vague as the title suggests! I'm essentially just interested in how online casinos work with regards to using RNGs to randomize outcomes during play.

When you're playing on a downloadable casino client, does anyone have an idea of how the system works? For example, when playing a game like roulette:

1) Place your bets.
2) Click "spin".
3) The client communicates with the server's RNG to randomly select a result.
4) The game animation starts and displays the result.
5) Winning bets are paid etc.

Does that sound about right, or is that process a little off (or missing something)?

Am I right to assume that the RNG is not influenced by anything at all on the player's end? Not in the rigged sense, but for the purpose of further randomization?

Also, in theory, would the result of a standard spin after clicking "spin" produce the same result as if you had clicked "turbo spin" or something similar?

If anyone has any thoughts or links to articles on this subject I would greatly appreciate it. I'm not skeptical about the legitimacy of the results, I'm just curious about the system and how it works.
 
I'm essentially just interested in how online casinos work with regards to using RNGs to randomize outcomes during play.


I'm just curious about the system and how it works.


Without anyone ever being able to gain access to the actual online gaming regulations, from any of the different alleged online gaming regulators, located at any of the different online gaming regulators jurisdictions, I could only assume that any response to your questions here would be based on for "hear say". Unequivocally, it could not be based on fact. Regardless if any regulations are even being enforced which I truly doubt in the first place, no one could know for sure anything about how online gaming is even suppose to work.

The only hope you got is from experiences here and other sites telling you where it is less likely you won't be mugged for your money. That is until of course these recommended casinos think that mugging the players will achieve better results for them.

Although online gaming was a great idea a decade ago, unfortunately now it has proven at least to the educated advanced gambler not a smart place to gamble at all.
 
Without anyone ever being able to gain access to the actual online gaming regulations, from any of the different alleged online gaming regulators, located at any of the different online gaming regulators jurisdictions, I could only assume that any response to your questions here would be based on for "hear say". Unequivocally it could not be based on fact. Regardless if any regulations are even being enforced which I truly doubt in the first place, no one could know for sure anything about how online gaming is even suppose to work.

The only hope you got is from experiences here and other sites telling you where it is less likely you won't be mugged for your money. That is until of course these recommended casinos think that mugging the players will achieve better results for them.

Although online gaming was a great idea a decade ago, unfortunately now it has proven at least to the educated advanced gambler not a smart place to gamble at all.

Of course, that is only hearsay......and so is this.
 
You are not completely helpless in this matter. What you can do is carefully observing the game - and reasonable deduction.

What happens when your game crashes at any time, do you find the game in the same state as before (with same bets and same results displayed) ?
If that is the case, then the client does not make any settlement of the bet, i.e. the RNG is connected to the server, not to the client.

Do you experience "lag", i.e. when drawing a card on a cardgame ? If so, the client waits for the server to respond with a drawed card, which itself has to wait for the RNG to respond....
 
Of course, that is only hearsay......and so is this.

Nifty I'm glad you seem to know everything. You must have developed all casino software and played for 15 years online right to know everything like you do. Man your smart ,when I grow up I wanna be just like you . NOT
 
Nifty I'm glad you seem to know everything. You must have developed all casino software and played for 15 years online right to know everything like you do. Man your smart ,when I grow up I wanna be just like you . NOT

That wasn't very nice. There is a function called the ignore function. If Nifty's remarks (posts) bother you so much, I would suggest you utilize this function, then you don't have to be bothered with his comments. As with any forum, you will find persons who you can totally relate to and others you can't. Such is life. If we were all alike with the same thought processes the world would be a pretty boring place and no one would ever learn anything new...
 
Nifty I'm glad you seem to know everything. You must have developed all casino software and played for 15 years online right to know everything like you do. Man your smart ,when I grow up I wanna be just like you . NOT

I'm really quite chuffed that you want to emulate me!

Just let me know when you grow up and I'll give you some pointers.

@pinsnpies - poor form thanking a post like that.
 
Thanks for the replies everyone, appreciate it.

Disappointing to hear that there isn't a rough but widely-accepted system for how results are generated and when the RNGs come in to play. I was hoping that there would be some kind of process that the majority of legit casinos followed.

Do you think theres any chance that a respectable casino would give me a bit of an insight if I asked? Or would that be a bit of a longshot?
 
Well, it's already been beaten to death I think that we don't really know how most casinos produce their random numbers, so no one can really answer your question in a way that's gonna be true for every online casino or piece of software you'd encounter out there. But I know a little about this since I wrote the RNG interface for my own software to comply with most licensing jurisdictions out there. So as a coder I can tell you what I learned I had to do, and what other software companies should be doing. Whether they're actually doing it or not, I really don't know.

There are some best practices that licensing jurisdictions require casino software to follow. I take this from the Isle of Man's rules, since that's what I based my design on, but I'm pretty sure Malta, Curacao, etc. have similar regulations. IoM OGRA says that, basically, you need a special license to run a random number generator. Separate from your gaming license. And in any event, whether you have this license or someone else does, or if your numbers are generated from offshore, they must never be influenced by player actions or network states.

On the surface, this seems like it gets to the meat of your question. The numbers are generated somewhere; you get them when you click "spin"; they are absolutely predetermined by the time your game client gets them and shows an animation; and in theory, they were predetermined before that. That's where it gets a bit philosophical and twicky, though. Because, if you aren't going to give the same random numbers to two players at the same time, they are by definition going to be somewhat influenced by the network state. In fact, IoM and other licensing regulations make it somewhat more likely that numbers will be less purely random, because in order to conform to their requirements, numbers generally need to be ordered in batches and queued. A single RNG can't produce enough random numbers on demand to meet peaks; Apache will crash if too many threads are waiting for the RNG. It becomes an engineering problem. So you end up with a short-term (anywhere up to 10 seconds) running pool of randoms that are drawn from by each player. Again, this is how my software works, I can't speak for others. But think of it as one gigantic random number, constantly between 50,000 and 100,000 digits long.

Now let's say that you and someone else hit "spin" at the exact same time. We're going to pull the last [32] digits off that random number pool and give it to the next spin. The game itself might only look at the last 3 or 4 numbers there, but it doesn't matter, we always take 32. And when we refill the pool, when it's running low, we do it in prime denominations so that the end of one sequence never matches the end of a given spin. But by definition, "network states" play into it. In the same way that God plays into the way dice bounce in a casino. If you have a quicker connection than the other guy, you'll get the first 32 numbers on the stack and he'll get the next 32. If the software is busy with someone else when both hits happen, you might get the 3rd and he'd get the 5th set in the stack.

To answer your question about clicking Turbo versus Spin, in my experience, you will get exactly the same base random numbers. But remember I said that what the software does with that 32-digit number may differ depending on what the software needs from it. So if we're talking about shuffling a deck of cards, I'll use the first 16 digits to generate a longer number that shuffles the deck once, and the next 16 digits to shuffle it again. In a 5-reel slot, I might only need the top 10 digits. There's no reason why Turbo versus Spin would be different, but there's no real way for you to know as a player.

The best thing you can do is to find a casino that publishes all its card shoes and all its spins and dice rolls, so you can be sure it's completely fair and random. Beyond that, on the moment-to-moment question of predestination...all I can say is that, having thought about it a lot when I was writing the code, I think the question of who gets to the random pool first and who gets the lucky draw is basically an existential one. One guy's lucky, another guy isn't. What they mean by "network states" isn't who gets there first; they're trying to prohibit code from using the noise on the network, or the time lag of the network, as a seed for random numbers. Which no responsible operator would do. But at the end of the day, cached or queued or otherwise, there are the same ~47% of spins that are lucky, whatever way you want to look at it.
 
Having a 32 digit (I assume bit) random number (so 1 out of 2^32) is not sufficient for most card games. It will only give you 5(!) random cards from a 52 card deck, as the 6th card is not random anymore: 52!/(51-6)! > 2^32.
After the 7th card seen you would be able to predict all other cards in the deck.

You would really want to play Texas Holdem with your system, knowing all hole cards on the river.
 
Hey Mango. I simplified the example of how my system's shuffling works, for the sake of keeping the explanation clear. In truth, no one is generating decks with 52! possibilities. But you're completely right that a 32 bit seed doesn't give enough possibilities to prevent prediction in a Hold'em game.

I don't use a single 32-bit seed to shuffle decks. When I said my software takes a 32 digit number from the random pool, I mean it's a 32 digit decimal number. This number is considered truly random as it comes from a remote RNG. We use the first 10 digits of the random number to create a hash which is then bitmasked to create our first unsigned 32-bit seed. The seed is fed to a Mersenne Twister, which is an algorithm that will always produce the same series of numbers given the same seed. MT is considered unpredictable for the period of about the first 623 numbers...meaning that from the first 623 in any given series, you can't guess the key. That doesn't make it random of course. The only random part is which MT sequence we're using, which is determined by our 32-bit seed, which means there are only 2^32 possible sequences.

So anyway, we use the MT to generate a predictable series of numbers from our random seed. We then use those numbers to do a Fisher-Yates shuffle on the deck. The point of the FY is that it provides an even distribution of possible shuffles from any given starting deck over a 32-bit period. After that, though, the last number we take from that MT sequence is used to cut the deck at a random point. Then we re-seed the MT with the next ten truly random numbers in our 32-number sequence, shuffle and cut again. Then we do it a third time.

If we started with a single 32-bit seed and shuffled three times, we'd still obviously only end up with 2^32 possible decks. But by doing it this way we have what amounts to a 96-bit seed, which can produce around 27! possible combinations, or a period of 16 known cards that have to be seen before the rest of the deck becomes predictable. While it's true that that's still only a tiny fraction of possible poker decks, it's far too many to be useful to an attacker. What historically has happened is that hackers were able to narrow down the possible sets of decks by cuing into how pseudo-random generators were being seeded, specifically, when one casino was dumb enough to publish its algorithm which turned out to be nothing more than seeding by their system's microsecond value. Once a hacker synchronized with that value, they could predict the seeds and didn't have to brute-force their way through 2^32 decks to figure out what deck they were looking at after 5 cards.

This is the classic paper on the subject, btw...
You do not have permission to view link Log in or register now.


Brute force times have improved a lot since then, but you still can't crack a 96-bit shuffle in real time if the seeds used to generate it are genuinely random.
 

Users who are viewing this thread

Meister Ratings

Back
Top