I made a game with node.js and uploaded it.. it should be 30 frames per second..
The game is hosted in AppFog.
Now I testing it and it runs slow.. I mean in local network it runs a lot smoother
I do understand the problem -
The server is sending a message to the client for every frame, it's basically impossible --
network latencies below 16 ms (60 fps) or 33 ms (30 fps) over the internet are impossible to reliably guarantee. It might work over a local network, and almost certainly can work on a local machine, but not over the internet. If I need to get information from the client to the server and back in the next frame, my round-trip latency needs to be that low, including the processing on both sides. Since both xhr-polling and websockets use TCP, it gets worse because one slow/lost packet will pause everything after it until it finally shows up.
So I am in a pretty bad situation..
The game is set with xhr-pooling like this -
io.set('transports', ['xhr-polling']);
which use TCP and it's very problematic because one slow/lost packet will pause the game..
So how can I make the game smoother? any ideas? I really want to make it work out!
Thanks in advance