http://bugs.winehq.org/show_bug.cgi?id=10229
--- Comment #27 from Tobias Jakobi liquid.acid@gmx.net 2008-07-11 06:19:02 --- Hi there, I asked Ryan C. Gordon from icculus.org about the problem (since he ported SS to linux) and post the discussion here:
------------------------------
Ryan responded to some other user asking:
Is there a chance you guys fixed the bug between Windows + linux users in Serious Sam: The First Encounter, Network gameplay?
No, it needed a patch to the Windows version to fix it (they rely on the checksum of floating point numbers matching, which vary between what code generated by Microsoft Visual C++ and gcc would calculate).
Sorry, --ryan.
------------------------------
I became curious and asked him about the details:
Hi Ryan,
I have a question concerning this. Could it be possible that not only GCC is a problem here but also some other linux components.
I mention this because of these two wine bugs: http://bugs.winehq.org/show_bug.cgi?id=7996 http://bugs.winehq.org/show_bug.cgi?id=10229
Both have to do with problems between SS clients connecting to each other from different operating systems (CRC errors). Games hosted by windows machines (like the VM I mention in the bugreports) enable windows cients to connect to it, but linux clients (running through wine) can't.
On the other hand when a linux user is hosting the server through wine the linux clients can connect, but not the windows clients. Maybe this is not only related to wine's network code emulating windows behaviour, but probably the problem lies deeper (since you mention floating point matching; recently a D3D bug was fixed that had to do with FP math: http://bugs.winehq.org/show_bug.cgi?id=13225 - this one came to my mind when I read your post).
I would really appreciate it if you could take a look at the bugreport (mine also contains wireshark logs).
Thanks, Tobias Jakobi
------------------------------
Ryan responded:
On the other hand when a linux user is hosting the server through wine the linux clients can connect, but not the windows clients. Maybe this is not only related to wine's network code emulating windows behaviour, but probably the problem lies deeper (since you mention floating point matching; recently a D3D bug was fixed that had to do with FP math: http://bugs.winehq.org/show_bug.cgi?id=13225 - this one came to my mind when I read your post).
Without research, I'd guess that Wine doesn't change the FPU precision (which DirectX does by default behind the scenes). But I could be wrong.
It was a terrible, inexcusable design decision on Microsoft's part, and has caused everyone trouble: Windows developers, Linux people, Wine people...
The Sacrifice bug report is possibly related, but it's hard to say. Precision issues are nasty.
As far as Serious Sam goes: basically, one machine adds two numbers and comes up with 0.385419, the other comes up with 0.385420, and it's fine for game play, but since it's not a perfect match, the game thinks you have incompatible data and refuses to connect. It's not an FPU precision setting, or a bug in gcc...if you shuffle around the order that the math instructions run, you'll get a different result, so even a Debug and Release build of the Windows version probably became incompatible with each other.
There was discussion of ways to fix this with Croteam, many years ago, but they were already done with Serious Engine 1 when we got to that point, and didn't want to patch the Windows client to fix it.
My guess is that Wine, vmware, the Linux port, and probably the official win32 binaries on some yet-unannounced version of Windows will all have this problem. It's not a bug in Wine, it's just a bug that never bit Croteam on Windows.
--ryan.
------------------------------
So this might not be a winsock problem after all...
Greets, Tobias