Randomness in Multiplayer Games

PC : Turn based WW2 goodness in the mold of Panzer General. This promises to be a true classic!

Moderators: Slitherine Core, Panzer Corps Moderators, Panzer Corps Design

Post Reply
sn0wball
2nd Lieutenant - Elite Panzer IVF/2
2nd Lieutenant - Elite Panzer IVF/2
Posts: 733
Joined: Sat Dec 08, 2012 8:22 am
Location: Germany

Randomness in Multiplayer Games

Post by sn0wball »

In a multiplayer game, the upload of my move failed. My turn reappeared and I had to play it all again. I wasn´t very happy about that, since my units had some good luck in combat. I was a bit surprised as combat turned out exactly the same. And, no, it wasn´t dice combat, since the results were diverging from the predictions. Was that a coincidence or is that effect intentional (which would make sense!) ? If the latter, how is that achieved ? I mean, what would have happened if I had chosen different combats ? Would I have had luck in the first combat, regardless of where I attack first or does that outcome only appear when I remake exactly that attack ?
the_iron_duke
Captain - Bf 110D
Captain - Bf 110D
Posts: 862
Joined: Tue Nov 01, 2011 1:45 pm

Re: Randomness in Multiplayer Games

Post by the_iron_duke »

I don't know but I'm guessing that if you repeated the combats in exactly the same order the results would be the same as the die-rolling may be pre-determined. I think I remember reading that that was the case with Field of Glory, anyway.

Regarding a multiplayer turn getting lost. As I've written elswehere, this is something Slitherine need to look at. I've played thousands of multiplayer turns of Field of Glory using the Slitherine server and have never had a turn getting lost during the transmission of the turn to the server, with the result that it needed to be replayed. I have even had my laptop overheat and put itself into standby mode mid-turn, so the internet connection was lost for 20 mins or so, yet when Windows opened again I was able to finish the turn and send it successfully without having to log in to the server again.

Panzer Corps multiplayer does have issues, though. There are three possible outcomes for attempting to send a multiplayer turn:

1. The turn gets sent successfully.
2. The turn wasn't successfully sent because connection couldn't be made to the server - but would you like to try again?
3. The turn wasn't successfully sent because connection couldn't be made to the server - your completed turn is lost and needs to be replayed.

With Field of Glory multiplayer only outcomes 1 and 2 are possible. With Panzer Corps multiplayer all three outcomes are possible. So I hope Slitherine can identify where the problem lies and fix it. Saying Field of Glory turns are smaller in file size is, I believe, a red herring - most of the time the PC MP turns are successfuly sent. At the very worst, there should be Outcome No. 2 (failed send with option of re-sending). I don't see any reason why Outcome No. 3 can't be eliminated altogether from Panzer Corps multiplayer.
Last edited by the_iron_duke on Thu Dec 19, 2013 5:48 pm, edited 1 time in total.
Molve
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 538
Joined: Wed Jul 27, 2011 10:06 am

Re: Randomness in Multiplayer Games

Post by Molve »

Obviously I don't know the ins and outs of Panzer Corps programming, but it is generally instructive to know that computers are actually pretty bad at generating random numbers: most programs rely on what is known as pseudo-random numbers, a sequence of which is generated from a seed number.

If you simply look at a string of pseudo-random numbers, they will for all intents and purposes appear as truly random.

However, unlike real random numbers, they are, as I said above, generated from a seed number, meaning that a given seed always returns the exact same sequence of pseudo-random numbers.

---

Once you realize the above nature of (most) "random" numbers used by computer applications, it's not so hard to explain how PC can achieve what you are experiencing (or indeed that any computer game will exhibit this same behavior as long as it allows you control which random number is used where; in an action game you can't move your joystick left at the exact same millisecond each time, and so you won't generally notice repeated "die roll" results in this way):

Simply by storing the seed number into any save file (along with all the other game data) then, as long as you perform your unit combats in exactly the same order, the exact same "random" numbers will be used for each battle - without any extra programming required from the developers.

You can actually test this yourself. Load up that game and begin by moving a completely different unit into battle (say, drive a recon right into the jaws of an invisible enemy tank). This will then "use up" the first "random" number* in the sequence, meaning that the result from your second battle will now be used for your first intended battle.

This means that if you, as you say, recollect that you were generally lucky, but, say, battle #4 was a dud (=less lucky; an armor failing to obliterate enemy infantry caught in the open, say), you should now find, for instance, that your third, risky, battle goes from an unexpected success into a total disaster.


*) Just an example to show that the sequence is fixed for each time you start with a given seed. In reality Panzer Corps uses several "dice rolls" for each battle; so when I talk about battle #4 above, I really mean "the fourth batch of numbers" and not a single individual number.
ThvN
Panzer Corps Moderator
Panzer Corps Moderator
Posts: 1408
Joined: Fri Jul 06, 2012 8:55 pm

Re: Randomness in Multiplayer Games

Post by ThvN »

Nice explanation. Here is a funny fact about PzC: start a scenario, and make a few moves and combats. Then, open the menu and select 'Restart Scenario'. If you make all moves/combats in the same order, the rolls and results will be identical. This doesn't happen when saving and reloading, only with 'restart scenario'. So I'm guessing the random seed is not changed in that case.

I'm starting to think this 'restart scenario' repeat of the rolls is what happens when you have to replay a multiplayer turn?
Post Reply

Return to “Panzer Corps”