I am looking to create a multiplayer game in a browser using a rollback netcode that runs deterministic modeling on clients. I prototype netcode in Flash already before I came across a floating point bridgehead.
Basically, based on what I understand, the integer math in Flash is done by dropping intto Numbers, doing the math, and then returning to int. It is faster, but it means that there is no possibility of deterministic mathematics in different computer architectures.
Before I drop all the eggs in the JavaScript basket, I would like to ask a few questions.
Is there true integer arithmetic in all major browsers in JavaScript? Or do some browsers do a flash thing and throw in floats / doubles to do the math before returning to int?
Something like BigDecimalor BigNumwork for deterministic mathematics in different computer architectures? I do not mind the loss of performance as long as it is within reason. If not, is there a JavaScript fixed-point fix library that solves my problem?
It's a long shot, but is there an HTML5 2D game engine that has deterministic math for things like x / y positions and collisions? The list of game engines is at least staggering. I am embarrassed of creating a deterministic mechanism with cross-browser support from scratch, but that might be what I should be doing.
NOTE. Edited from HTML5 to JS according to the answers. I apologize for the lack of knowledge.
source
share