digitalmars.D.learn - Making floating point deterministic cross diffrent platforms/hardware
- Chainingsolid (5/5) Nov 20 2016 I planning out a game that has to use a lock step, peer to peer
- ketmar (2/2) Nov 20 2016 write your own software fp library. this is the only way to cover
- Guillaume Piolat (12/17) Nov 20 2016 I think you can roughly have that with ldc, always using SSE and
- ketmar (3/5) Nov 20 2016 ARM. oops.
- Ilya Yaroshenko (2/7) Nov 20 2016 No problem with ARM + x86 for double and float.
- Chainingsolid (4/8) Nov 20 2016 I'm making an rts so the client/server model would require very
- Guillaume Piolat (2/4) Nov 20 2016 Indeed, peer to peer require determinism I guess.
I planning out a game that has to use a lock step, peer to peer networking model to achieve multiplayer, and thus I need to have any floating point used produce the exact same results, no matter what, aka be completely deterministic. What would I need to do to achieve this?
Nov 20 2016
write your own software fp library. this is the only way to cover all your broad cases.
Nov 20 2016
On Sunday, 20 November 2016 at 19:12:06 UTC, Chainingsolid wrote:I planning out a game that has to use a lock step, peer to peer networking model to achieve multiplayer, and thus I need to have any floating point used produce the exact same results, no matter what, aka be completely deterministic. What would I need to do to achieve this?I think you can roughly have that with ldc, always using SSE and the same rounding-mode. If you use the FPU then the excess precision will make things diverge. I've not compared the results across OSes but I get the exact same results across 32-bit and 64-bit. Another way for deterministic FP is to round to a lower precision, or used fixed-point/integers. If you use client prediction, and the server (authoritative) sends the correct player position to clients regularly (action game), then no determinism is actually needed. Ask Manu who knows more about this.
Nov 20 2016
On Sunday, 20 November 2016 at 21:31:09 UTC, Guillaume Piolat wrote:I think you can roughly have that with ldc, always using SSE and the same rounding-mode.ARM. oops.
Nov 20 2016
On Sunday, 20 November 2016 at 21:42:30 UTC, ketmar wrote:On Sunday, 20 November 2016 at 21:31:09 UTC, Guillaume Piolat wrote:No problem with ARM + x86 for double and float.I think you can roughly have that with ldc, always using SSE and the same rounding-mode.ARM. oops.
Nov 20 2016
On Sunday, 20 November 2016 at 21:31:09 UTC, Guillaume Piolat wrote:If you use client prediction, and the server (authoritative) sends the correct player position to clients regularly (action game), then no determinism is actually needed. Ask Manu who knows more about this.I'm making an rts so the client/server model would require very unrealistic bandwidth, hence the lock step peer to peer system.
Nov 20 2016
On Sunday, 20 November 2016 at 22:36:12 UTC, Chainingsolid wrote:I'm making an rts so the client/server model would require very unrealistic bandwidth, hence the lock step peer to peer system.Indeed, peer to peer require determinism I guess.
Nov 20 2016