Cypher1 / 13k_lost

A tiny game (hopefully)
3 stars 1 forks source link

Multiplayer #5

Open Cypher1 opened 6 years ago

Cypher1 commented 6 years ago

Opening this to ask the question: How are we going to synchronise everything.

I think we need to change how the keys are processed so that we send key events directly to the server and then the server sends back thw whole game state.

That or we'd have to synchronise events which is tricky in js.

Any ideas?

wemyss commented 6 years ago

I wonder if sending a copy of their player object back with a timestamp is enough

Cypher1 commented 6 years ago

I think games would diverge over time (as messages from the server are received at different times).

On Sun., 10 Sep. 2017, 11:51 am Wemyss notifications@github.com wrote:

I wonder if sending a copy of their player object back with a timestamp is enough

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Cypher1/13k_lost/issues/5#issuecomment-328314260, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEaHviVQZATj9X84o_df-vUWalj6MIuks5sg0CegaJpZM4PR-Zg .

Cypher1 commented 6 years ago

We could just have the server regularly update parts of each client's state. Then clients continue to run the game but the game will still be running on the server (we'd have to ensure that all update code was in .update() and all state was in one place for each sprite / world etc.