Math and Probability in Games

Slenn

Cosplaying Nuclear Physicist
Nov 19, 2009
15,782
0
0
Have you ever dived into the math in the games that you play to solve a problem? Or payed attention to the probability mechanics? I've actually gotten intrigued by some of the math that's behind some of the simplest of games, at least rule wise.

For instance, consider the mini-game Voltorb Flip in Pokémon HGSS. It's played on a 5x5 grid with 25 cards, 1 on each grid space. Each card has a value of 0 to 3 points that is unknown until you flip the card over. Your score is found by multiplying the numbers found on the cards you've flipped over. If you find a 0 (Voltorb) card, it's game over.

To the right and to the bottom of the field it has the total number of points along with the number of Voltorbs in that row or column respectively.

There have been a number of strategies listed online, and some of them I was already aware of. But then I got to thinking: "Is there one unique solution for each unique set of parameters? That is for a given set of points and Voltorbs for each column and row, is there a unique arrangement of cards that meets those 20 numbers (# of points and Voltorbs)?" A lot of people online had claimed that there was still some luck involved in the game. But if luck is still involved in playing the game, then that must mean that there's more than one solution to the 20 numbers.

So I did a test run on one set:

|___________________|4/2
|___________________|6/1
|___________________|6/0
|___________________|5/1
|___________________|3/2
|7/0, 5/1, 5/1, 2/3, 5/1

Where P/V stands for Total Points/Voltorbs. Running through the possible arrangements of points (and a few assumptions on the middle row) I came up with this solution:

|_1___0___0___1___2_|4/2
|_2___2___1___0___1_|6/1
|_1___1___2___1___1_|6/0
|_2___1___1___0___1_|5/1
|_1___1___1___0___0_|3/2
|7/0, 5/1, 5/1, 2/3, 5/1

But the game had a slightly different solution:

|_2___0___1___1___0_|4/2
|_2___2___1___0___1_|6/1
|_1___1___2___1___1_|6/0
|_1___1___1___0___2_|5/1
|_1___1___0___0___1_|3/2
|7/0, 5/1, 5/1, 2/3, 5/1

Yet, the numbers check out! But it shows that you cannot assume there is a unique solution to a
set of parameters in this game. In fact there's probably a whole lot more if you notice that 7/0 in a row or column can be achieved by not just an arrangement of 1 1 1 2 and 2, but also 1 1 1 1 and 3. And 6/1 can be achieved by an arrangement of 0 1 1 2 and 2, as well as 0 1 1 1 and 3.

Still, I want that Porygon so bad. XD
EDIT. I actually took a look at the Voltorb Flip calculator that's the most popular through Google, and you could theoretically figure out all the possible arrangements for a given set of numbers. I would still say that there's a strategy to the game. Since you can still get a unique solution as long as you keep flipping over cards.

I've also done similar things with the card game Pitch.
 

Altorin

Jack of No Trades
May 16, 2008
6,976
0
0
I have an occasion dipped my hand into maths, but when I go that far, it's usually best to just step back and look at what I'm doing. Usually at that point, I'll just ignore whatever little thing is causing me to turn into a numberphile, and instead focus on how the application of that maths feels in terms of actual gameplay. If it feels good, I'll keep playing. If not, then it's not worth my time.
 

The Wykydtron

"Emotions are very important!"
Sep 23, 2010
5,458
0
0
The only maths related thing I can bother with in games is probability mechanics like Fire Emblem or XCOM. My maths is below the GCSE standard I think, I barely scraped through it then forgot everything. BRB calculators lol.

Even though I play League religiously, i'm never going to pick apart builds and compare precise numbers for optimal power. Fuck it, I can just take a look at what the pros are building and copy that.

That or shout at my one friend who *does* look at the numbers.

"OI! Shiv or Phantom Dancer on Jinx?"

"Depends on whether you want early game or la-"

"NOW!"

"Phantom Dancer"

"Was that so hard?"

"Fuck you"

I'm that guy who builds Sunfire Cape on Leona for "added Sun." Optimal build be damned, we need style points.
 

TrevHead

New member
Apr 10, 2011
1,458
0
0
Grabbing a calculator can be useful for working out optimal methods of play in highscore based games. This is especially true in modern shmups like Touhou and CAVE which have several scoring mechanisms in play which makes everything quite complex.

Most players can get away with watching replays and asking other players, but fully breaking down a games scoresysem to know which point item to go for at any given time and not leave and points on the table is a needed skill for serious scoreplayers.
 

shrekfan246

Not actually a Japanese pop star
May 26, 2011
6,374
0
0
World of Warcraft.

Especially with the last two expansions, there's been a constantly fluctuating ratio of how much a class or specialization will get out of any particular stat. And at some point, equipment you get from end-game dungeons reaches a level where you have to judge whether an extra 2% in one stat will off-set what you lose by dropping 1% in another. I've been burnt out on the game for most of last year ever since my guild fell apart, but there was a point before Mists of Pandaria where I was within the top 100 best-geared characters on my high-population realm, and I always had to count up what I would lose and gain per piece of equipment to decide whether I wanted to use something or not.
 

Grach

New member
Aug 31, 2012
339
0
0
I haven't actually used explicit math in games in general, other than basic trajectories and basic geometry to dodge projectiles.

What I have seen, though, is the algorithms for pokemon encounters and capture rate. I don't know if that's fucking awesome or just way too much.
 

Racecarlock

New member
Jul 10, 2010
2,497
0
0
I love physics based games. Whether it's crush the castle, demolition city, red faction guerilla, or many others out there, blowing up a building just never gets old.

Although I don't write numbers down when I play them. Rather, I estimate where the building will fall depending on where I place the charges or how the rope on the trebuchet is swinging. Is that still math?
 

Savagezion

New member
Mar 28, 2010
2,455
0
0
Yeah, I am bad about it sometimes but I agree that it can suck the fun right out of stuff. I played Anarchy online for years and you can do insane twinking on there if you are able to do the math. (and acquire the oddball gear you need) I also grew up playing old school civilization where math = total annihilation of the AI. Even in Civ 4 I spent time learning how to calculate the exact cost a new city would hit my treasury before founding it. It isn't hard to guesstimate in that game for me but sometimes I want to know for sure... and that math SUCKS! SO I usually guesstimate. I do tend to guesstimate a lot in my math in games nowadays as it usually isn't important in most games that you be 100% accurate. It used to be more important than it is today as games tend to focus on "all options offer the same strength advantage" along with wanting to simplify everything on top of it. Generally, now days math is looked at as a bad thing for games to have.
 

Smooth Operator

New member
Oct 5, 2010
8,162
0
0
Only for DPS and grind assurance (translates to: "after how many hours of this awful bullshit can I be sure to get X item").

In both cases me having to do that means your game is doing it real wrong, either you need a better statistic system or you should stop it with the fucking random drops you lazy dev pricks.
 

nuttshell

New member
Aug 11, 2013
201
0
0
I try to do some simple math now and then (years ago) but usually, I like to understand without the effort of doing the research. And more often then not, I lose myself in over-complicating the problem.

The Wykydtron said:
I'm that guy who builds Sunfire Cape on Leona for "added Sun."
That's addorable.
 

Imperioratorex Caprae

Henchgoat Emperor
May 15, 2010
5,499
0
0
I am one of the people that can do math very well if needed but my brain will go into vapor lock if I do too much of it in one sitting. Having recently read about Zero Stroke I wonder if I have a similar disorder. I have a tendency to, when doing math for a long period of time, be unable to stop until my brain seems to shut down and I'm not conscious of time passing for a while. All I can tell you of what happens in that space is traveling through a sea of numbers, sometimes in chaos and sometimes ordered in three dimensional shapes in what seems to be perfect symmetry. Its kinda freaky and I will eventually snap back into "normal" awareness drenched in sweat and sometimes having filled pages with meaningless ciphers. By meaningless I mean I'm almost afraid to attempt to solve them and therefore just label it as such and toss the pages.
So math in games can scare the fuck out of me because I don't wanna lose it. And yeah I have talked to doctors about this and nothing's been resolved so I just avoid the triggers as best as I can.
One doc tentatively said I'm of two minds, a "creative analytic" person and it might be the opposite natures conflict and cause a shutdown. I am a strange person, much like the rest of the world.
I may one day keep one of those ciphers though if I can ever get over the creepy feeling that fugue state gives me.
 

Slenn

Cosplaying Nuclear Physicist
Nov 19, 2009
15,782
0
0
Grach said:
What I have seen, though, is the algorithms for pokemon encounters and capture rate. I don't know if that's fucking awesome or just way too much.
I wouldn't say that's too much. If anything, it's quite handy if you want to figure out what's the straight up catch rate of Ho-Oh for instance. Asking whether or not the Heavy Ball is going to be of use is a legitimate question, because its multiplier completely depends on the weight class and the weight of the pokemon.
 

DasDestroyer

New member
Apr 3, 2010
1,330
0
0
I love doing maths in games, I used to do a ton while play FTB, which is a Minecraft modpack that allows you to make huge factories, and calculating how much stuff is produced in one machine and how much is inputted into another helps optimize everything.
Lately I've only been playing Dota 2 though, and there isn't much math to do, or time to do it, but I recently randomed Skywrath and got countered with Pugna, so I made sure I had enough hp from items to survive a nether ward blast from my ult and got blademail to one-shot Pugna every time he put his ward down.
Captcha: you the man!
Thanks, captcha, I know. :D
 

Batou667

New member
Oct 5, 2011
2,238
0
0
I play a fair bit of Catan and Poker (both XBL versions) and like most traditional dice/card games, being able to at least estimate the odds gives a big advantage.
 

Hero of Lime

Staaay Fresh!
Jun 3, 2013
3,114
0
41
Pokemon is a good example of probability and math usage in games. I haven't really used math to figure out catch rates and accuracy, breeding etc. It is cool that you can figure out that kind of stuff considering there are so many variables that go into the simple act of catching a Pokemon.
 

Lawnmooer

New member
Apr 15, 2009
826
0
0
Most MMO's I use math in a fair amount.

For everything except WoW, I use math to figure out the best rotations, builds and gear usage for different situations. Especially since there's not usually Damage Meters in those games.

Heck, I have reams of notepad paper trying to optimize my build and DPS rotations in Rift and for Guild Wars 2 there's a large quantity of post from me on the forums when I was doing the math of different rotations in builds (Mostly, trying to show that Thieves would not be 1 shotting you all the time to try and limit the QQ NERF THIEF spam in vain. But I also did a lot of math concerning Condition builds on Thief and also various Necromancer builds and rotations. I also remember my P/P Power Engineer build I made, which while using what was typically seen as condition weapons and a underpowered class I actually did very good DPS with, rivaling other classes (Not Rifle Warrior levels, but still pretty good))

In WoW, because I use a damage meter and simcraft I don't need to do the math on my best rotation or stat weights and because of AskMrRobot I don't even have to do the math on reforging my gear (I just have to add my stat weights to the site and it will automatically do it for me)

But I do math out how much DPS is required for my raids to take out certain bosses (I average it out to give something to aim for, while there will be people far over the average and people far under the average)
 

Coakle

New member
Nov 21, 2013
219
0
0
Link between Worlds. Fortune's Choice

There is a game where you pick 3 chests out of 15.

You have to pay 200 rupees to play.

On average how many rupees would I earn every round?

amount - item - value
3-Green - 1
3-Red - 20
3-Silver - 100
3-Gold - 200
3 -null- 0

Average value of a chest is (0 + 1 + 20 + 100 + 200)*0.2 = 64.2 rupees.

3 chests would be, on average, 192.6 rupees.

Link should lose 7.4 rupees every round.

This is somehow not the case. So I started tracking the chest positioning, by hand. It took around 10,000 rupees, but I came to the conclusion that boxes in [0,2], [1,1] and [1,3] tended to have more silver and gold rupees. Opening all the chests in column one would have also netted a net profit.


This analysis isn't great, since the program might take the chests you chose previously into account.


I've also used Excel to figure out when my character will hit a power spike, based on the builds, last hits per minute and gp items in League. It has allowed me to try out more unorthodox builds.