Sign in to follow this  
eal

packets being queued up?

Recommended Posts

eal    272
Sorry for asking this, I'm pretty new to network programming. I'm using ENet to make a simple (although not simple enough) multiplayer game as my first network project. I notice when I connect to the server and have the game running in full screen, everything sent to it by the server is out-dated. I'm assuming this is because the refresh rate is lower in full-screen and the client isn't able to interpret packets as quickly as a windowed application, so the packets are being queued up? So I was wondering, is there any way to clear out all the queued packets with ENet (or is that even whats happening)? Thanks for any help.

Share this post


Link to post
Share on other sites
gcs584    280
Hi,

Perhaps, you should devise a way to send the packets when NECESSARY! For example, in games you wouldn't want to send a packet every frame. If one is managing 120 fps on his/her graphic card, that would be a packet every 8.33 ms.

[EDIT:] If you had a player who was doing nothing and just "sitting" there, you wouldn't keep on sending a packet to the server, informing it that the player is doing nothing. A packet should only be sent when an action or movement has occured. I usually send packets about every 50ms, but I've heard even that is too much.

Later,

GCS584

[Edited by - gcs584 on May 26, 2005 12:56:55 PM]

Share this post


Link to post
Share on other sites
eal    272
I changed it so that the client only sends packets when necessary, but I'm still having the same problem. Are you suppost to make the server send packets to each individual seperately based on their rate at which packets can be accepted (instead of just broadcasting at the same rate to everyone)? If the server sends packets to everyone every 50ms that would probably be fine unless someone's computer was getting under 20fps right?

Share this post


Link to post
Share on other sites
TaskyZZ    122
When you check for packets, don't read just one, read and use every packet in the queue before going on. I have a feeling you are just reading one packet, then running a frame of your game, then reading another packet, etc. This can cause them to build up if you receive more packets than frames you are running.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this