Randomness Experiment...?

pxpdoo

Ninja Burger Fry Cook
Joined
Jul 1, 2003
Messages
565
Location
Dictionopolis
It just occurred to me: How random is the game when mirrored to itself?

My specific thought is one I cannot personally test. The thought is, let's say you begin a game, let the computer generate everything, and then save it.
If you loaded that save (with Preserve Random Seed and No Barbs enabled) to a second computer (would need a second computer and Steam account, why I can't test it) and played both games side-by-side, making precisely the same unit movements, build orders, Policy / Faith decisions, exactly identical interactions with CSs' and Civs you meet, everything precisely identical, right down to spilling the same kind of soda on both keyboards...
How long would it be before the games made a different "decision" somewhere, thus making the heretofore identical games different? Like, a newly-met leader is Neutral instead of Cautious, or you meet the Iroquois first instead of the Celts, or whatever? Ten turns? Fifty? Never?

I should think that, given absolutely identical starts and decisions / actions on your part, the games would eventually diverge when anyone went to war. (No Barbs, remember.) But short of that, is the question.

Any thoughts?

P. S.: Replaying the identical same start on the same computer occurred to me too, but - especially if going for twenty or fifty or more turns - the chances of accidentally doing something different (and/or not noticing the game doing something different) are too high...
 
I would imagine that two games both played the same way would result in the same outcome. The same operations would be being carried out by the program in both cases. The only instance where this would not be the case is when a random number generator is used, for combat calculations, AI personality, etc. If the "no new random seed" option disables both (or whatever else RNG decides) then it will always be calculating the same equation.
 
From TSG Opening Actions and After Action threads it seems like the AIs are playing the same style in like 1/3 of the games. About 1/3 of the match reports sound exactly like my own game: for e.g. Japan and Germany would both attack me early while in another 1/3 of reports they'd stay friendly both for most part of the game and in the last third Japan would be captured by the Mongols, who by themself, didn't attack Japan in the other 66% of the games. Instead in 1/3rd they were very aggressive towards City-States and in the rest of the games they weren't very aggressive military wise but expanding very much and quickly.
It's pretty safe to say, that each third player does exactly the same moves in a game. They might settle in the same place, scout in the same direction etc, but 100% the same: never. Their AIs though will still play the same game (they of course will make slightly different moves too in the beginning already and even more so later when more differences arise but the games pretty much goes the same way.

So, dunno how that helps or if it doesn't at all. I guess you could say that not every different action is relevant to the grant scheme the AI will be following. The individual unit movement though has to be decided on the fly on every turn, obviously.
 
I'd love to see this experiment done.

This isn't the same thing you're talking about, but in one of the Deity Challenges, I was struck by how differently a two different *player's* games would play out based on small differences in their early choices. If you moved your starting warrior east on his first turn, you saw another resource (marble, I think) that your capital could claim if you moved your settler one space before founding the city. If you moved your starting warrior south, you didn't see that resource, didn't see any reason to move your settler, and founded in place. The area to the east was all tundra, so you wouldn't later found another city just to claim that marble. So based on a pretty insignificant difference on turn one, different players' total game was impacted. Some never got that marble.

This struck me because the supposed point in Deity Challenges is that each player is playing the same map, so strategies can be compared, etc. But starting with turn one, players are actually playing different games.

Back to your point, a side of me would like to believe that your two games would play out exactly the same through their entirety. What else governs AI behavior but its inflexible programming and the random number generator? If the seed ensures that the same numbers are always being generated, I would think the AI would do exactly the same thing in game after game.

I would think one could do an informal test, just by playing two or more games a little ways in, playing turn-by-turn exactly the same yourself. Does your scouting warrior encounter your neighbor civ's scout at exactly the same place on exactly the same turn each time?
 
Does the randomizer take time into account? If the function is based on seed + milliseconds, the two would go off the rails pretty quickly when a lot of randomness is involved. Not just in war, but there is a random factor involved in some AI decisions.
 
I'll be able to do side-by-side tests in two months, when I get a new gaming laptop. Will use brothers' desktop and Steam account as the mirror.
If anyone beats me to it, though, I wouldn't complain... :)
 
IMO the two games would differ very quickly, although it might take a while for the differences to become apparent to a human player.

I'm sure the game uses an RNG (random number generator) to determine in-game outcomes. For instance, if a unit has a 1 in 3 chance of winning a battle, virtual dice are rolled, a random number is generated, and the unit wins or loses. If a civ loses a pikeman in one game but doesn't lose it in the other, or beats another Civ to a goody hut, or succeeds in a CS coup, it might take a while for those small differences to accumulate into something noticeable, but I think they'll start to accumulate right away.

Really good RNGs don't even rely on a seed. They rely on externally generated entropy (e.g. sampling network traffic, mouse movements, keystrokes, etc.) to perturb their stream of random numbers, so a series of "dice rolls" using this kind of RNGs would produce different outcomes on different machines almost immediately.

Even a seeded RNG might not be guaranteed to return the same results on different hardware. You'd have to check the documentation for the programming language in question.

IMO, you can play each Civ game with confidence that it is a special snowflake that is yours and yours alone to experience. :)

http://en.wikipedia.org/wiki/Random...ue.22_random_numbers_vs._pseudorandom_numbers
 
Even a seeded RNG might not be guaranteed to return the same results on different hardware. You'd have to check the documentation for the programming language in question.

The RNG for Civ5 does definitely use a seed, though I'd be surprised if it didn't at least factor the millisecond place of the system clock into it, which means at least that no human player could be sure to play the same game twice, and likely no computer player either, due to minute differences in hardware.
 
Yes, if you mirror 2 games with the same seed they should get the exact same result.

AFAIK, pseudo-random number generators are always deterministic, which means that they will always produce the same results from the same starting seed.

People in this thread are confused by the use of the system clock : it's often used to generate the seed (the first random number), but it's not used to compute the next numbers.
 
Top Bottom