Game "probability"

11 65
Avatar for wabinab
2 years ago

In games, like games of coinfaucet.net or if you play CryptoHeroes, there are a recent discussion about people not getting the correct probability of item they're supposed to get. Let's talk about CryptoHeroes example here, but this may apply to other examples too.

This is what you see in the description box when you want to go for dungeon. The game have 90% chance of dropping common items, and 10% chance of dropping rare items, but people started reporting that they played the dungeon say 100 times, but they only got 3-7 rare items. What happened? Is it false of this probability mentioned?

Actually not. That's because we thought the probability are mutually dependent when they are mutually independent. The explanations are available on lots of web pages, which you can search up online, but let's talk about it a little here. Remember this article aims to raise your awareness between the difference, these are not original ideas, popular among statisticians; but not very among end users like us.

So the idea is, you can "roll the dice" for 100 times and get 0 rares, in the case above, and the probability is still 10%. Reason is, they're mutually independent; what you get before does not affect what you get after. Just because you haven't get a rare in the previous 50 dungeons doesn't mean your 51th "roll" will be 50% chance of getting a rare. That's mutually dependent. Mutually independent means, whatever you have before doesn't affect whatever you have in the future. Your next 50 rolls after you got 50 common items, might still not get you another rare items, as the chance is still, 10%.

There may be some biases in the configuration though, especially we don't use a quantum computer to generate probability number in most cases (though there are developments of real quantum computer already available, and services to generate purely random number, you can search for IBM Quantum or quantum computer or other brands like IonQ quantum computer on Google). What we have is a pseudo-random quantum generator, and at a certain time, we might have a configuration that are biased towards a small number being generated on subsequent calls, another block of time biased towards larger number being generated on subsequent calls, hence decreasing/increasing our chance of hitting the threshold to get a rare equipment.

Any method to increase your probability?

This goes towards the programmer's side. Usually when we program probability, we program a threshold. When a number is larger than that threshold, then it's rare. If it's less than or equal to that threshold, then it's common.

random_number = generate_integer_between_1_and_100_inclusive()

threshold = 90

if random_number > threshold: # 91-100 inclusive
  print("You got a rare item.")
else:  # 1-90 inclusive
  print("You got a common item.")

Instead of the above, you could have the value spread out instead. Let's see a naïve implementation of the detail.

random_number = generate_integer_between_1_and_100_inclusive()

these_are_rares = [5, 15, 25, 35, 45, 55, 65, 75, 85, 95]

if random_number in these_are_rares:
  print("You got a rare item.")
else:
  print("You got a common item.")

If you would like to increase the probability at a certain range:

# --snip--

these_are_rares = [5, 6, 7, 27, 28, 29, 65, 66, 67, 99]

# --snip--

These also can work out. (Of course, you might want to find way to create these systematically instead of hard-coded ones, like using random number generator to generate these numbers, or use the equal-spacing ones will have libraries to do that in Python, most probably in other languages too, or any method you can think of). Without thresholding, especially if your random number generator (RNG) keeps generating number in certain ranges most of the times, this might offer a higher probability (or lower, since you can program against it if you know how your RNG works) for getting certain items.

Conclusion

Hope you now understand how random number works in games, and don't be shocked the next time, if you can't get any wins matches those that you expect it to, just because of the difference between you expecting a mutually dependent outcome vs the computer's RNG producing a mutually independent outcome.

4
$ 0.88
$ 0.81 from @TheRandomRewarder
$ 0.05 from @ahmadmanga
$ 0.02 from @DrPsycho
Sponsors of wabinab
empty
empty
empty
Avatar for wabinab
2 years ago

Comments

I remember watching a video about game design and how to make a game feel good to play... One trick they mentioned was that most games don't give you accurate chances, if you see your chance of hitting an attack being 80% the video games are programmed so you'll definitely not miss more than 2 times out of 10.

The 80% is a mutually independent probability, but it doesn't feel fair if the programmers didn't treat it as if it was mutually dependent. (Video games are all about feelings, not actual facts.)

$ 0.00
2 years ago

Oh right I can understand what you try to mean. Yes one used to try to program something mutually dependent, with some "memory" to store the previous few values and if still haven't get to certain value, then force the probability to go within that value by restricting the random number generator to that "hit" value. But of course that requires much more line of code than just "generate a number".

Thing is, even the programmers might not be totally aware of the difference between mutually independent and mutually dependent; and these tiny things might need the player's feedback to the programmer hence he/she only changes how the probability works based on the feedback. So perhaps next time you play a game, you could tell the dev teams about mutual independency to change their mind of how they program the game's logic. :D

$ 0.00
2 years ago

Yes, one piece of advice I kept hearing through my learning of GameDev: Test early, and let others test your stuff. Some things you can't know unless you see the struggles of the user.

$ 0.00
2 years ago

Agree.

$ 0.00
2 years ago

You clearly explain about probability of the game. It took me interesting. I Hope I can win Lotto someday.

$ 0.00
2 years ago

Hahah good luck with winning Lottery for you!

$ 0.00
2 years ago

Great article, such a nice explanation. Keep up the good work, because if you keep up the good work your probability of getting more subscribers will be high😂

$ 0.00
2 years ago

Hahah thanks for your good words, best wishes to you too. :)

$ 0.00
2 years ago

Your welcome, and Thanks for your wishes.

$ 0.00
2 years ago

If you did not explain it well sir, may I will limit only my knowledge on what probability is. Thanks for that.

$ 0.00
2 years ago

Nice game.

$ 0.00
2 years ago