max-mapper / voxel-server

multiplayer server for voxel-engine
74 stars 25 forks source link

Client: requestAnimationframe instead of setInterval? #7

Closed gabehollombe closed 11 years ago

gabehollombe commented 11 years ago

At https://github.com/maxogden/voxel-server/blob/master/client.js#L58 is there a reason we're using setInterval for the client's main loop?

max-mapper commented 11 years ago

thats not the main loop, it just sends position updates to the server. emitter.emit means its sending a message, emitter.on is receiving a message from the server

gabehollombe commented 11 years ago

Ok, so the player is sending positional updates to the server 22 times per second? If that's right, I'm thinking it would be good to change this slightly and only transmit positional changes when they happen, so players standing still don't send unnecessary redundant positional messages to the server. What do you think of this?

max-mapper commented 11 years ago

yes i think this is a good idea. it would need to send rotation and position

On Mon, Feb 11, 2013 at 2:32 PM, Gabe Hollombe notifications@github.comwrote:

Ok, so the player is sending positional updates to the server 22 times per second? If that's right, I'm thinking it would be good to change this slightly and only transmit positional changes when they happen, so players standing still don't send unnecessary redundant positional messages to the server. What do you think of this?

— Reply to this email directly or view it on GitHubhttps://github.com/maxogden/voxel-server/issues/7#issuecomment-13407372.

gabehollombe commented 11 years ago

Created new issue to track this as TODO: https://github.com/maxogden/voxel-server/issues/9