View Single Post
  #28  
Old February 26th, 2004, 02:02 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

Quote:
Originally posted by Johan K:
quote:
Originally posted by Pocus:
I have often battle inconstancies message now, with solo play on windows platform.
Bah, can't you let me be happy for more than 1 hour and 13 minutes.
To Johan K:

I guess you have few more places when the comparison looks like
code:
  if (x + 2d6 < y + 2d6)

To eliminate this problem you could make the function:
code:
  int random_compare(int x, int y, int nx, int ny)
{
int x1 = x + nx*illwinter_dice();
int y1 = y + ny*illwinter_dice();
return (x1 - y1);
}

and use comparison
code:
  if (0 > random_compare(x,y,2,2))

Finding all the places where the dice function is used and replacing it with the new comparison is not difficult, but the problem is that if you make a small cut-and-paste mistake somewhere, how do you find it?

I can think only about one method to ensure that everything is changed correctly. If you can save battle progress status on disk after every round, you can make "etalon" saves on the current Version and rerun the test on a modified Version, comparing battle status after every turn. If there's a difference you'd be able to go through debugger to find out where it comes from. (In the example I've given you'd have to run on Linux, so that the original evaluation order matches the one implemented in a new function). The drawback is that some obscure conditions may not get tested at all.

Alternative method is to write a program which will automatically do conVersion

Either way it doesn't look like an easy fix :-(
But I still hope that you don't have that many places where dice function is called more than once in the expression, so that those can be examined manually
Reply With Quote