c# different result on different cpu -


i wrote ai online mobile game in c#. have lots of computations ai players , getting different results on server (for validation of game result) , clients. guess it's because of different results of double variable in different cpu architectures. hence, i'm looking solution solve once , all. i've tried rounding of computations 4 digits , didn't work , since c# doesn't have bigdecimal (like java) , couldn't find implementation, can't use either. tried using decimal instead of double math functions cos , sin doesn't accept decimal.

in experience either rounding errors on float types, or because using random number generator relies on part of machines architecture.

if using math.random maybe have @ different psuedo-random number generator (or rolling own).

also ok momentarily update state of ai on client server i.e. use server source of truth. if update enough shouldn't apparent diversions happening.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -