.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 2: The Ascension Wars (http://forum.shrapnelgames.com/forumdisplay.php?f=55)
-   -   Replay bug- again ! (http://forum.shrapnelgames.com/showthread.php?t=24132)

Oversway June 10th, 2005 01:45 PM

Re: Replay bug- again !
 

For size, I don't think the battles store every event - like every unit movement/death/etc. They just store the initial state and random number seeds, and then the algorithm is such that every battle with those conditions should turn out the same. But if the conditions are somehow different (like intial version number), or due to compiler/os/etc. issues where the state gets off, then each battle could wind up widly different.

Thats because they are cycling through a big, big list of random numbers... but if you have 1 more or less attack in one version of the battle, that throws off the entire cycle.

btw All the above is an educated guess.

Johan K June 10th, 2005 06:23 PM

Re: Replay bug- again !
 
Yup, that's how it works Oversway.

Graeme Dice June 10th, 2005 11:33 PM

Re: Replay bug- again !
 
Quote:

Zooko said:
No offense, Johan K, but if your C code runs differently on different systems, then there must be a bug in your code, such as reading uninitialized memory, making unportable assumptions about the size of an integer, etc. It is traditional for C code to have lots of these bugs.

The classic replay bug was caused by this code:
(get_a_random_number() < get_a_random_number())
which is not evaluated in the same order by every compiler.


All times are GMT -4. The time now is 02:50 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.