Page 1 of 1
Server queueing outgoing messages?
Posted: 09 Oct 2006, 17:04
by Abomb
Hi =)
I'm already back with a new problem...
I'm currently trying to make a little 2d-shooter-type multiplayer game in flash (as can be read in my other thread =P). I send out playerpositions every 30 ms, which works fine when running client + server on one machine. But now I tried to run server and client on different machines that are connected in a LAN, and now the movement of the player gets really jerky. I traced the getTimer() on the Client each time a position update arrives, and the times indicate that several messages arrive at the same time, something around 6 messages every 200 ms. Is that a Server side problem, or a problem in the client code, or a problem related to LAN<->one computer in general ?
Thanks in advance
Posted: 10 Oct 2006, 07:30
by Lapo
Queues filling up are the symptom of too much data being send and received.
Sending updates every 30ms is probably too quick as an average good ping time over the internet is around 100ms.
The fact that you get jerky animations in a LAN is definitely depending on your code. Real time games are not just about sending data as fast as possible, they require compensation and time-synch algorithms, time based animations etc...
There are entire books written on this subject, but probably on of the most important basic aspect is basing all animations on time and not frames.
Posted: 10 Oct 2006, 11:05
by Abomb
I know about time based movement and animation etc, I was just hoping because the game will only be played over LAN I could avoid all that coding ;P Oh well, coding it is then =) But thanks for the answer nevertheless

Posted: 10 Oct 2006, 13:18
by Abomb
Hum, my problem still exists .. even if I send one packet containing only one charachter once every 100 ms the server still sends messages only once every 200 ms... Could this be a problem with windows, some firewall etc.. ? But receiving packeges only once every 200 ms is just too slow for an FPS - you could probably compensate by code, but the time and effort is just not worth it for the little game I want to do ;/ Is there some way to send messages "faster" ?
edit: OK, I googled a bit, and it seems the 200ms "queeueing-time" are a general tcp-"problem"... seeing as the smartfox server is written in Java, maybe it would be possible to specify a server-option for realtime-games like FPS etc, so that sockets would use the socket-option
TCP_NODELAY ... ? I'm not a Java-crack, so maybe I'm totaly wrong... =)
Posted: 11 Oct 2006, 13:45
by Lapo
The server can send many process many thousand messages in a fraction of a second so if you are experiencing slow downs like the one you mentioned you are definitely having network problems.
If you're running a software personal firewall on the machine running SFS shut it down, we have noticed weird behaviours at times.
For example we had lots of problems with Zone Alarm a few years ago and we noticed that problems only went away by completely removing the service , not just stopping it. (although I believe other firewalls shouldn't create these problems)