Page 1 of 1

A possible solution to discrepencies in combat replay in PBEM

Posted: Mon Aug 04, 2003 12:18 am
by AmiralLaurent
OK, I should have posted it in Bug reports. But it's not a bug, it's maybe a solution.

From time to time, people report that the combat replay their opponent sends them is different than what happens on this opponent computer.

I'm playing three PBEm right now and have never noticed this.

Last week, for the first time, I see a difference when ships sunk during the replay were not shown in the sunk list. Next turn, they were also diffferences.

I wonder what I have changed and I had just adjusted the AI difficulty to do some tests against AI, that I haven't played for months.

I changed the AI difficulty from Hard to Historical, replayed the faulty combat report... it was different both from my former replay and from the report sent by the IJN player.
I then changed to Very Hard. Excatly the same report as my IJN oppoent (with two P-39 attacks on barges giving exactly the same number of hits).

I try also for the former turn and it gives the same replay as my IJN opponent, also.

So it seems to me that AI difficulty setting (in v2.30) has influence on the combat replay. Not completly insane as it has influence on combat results in AI game, but here we speak of PBEM.

So if you have discrpencies, change your AI settings and retry. Or better set the same Ai difficuly as your opponent at the start of the game and don't touch it.

Laurent

Save availables (turn, combat saves, reports) if needed

Posted: Tue Aug 05, 2003 4:53 am
by Fred98
I had a case, in a PBEM game, where the replay and the combat report, both showed that a base fell during an infantry assault.

But, try and play the next turn and the base has not yet fallen.

When I play against the AI, I set the setting to "hard".

Posted: Tue Aug 05, 2003 1:04 pm
by AmiralLaurent
Combat save and report will always be the same if done on the same computer with same AI diificulty.

What I compare is the report send by my IJN opponent (created on his puter) and the report created on my puter after I replayed the combat save.

It was a great idea of my IJN opponent (DenisonH) to send this report file with the turn, so I can check any difference.

Posted: Wed Aug 06, 2003 6:26 pm
by Sonny
Surely Matrix has thought of this one, but I'll bring it up anyway -

Generate the random numbers when they are needed in the execution of the turn (is that after the Allied orders are finished?) and store them in the save file. Then for the replays just use them from the file where they are stored and you should get the same results. Even if you generate 1000 random numbers at 8 bytes each it is only an additional 8k added to the save file.:)

Posted: Wed Aug 06, 2003 10:02 pm
by BillBrown
Why go to all that trouble. Just store the 4-byte random number seed in the game file.

Posted: Wed Aug 06, 2003 10:22 pm
by Sonny
Originally posted by BillBrown
Why go to all that trouble. Just store the 4-byte random number seed in the game file.


I think that is the problem - they do store the random number seed and they seem to get random results instead of the same results.

Even the idea I mentioned would not work if, for example, the easy setting did not need a random number that the hard setting does i.e. does one fewer calculation with a random number. And from what has been posted above that may be the problem because the seed is the same but the results are different.:)

Posted: Thu Aug 07, 2003 7:53 pm
by denisonh
Originally posted by Sonny
I think that is the problem - they do store the random number seed and they seem to get random results instead of the same results.

Even the idea I mentioned would not work if, for example, the easy setting did not need a random number that the hard setting does i.e. does one fewer calculation with a random number. And from what has been posted above that may be the problem because the seed is the same but the results are different.:)


Sonny,

The seed should achieve the same results you prescribe.

One of the keys to generating "random" results is the generation of the seeds. That may be the problem in that the seeds are not the same, guarenteeing different results.

Same seed, same results (assuming the same random number generator is used and the proceeses using the random numbers are the same). Of course, as your pointed out, there may be an additional calculation, but think it is a seed problem.

There seems to be some difference in the seeds generated for the replay for the USN player than the IJN player in certain circumstances.

Posted: Thu Aug 07, 2003 10:42 pm
by Sonny
Originally posted by denisonh
.................

There seems to be some difference in the seeds generated for the replay for the USN player than the IJN player in certain circumstances.


IIRC they save the seed so the same seed is used for both replays. So the problem isn't there. I can't imagine the random number returned would be different using the same seed (do different model pcs have different ways of generating a random number?).

IMHO it is probably the difference in the number of calls based on the difficulty setting as the AmiralLaurent has suggested. In our game did you notice any differences in what was in the replay from what the results actually were? I didn't but then playing the Japanese I would not get any differences. And as far as I know I have not had that problem while playing the Allies (but hey, I'm not that observant).:D