Server queueing outgoing messages?

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
Abomb
Posts: 5
Joined: 07 Oct 2006, 18:58

Server queueing outgoing messages?

Post 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
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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.
Lapo
--
gotoAndPlay()
...addicted to flash games
Abomb
Posts: 5
Joined: 07 Oct 2006, 18:58

Post 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 ;)
Abomb
Posts: 5
Joined: 07 Oct 2006, 18:58

Post 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... =)
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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)
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply