
Mario Party N64 dice is predetermined - apolymath
http://www.markentingh.com/#home/entry+mario-party-n64-dice-is-predetermined
======
mindstab
Not necessarily. If it simply sets the random seed once as the program starts,
then saving the state of the game, and reloading it repeatedly will give the
same result from rand(), because the seed hasn't changed and you are
rewinding/repeating time.

If I flip a coin in a deterministic universe, it's still "random" (air flow,
force exerted, etc), but if I "rewind time" and play it back, I'd get the same
result.

~~~
LukeShu
You missed the point. Part of the game is that you thought you could control
the number with your timing of exactly when you hit the button (it shows the
"die" spinning above your head, you hit a button to jump and hit the die, at
which point it stops spinning).

~~~
ahassan
Yeah but why should that matter? If you hit it at a random time and it should
be random, then why does it matter if the random number is generated at that
instant or before? It's all still random in the user's eyes.

~~~
LukeShu
Because it's not random in the user's eyes. We thought the number was totally
based on our input; we would try so very hard to perfect our timing to get the
numbers that we wanted.

~~~
peeters
The author is not the intended user; he is using an emulator. The dice roll
seems random to the intended user's eyes.

~~~
LukeShu
So? He was the intended user when a younger version of himself played it on
the actual console. Many players thought that their timing alone controlled
the value. The author has simply used an emulator to show that that is false.

------
minimaxir
As long as the dice roll is a) statistically fair with equal odds for each
possible outcome and b) cannot be determined by the player in advance, it
doesn't matter _when_ the dice value is computed. That way, the value can be
computed in the background, and there isn't any lag when the player hits the
die.

Admittingly, since it is Mario Party, the dice definitely aren't fair.

Coincidently, for many Nintendo games, there's usually a way to control
randomness by deliberately seeding the RNG in a certain way. (Pokemon in
particular has many RNG/memory manipulation tricks).

One my favorite RPGs, Golden Sun, has an RNG flaw that if you perform an exact
sequence of attacks in a certain order, you will ALWAYS get a rare item drop.

[http://minimaxir.com/2013/05/guaranteed-to-be-
random/](http://minimaxir.com/2013/05/guaranteed-to-be-random/)

------
gonnakillme
If you all aren't familiar with Mario Party, here's what they're talking
about: for a number of applications like turn order and movement distance, a
Mario-style block that looks like a rolling die appears over your character's
head. When you jump and hit the block, it settles on a single number.
Apparently, you get the same number regardless of how long you wait to jump.
The issue here isn't that the PRNG is reseeded or anything, it's that the
appearance of player autonomy is an illusion.

------
hartror
I am mildly worried by someone who is obviously an experienced and competent
coder not understanding how pseudorandom number generators work. As they have
an initial state which is often determined at program or level load time
saving the state of the game means the state of the srand[1] or the 64's
equivalent is stored.

[1]
[http://www.cplusplus.com/reference/cstdlib/srand/](http://www.cplusplus.com/reference/cstdlib/srand/)

~~~
LukeShu
You have missed the point. The point was that it is calculated by an algorithm
(presumably a RNG), not by the user. Part of the game is that you thought you
could affect the value by timing when you hit jump.

~~~
oddshocks
I never thought I could affect the timing. I assumed that it was just an
animation.

~~~
minimaxir
I believe that was fixed in later Mario Party games: the animation was changed
to move so quick that the player has no reason to assume they could affect the
outcome.

------
hannibalhorn
Maybe they save the PRNG seed specifically to prevent this particular form of
"cheating" (loading a saved game continuously trying to get a difference
result?) It's better than the "you can only restore from the beginning of the
level" alternative, anyway.

~~~
ahassan
More likely they just created a RNG with a seed at the beginning of the game
and then use the generated set later on so that the N64 doesn't have to waste
resources (albeit a small amount) generating a random number mid-game. I
imagine every little bit of CPU power saved adds up with the N64.

~~~
joezydeco
Perhaps the game is even preloading and decompressing resources for the move
ahead since it know what the outcome will be?

------
jcromartie
I see a couple of misunderstandings in the comments here.

First: the PRNG state is not stored in the game's save file. It's in a "save
state", which is an emulation term for an image of the system's RAM etc.,
which is a far cry from how the games work on a physical console.

That leads to my next point: if you're seeding the PRNG with the current time
_every_ time you need a random number, then you're doing it wrong.

~~~
SeanLuke
Agreed. This seems to me to be all very simple: Nintendo is using a
straightforward pseudorandom number generator. At time t, it has an internal
seed. If the guy saves the emulator state then, of course that seed is saved
along with everything else. When he restores it, it's still that seed -- why
would he expect _anything else_?

Nintendo did this because it's the correct behavior if you want the die to be
statistically random in normal play, that is, not hacked up for cheating in a
non-Nintendo game emulator. So what this guy is really complaining about is
that he cannot influence or bias the roll of the die by hitting the die when
it's displaying a certain number on-screen. He somehow thinks this is
"determinism".

------
adrianpike
It seems more likely to me that they just run the PRNG before the spinning
block animation begins, no? Or maybe time isn't a factor in their seed, just
game state?

~~~
ChuckMcM
This was my guess, that the 'roll' occured earlier in the sequence and by the
time the dice showed up it was set in stone.

There was a very interesting hack in World of Warcraft where the server would
not show you the stats on an item unless there was one currently "on" the
server, and after a server reboot (every tuesday!) if you were one of the
first guilds on, you could step into an dungeon instance and check stats on
the rare loot you wanted (warglaives were the big deal as I recall) and if you
didn't see it, the boss hadn't spawned with them. So you step out, reset your
view of instances and step back in, check, rinse and repeat until they show
up. Then you go through and collect your prize at the end. Blizzard patched
the loophole once it was discovered but for me the interesting thing was that
the loot spawned right at instance creation time, not the time the boss
'died'.

~~~
dangrossman
I imagine that was for the benefit of GMs (in-game customer support).
Occasionally they'd be responsible for spawning loot for guilds who had just
spent some hours fighting to and killing a boss, only to have the server crash
afterwards and wipe out their rewards. By making the loot table a property of
the instance, and attaching the last instance a player was part of to their
character, the GM can just do a lookup to see what items were missing after
the server reboot and hand them out. The only thing they have to take the
players' word for is that the kill happened, rather than whether or not some
ultra-rare reward was part of the missing loot.

------
tuxdev
Most games shape their random events because true random is actually really
frustrating to play.. but what it appears to me here is that there's a PRNG
here that was seeded before he save-stated.. and since he didn't do anything
that called the PRNG before that head-butt, the number didn't changed.

This sort of behavior is famous in Fire Emblem.. but there's also a trick due
to how some of the games do pathfinding. Some of the games, if the game can't
decide which path to take, calls the PRNG to decide. Since you've induced a
call to the PRNG, you can redo a specific battle with a different random
number generation.

------
colanderman
Is this one of those newfangled "everything is JS" sites? Because all I get is
a "RENNDER" splash screen, after which everything is blank.

Too bad there's not a simple protocol to transfer hypertext across the
Internet.

~~~
apolymath
could you tell me what web browser & version you were using when this bug
happened? sorry this happened, the platform I am developing is still in beta.

~~~
colanderman
This is Opera 12.02. I didn't mention it because it's mostly not relevant
(Opera ditching their rendering engine and all). The issue is that the site
seems to rely on JavaScript to render anything _at all_. At least throw the
body in a noscript tag or something.

------
PetrolMan
If you were playing on a console, the fact that the number is chosen ahead of
time wouldn't make a difference. The only way you can be disappointed by this
predetermination is if you are trying to game the system with an emulator.
This doesn't seem like some cardinal sin to me considering you'd never know if
you played the game the way the game was meant to be played.

------
bcoates
One thing a lot of the posters here complaining about "that's not how PRNGs
work!" are missing is that for many traditional NES games, that _is_ how PRNGs
work: the game is entirely deterministic and based exclusively on user input,
to the extent that exact timings of button presses can be used on real
hardware to manipulate luck and get the result you want.

The sub-sub-genre of luck manipulating tool assisted speedruns are all about
this, for example:
[http://tasvideos.org/1596M.html](http://tasvideos.org/1596M.html)

------
mattbee
This article is pretty dim, for all the reasons people said. But also - the
guy is trying to rewind time on a dice roll. And Nintendo is the one cheating
_him_?

------
avar
I assumed game developers did this for pretty much everything that requires
randomness if for no other reason than ease of debugging.

I've written similar non-game code where you generate a random seed and every
other random value is derived from that. Makes it much easier to reproduce
"random" issues because you just need the build + the seed, not luck.

------
nextlevelstuff
I think the author is missing the point. The point of games is to be fun. And
games are made through constant iteration. I'm sure they had the completely
random number going and then someone said hey, these poor kids never roll the
right numbers, or don't roll them enough, lets make their odds a bit better.

------
trent09
Wow this is a little disappointing to me. I always thought I was affecting the
die by timing my jump (so did all my friends). I understand it's random, but
wouldn't a more accurate animation be of a motionless die until you hit it?
Then all players would know their jump has no affect on the number rolled.

------
FuzzyDunlop
Considering that Mario Kart has the rubber-banding effect to give less skilled
players a chance, it doesn't seem unreasonable to assume that all their other
multiplayer games have similar mechanisms to make the game fair for everyone.

------
agumonkey
Reminds me of something I witnessed using emulators, you could save the game
state at any time, and whatever your actions, the computer would score the
same sequence of shoots and/or goals (it was NBA JAM).

------
apolymath
See, this is a very important topic for me because as a child, I'd sit there
and watch the dice and look for patterns and try to get the number I wanted by
some kind of luck and timing, heh.

------
rpicard
I just played this game two nights ago, and somebody mentioned that it was
predetermined. I instantly started thinking of how to figure out if that was
true or not. Thanks to the author!

~~~
apolymath
you're welcome. Great minds think alike ;)

------
opinali
Oh noes, the NSA has sabotaged Mario Party's PRNG!!

(sorry, couldn't resist)

------
BlakePetersen
This falls under the same 'PvP' randomness of Mario Kart 64 giving 8th place
lightning bolts and stars. These games leverage perceived randomness as an
equalizer.

------
aaron695
I was also pretty miffed to learn in Dune II the enemy could cheat and see
outside the fog.

But until I learned that it was a lot of fun, the AI possibly would have
sucked without the cheat.

------
dpcan
It's probably just the way it generates the random seed.

Edit: Oops, posted before reading other posts - this appears to be the general
sentiment.

------
Narkov
Obligatory xkcd comic:

[http://xkcd.com/221/](http://xkcd.com/221/)

Strangely familiar as well!

