I'm making a casual MMO style game. No real "action" or fighting or anything like that is happening, just building a social world (just, like it's that easy huh ). Because of this I feel like my need for position data isn't all that intense. I'm going to have the clients send breadcrumbs (their actual x,y position value) of their positions and just have the server validate the breadcrumbs are reasonable to prevent cheating.
This is a 2D top/down style game where the players move relatively slow so I'm thinking sending position data about 4 times a second is good enough. I have this code running now and it seems fine when client/server is on the same PC.
My question is, on the server side, is it common to instantly broadcast the position of a player when that player sent the server the position data OR on a more timed basis on the server? More specifically I have a function on the server side that gets triggered whenever a client sent it's x, y. I read the x, y value in this function. Should I also broadcast to all other players this new value in this same function, or should I store it, and on a timed interval broadcast out everyone's position?
I feel like the timed interval is a cleaner approach but it also might create "bottlenecks" as a "large" chunk of data is being sent at a pretty regular interval vs a more constant stream of data that can be more unpredictable and is more based on the number of clients connected and their 250ms timer sending positional data. On the other hand I think a constant stream of smaller bits is smoother than a large chunk of bits at a given interval. Which side of my thinking is correct?
Also I will only be broadcasting positions to those clients in a given radius to said player.
Edited by rpiller, 26 December 2012 - 09:02 AM.