You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Only send users what is in view of them when updating state #27
Currently the server ends every tick by calling emit('world', game_state); eg, the global world state is broadcast to all clients. There are a few problem with this, but the most immediate ones are:
every client will know everything about the world! (good luck having a "hide" ability with this model)
the client needs to know how to translate between "world space" coordinates and "view space" and "screen space" coordinates
Instead of broadcasting global state, entities should have a view range (this can be a global constant to begin with, but could eventually be adjustable per entity). Each frame, instead of emitting a global message, each client would have everything within their view range sent to them
Activity