As the title implies, I could not figure out wether or not it is safe.
Example: Server creates float 0.0009991f and sends it to all clients, each clients reads the float and gets exactly 0.0009991f
I’m not sure if its just operations (sin, cos,…) on floats that can deliver different results on different cpus/os, or can even exchanged floats without any operation on them be manipulated somehow by the different cpu/os.
In my case, to be more specific, I do some multiplayer pre-game-setup calculations with floats strictly on the host/server and send them to each client to avoid non-deterministic results.
Kinda noob question, but I could not find a specific answer after doing hours of web research, as I am 99% sure it’s not a problem, but I want 100%!
When a value in source a is set from a value in source b, the value will be the exact same if no operations occur, otherwise floating point imprecision might occur.
If you work with a system where precision is super important it’s also useful to know what type to use to get a specific level of precision:
What part in that link would be useful for the OP? All I see is stuff he was aware of, that different pc configurations can calculate a different result. The question of the OP was if a value calculated on the server could be different on different clients, an option that is not discussed in the linked thread.
While it’s of course always nice if someone adds something to a discussion, it’s even nicer if it’s not just a link, but also the specific point in the source that adds something to a discussion.
OP seemed smart enough to be able to figure out that they can read the linked question and the selected answer. The implication in the answer there is that since the JIT has liberty to work differently on different platforms that your statement that “the value will be exactly the same” might not be so cut and dried.