Jump to content
  • Advertisement
Sign in to follow this  
Richy2k

Floating point determinism.

This topic is 3728 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I posted a while ago asking about this. I've had a hunt online and found something which a few others here may like - took me long enough, so I don't want to leave you all stuck like I almost was - went fixed point only to realise it was a bit of a fail in certain situations. Streflop seemed to be my solution. A friend of mine I'm working on the project with noticed it is used by TA Spring. (link missed as it seemed to miss half my post) Thats the solution to the problem we had - keeping all clients in game totally in sync - its an RTS so sending across every units position was not a good solution for us. Anyone else found any other neat solutions? [Edited by - Richy2k on June 30, 2008 7:58:47 AM]

Share this post


Link to post
Share on other sites
Advertisement
Are you talking about precision differences between different hardware platforms, specifically, different CPUs?

Share this post


Link to post
Share on other sites
He missed a quote in his post, this is the rest of his post:
Quote:
Streflop seemed to be my solution. A friend of mine I'm working on the project with noticed it is used by TA Spring.

Thats the solution to the problem we had - keeping all clients in game totally in sync - its an RTS so sending across every units position was not a good solution for us.

Anyone else found any other neat solutions?

Share this post


Link to post
Share on other sites
As long as you stick to a single compiler, and a single CPU instruction set, it is possible to make floating point fully deterministic. The specifics vary by platform (i e, different between x86, x64 and PPC).

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
As long as you stick to a single compiler, and a single CPU instruction set, it is possible to make floating point fully deterministic. The specifics vary by platform (i e, different between x86, x64 and PPC).


I've already tested this, and it isn't always the case. Same exe, different machines. My Athlon x2 matches my friends Core Duo 2 - but I considered myself lucky in that case. Had the same problem with networking at work too - was remoting another another machine with a different CPU to mine and getting different results with the same inputs. The differences were very tiny - but there.

I'd be interested to know which compiler settings to use to make it actually work though [smile] one less dependancy then!

Share this post


Link to post
Share on other sites
Quote:
Same exe, different machines.


That means it's a problem with the exe. You have to make sure that the internal precision is set to 64 bits (not 80, because only Intel implements that), and that the rounding mode is consistent. Furthermore, you have to check this after calls to external DLLs, because many DLLs (Direct3D, printer drivers, sound libraries, etc) will change the precision or rounding mode without setting it back.

Also, you can't use SSE or SSE2 for floating point, because it's too under-specified to be deterministic.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!