News for hackers. Stuff that matters.
Re:MelonJS – a fresh and lightweight JavaScript game engine by wesz on Tuesday December 20, 2022 @09:04AM (#34066003)
I'm assuming you're talking about lockstep/rollback network model, since it should not be an issue for client-server with proper client prediction/interpolation.

The biggest source of these inconsistencies is Math.sqrt(). You need to implement deterministic version of sqrt() and that should fix 99% of your issues. Hit me up if you need some additional pointers.

Re:MelonJS – a fresh and lightweight JavaScript game engine by Mizza on Tuesday December 20, 2022 @09:42AM (#34066518)
This sounds extremely relevant to my issues, as floating point issues between different clients and the server was something I noticed. I would really appreciate any links you might have to share.
Re:MelonJS – a fresh and lightweight JavaScript game engine by wesz on Tuesday December 20, 2022 @02:39PM (#34071309)
https://mariani.life/flash-notes.html

I'm using this sqrt implementation (found it long time ago on some old action script blog, this link is not the original source). It's plenty fast, accurate and fully deterministic. I successfully implemented it in my multiplayer gta2 clone in javascript.