.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

Reply
 
Thread Tools Display Modes
  #1  
Old January 12th, 2004, 06:52 PM

talos talos is offline
Private
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
talos is on a distinguished road
Default Re: Incompatible battle replays across OSes

Quote:
Originally posted by Johan K:
The battles use sinus (sinf()) calculations and those might just be bad if those calculations should be significantly differnt on different machines. Definitely worth some thought...
If you are using gcc, the trig functions should all be implemented to the IEEE standard, which is to say that they should produce the same results across platforms.

This is not true if you use other C compilers, or if you use -ffast-math with gcc, as this allows the compiler to use the hardware trig functions, which in may cases (intel for one) do _not_ quite meet the ieee spec. Of course --ffast-math speeds gcc up quite a bit, as it avoids software Versions of trig functions (maybe sqrt as well?).

Of course, such differences should be tiny, so they should only affect actual results with miniscule probability (like one in a few hundred thousand).
__________________
Talos
Reply With Quote
  #2  
Old January 12th, 2004, 06:58 PM

Karacan Karacan is offline
Sergeant
 
Join Date: Nov 2003
Location: Berlin
Posts: 300
Thanks: 0
Thanked 0 Times in 0 Posts
Karacan is on a distinguished road
Default Re: Incompatible battle replays across OSes

For me (a windoze user), a game running on a linux server results in about approximately every eight to tenth battle being completely different in outcome - the others look vaguely correct (including the numbers of creatures fled into neighboring provinces, etc).

Annoying, but then again, it's time for me by now to stop watching every battle replay and just go for the numbers...
__________________
Shut your mouth, it could open your mind! - from Skyclad's On With Their Heads!
Reply With Quote
  #3  
Old January 12th, 2004, 08:53 PM
PhilD's Avatar

PhilD PhilD is offline
First Lieutenant
 
Join Date: Sep 2003
Location: Bordeaux, France
Posts: 794
Thanks: 0
Thanked 0 Times in 0 Posts
PhilD is on a distinguished road
Default Re: Incompatible battle replays across OSes

Quote:
Originally posted by Johan K:
The random number generation itself should be foolproof. Only table lookups and some xor. Unfortunatelly the random number generation is only 0.0001% of what might go wrong, so your idea might still have some merit. The battles use sinus (sinf()) calculations and those might just be bad if those calculations should be significantly differnt on different machines. Definitely worth some thought...
If you give me an email address, I'll send you my latest turn file, where under Linux, my Arcoscephale army gets eaten alive by Hoburg-backed Abysian Infantry, whereas under Windows, the very same Abysian Infantry routed pretty quickly (and the naked Hoburg Crossbows were no match for Arcoscephale's armies, even ineptly commanded by me).

There were a lot of things that could go wrong in this battle - some arrows and bolts, some trampling, some spells...

Also, bear in mind that any tiny different result, if it means "die rolls" are then scheduled differently, can mean the whole battle's outcome is different. One arrow landing in a different square, once, could mean one unit is now dead, or has a different number of hit points, or takes a morale check, so that the same dice rolls will be used for something different from now on. You cannot accept any variability in functions that are used during the battle replays.
Reply With Quote
  #4  
Old January 12th, 2004, 09:31 PM

PrinzMegaherz PrinzMegaherz is offline
Sergeant
 
Join Date: Dec 2003
Location: Würzbueg, Germany
Posts: 397
Thanks: 0
Thanked 0 Times in 0 Posts
PrinzMegaherz is on a distinguished road
Default Re: Incompatible battle replays across OSes

I might add that I encountered this problem today in single player.

The review showed me a clear victory without any losses, the summary sais one of my commanders died.
And I'm very sure he is alive at the end of the replay

I'm using XP.
Reply With Quote
  #5  
Old January 13th, 2004, 04:12 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: Incompatible battle replays across OSes

I've seen this problem many times in MP game I play now and I'd like you to consider the possibility that it's not just the replay being incompatible between the platforms.

In one battle I had won with only 2 mercs left (of some weak variety). Usually these mercs rout way before they all get killed, so I can't realy imagine a scenario in which it would it be possible to win with only 2 of them remaining (opposition consisted of some indy forces). Of course, in Dominions it's impossible to foresee everything and there may be some explanation I'm missing. Replay was showing my mercs retreating pretty quickly after losing few comrades. And I had few other battles with weird results. Everytime, development in the replay looks quite logical and probable, but battle report sometimes produce results which I couldn't interprete at all (meaning that I couldn't imagine how the battle would have to be going to produce such results - as in that example with 2 mercs left).

From my cross-platform programming experience I would have considered that maybe some variable is left uninitialized and on different OS/compilers it gets initiaized differently which produces consistently wrong results in the case of one OS (or different wrong results in different OS). This could explain strange results due to altered battle mechanics.
Reply With Quote
  #6  
Old January 13th, 2004, 04:40 AM

SurvivalistMerc SurvivalistMerc is offline
Second Lieutenant
 
Join Date: Nov 2003
Posts: 419
Thanks: 0
Thanked 0 Times in 0 Posts
SurvivalistMerc is on a distinguished road
Default Re: Incompatible battle replays across OSes

I actually have a scenario in which I could have won that. My serpent dancers all radiate powerful fear, and I had a good number of them in the battle. You by contrast had no priests. I had those cute little poison slingers. And my sauromancers were casting terror.

If your longbowmen were terrorized.... All I mean to say is that the outcome we got was possible. Not likely but possible. I lost a number of high defense serpent dancers there by the way. Not that they are equal to your giants.
Reply With Quote
  #7  
Old January 14th, 2004, 02:24 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: Incompatible battle replays across OSes

Another wild thought here. If you recompile Dom2 with different byte alignment and try to compare if the battle replay goes the same way in the old executable and the new one (on the same machine). If they're not going identically, surely there must be some uninitialized variables or memory overruns.

/Alex
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


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


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