Quote:Original post by Washu Yes, I've mentioned this in my most recent journal posting, but if you were to have one of your clients using SSE instruction sets, and another using the FPU, you can easily obtain results that differ in the least significant digits. This is due to a difference in the size of the registers used to calculate the numbers (32 bit float is widened to 80 bit on FPU, while it remains at 32 in the XMM registers).
Since I'm a noob and have no idea how to do that, would that happen by itself? Or do I have to explicitly use SSE?
If you enable SIMD instruction sets, it can happen by itself. One common case where you might find this happening would be an optimized math library that changes its behavior based on the instruction sets available on the client PC.
I am using DirectX/C#. Would that happen by itself (I wouldn't be using any 3D math, this is a 2D game). Thanks a bunch for your insight.
Assuming you are using XNA/MDX, then no. It's 32 bit only and will use just the FPU. A more portable MDX library would allow for 64 bit and 32 bit executables, in that case you could encounter it since the .NET x64 platform does use SSE2 for the majority of its floating point operations.
In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
Quote:Original post by Daniel Miller If you need to keep two clients in sync without a central server, is fixed point the only option?
No. There's no problem with using floats, as long as you don't make assumptions that require them to be exactly perfect to X decimal places.
Does it matter if one client thinks an object is 0.0000003 metres to the left of where it actually is? If the answer to this question is "yes", then you should probably re-think your network design.
Quote:Original post by Daniel Miller If you need to keep two clients in sync without a central server, is fixed point the only option?
No. There's no problem with using floats, as long as you don't make assumptions that require them to be exactly perfect to X decimal places. Does it matter if one client thinks an object is 0.0000003 metres to the left of where it actually is?
Very much so, if that causes a shot to become out of range so a unit doesn't die. That unit might kill a third unit, which would have killed a fourth unit, etc. In a RTS, things could spiral out of hand quickly.
Quote:Original post by Daniel Miller If you need to keep two clients in sync without a central server, is fixed point the only option?
No. There's no problem with using floats, as long as you don't make assumptions that require them to be exactly perfect to X decimal places. Does it matter if one client thinks an object is 0.0000003 metres to the left of where it actually is?
Very much so, if that causes a shot to become out of range so a unit doesn't die. That unit might kill a third unit, which would have killed a fourth unit, etc. In a RTS, things could spiral out of hand quickly.
That should all be computed on the server, which would know the true values (since the server should be in charge of those values, not the client).
In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
I don't recall the most efficient way to code it, but that's the logic to it.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara