Re: LuaJIT and Floating Point Determinism

  • From: Dan Eloff <dan.eloff@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 24 Jan 2014 10:25:00 -0500

Keeping in mind that I've never done this and I may be speaking out of my
arse here.

What if you used software decimal floating point or fixed decimal (i.e.
integer based) math for all game state that must be completely in sync.

For graphics state and other state that can tolerate discrepancies among
machines, you can use floating point. You may have to do some tolerance
checks on parts of it to prevent cheating.

I don't know how viable that is in reality, but it seems like it could work
for some types of games. Fixed point (e.g. 32 bits to either side of the
decimal point) is fast enough that you could replace floating point
completely, and the precision is generally better than 32bit floats. You
only have to convert to float when you send it to the GPU (and sometimes
not even then.)

Anyway, jut trying to give you more options.

Other related posts: