Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | DigNZ |
I’m working on a game that uses 2D physics - think ‘throwing’ an object. Input is just at the beginning as you throw the object, then the physics play out and you get a result / score.
The game is single player however the scores are recorded and there is a prize element. I need to be able to verify scores ‘independently’ to what the client is reporting.
My thoughts are to capture the touch or mouse input and send that to a headless server that also runs through the game play and verifies that the same result as the client. The reason for this approach is that the server can be ‘queued’ scores can be provisionally added and then verified by the server in due course, there is also an auditable record of how the scores were achieved. For legal reasons there cannot be a chance or random element to this game so this reproducibility also satisfies that requirement.
My question: Is the physics simulation consistent enough that this approach would produce the same results on different machines with the same input? Are there any problems with this approach?
Running some experiments on this seems to show that the same platform (OS) returns the same results to the level that I need, however it is not the same across platforms I assume due to handling floating points numbers.
Example, multiple different 64 bit windows 10 machines are producing the same result on either Windows .exe file or HTML5 export in any browser.
Headless Linux server and HTML5 running on Linux produces the same results but those results are different to the windows builds.
Not compatible enough for the verification method I was looking for. maybe fixed point maths could do this but I think I’m heading down a rabbit hole doing that.
BUT it does seems to be reproducible enough that running the same inputs on the same architecture can be used to verify / replay results. I just need to sychronised that common server platform with the clients.
Unless there is another approach I’ll run the simulation on the server so its always the same and use Zylann’s video for some client side approximation to make things smooth and responsive.
DigNZ | 2019-10-22 00:32