Game refresh best practice
Posted: 31 May 2011, 13:00
Hi all,
I'm very new to SFS2X (last friday), so apologies if these questions seem banal. I've read through pretty much the entire documentation, but if I've missed the answer please just direct me there and feel free to call me an idiot!
So far I've done a basic client and extension set up so I can move something around in my flash using the keys and the co-ords are sent to the server then broadcast to the room, and then reflected on my colleague's screen and vice versa. Which seems to be a nice proof of concept for what I want to ultimately do.
It has however raised a few questions. The most obvious is how often should I be sending messages to the server? At the moment it's firing off a message every 200milliseconds and as expected the animation on the other screen is very jerky (5fps). However this will eventually be going on a very busy website so I don't want to set myself up for problems in the long run by sending too many messages.
Is that even the best way of doing this? I move my character around in real time, then a timer event in the background grabs the position and fires it off to the server at set intervals. Or should I be doing it entirely differently?
I've looked in the Battlefarm example and it talks of queueing messages, but that seems to refer to a situation where messages are arriving faster than the animations can complete, so it drops interim movements. I'm more concerned about the other end of the spectrum, where I'm not getting enough messages because the server is being slowed down. Is that even feasible or am I worrying over nothing?
Basically it seems I've sort of got the basic mechanical understanding of what follows what, but I'm not sure of the logic I should be implementing.
Are there any guides which talk about best practice for this sort of thing or is it more of a suck and see?
Thanks in advance for any help,
Si
I'm very new to SFS2X (last friday), so apologies if these questions seem banal. I've read through pretty much the entire documentation, but if I've missed the answer please just direct me there and feel free to call me an idiot!
So far I've done a basic client and extension set up so I can move something around in my flash using the keys and the co-ords are sent to the server then broadcast to the room, and then reflected on my colleague's screen and vice versa. Which seems to be a nice proof of concept for what I want to ultimately do.
It has however raised a few questions. The most obvious is how often should I be sending messages to the server? At the moment it's firing off a message every 200milliseconds and as expected the animation on the other screen is very jerky (5fps). However this will eventually be going on a very busy website so I don't want to set myself up for problems in the long run by sending too many messages.
Is that even the best way of doing this? I move my character around in real time, then a timer event in the background grabs the position and fires it off to the server at set intervals. Or should I be doing it entirely differently?
I've looked in the Battlefarm example and it talks of queueing messages, but that seems to refer to a situation where messages are arriving faster than the animations can complete, so it drops interim movements. I'm more concerned about the other end of the spectrum, where I'm not getting enough messages because the server is being slowed down. Is that even feasible or am I worrying over nothing?
Basically it seems I've sort of got the basic mechanical understanding of what follows what, but I'm not sure of the logic I should be implementing.
Are there any guides which talk about best practice for this sort of thing or is it more of a suck and see?
Thanks in advance for any help,
Si