Replies: 5 comments
-
You can compile using |
Beta Was this translation helpful? Give feedback.
-
Hello Obg1. Thank you for asking your questions! As @ninnghazad said, you can use the CMake I suspect that by deterministic, you mean consistent numerical calculations across different hardware platforms. Is that what you mean? If so, given that Note that cross platform consistency of As for the performance of the current fixed point library implementation of Whether it would be better to use lookup tables for the trig functions for these fixed point types is unknown to me. I suspect that lookup tables are generally less of a performance win with newer hardware than they used to be. Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
First, thanks for the quick response. By determinism I want to get the exact simulation results, no matter the platform. Here's the repo for reference: They use a nice fixed point math with LUT for the trig functions. |
Beta Was this translation helpful? Give feedback.
-
do remember that in a case like that indeterminable behavior may arise from sources outside the physics engine - such as :
even for p2p you most probably want to be able to detect a desync and be able resync worldstate, at least in parts - no matter how deterministic your stuff is. as for LUTs... i also think probably not worth it - in my experience most stuff like this is memory-bound long before it becomes cpu-bound. that being said i think you can use PlayRho in that way - well i actually tried it - but in client/server setup. because in my case the simulations would not have the same bodies in the same order, so there was little benefit but nono high cpu costs. as a tip: if you go that way quantize player inputs before using them in any way - for example by converting them to fixed right away. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the confirmation about what you meant by determinism. Thanks also for providing the repo for reference. I took a quick look at the fixed point implementation you referenced. Found it very interesting to review! It appears to also have chosen to use 64-bit integers and 128-bit arithmetic. I'd love to see some in-depth bench-marking of it and comparisons against known correct data. Same with the implementation I'd whipped up. I'd guess that in a side by side comparison, the LUT approach would prove more accurate for direct entry hits but slower over bigger simulations than the non-LUT approach used in the fixed point implementation I did. At least by design that seems more likely to me. Incidentally, I'd love to see a well tested/verified fixed point implementation get tested out with PlayRho. As long as it supports Possibly the biggest speed impediment however to using fixed point math would be the need for using 64-bit integers and support for 128-bit arithmetic to provide enough fidelity and the memory throughput overhead that has over 32-bit floats. I've tried using 32-bit integers with 64-bit arithmetic and it has too limited fidelity to prove stable in general usage. Just switching from using |
Beta Was this translation helpful? Give feedback.
-
How can fixed point math be used?
Does the engine is fully deterministic when using it?
How is the performance of the fixed point math?
Will it better to use look up tables for the trig functions like sin, cos, etc?
Beta Was this translation helpful? Give feedback.
All reactions