Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only send users what is in view of them when updating state #27

Open
bdjewkes opened this issue Aug 4, 2019 · 0 comments
Open

Only send users what is in view of them when updating state #27

bdjewkes opened this issue Aug 4, 2019 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@bdjewkes
Copy link
Collaborator

bdjewkes commented Aug 4, 2019

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

@bdjewkes bdjewkes added the help wanted Extra attention is needed label Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant