Sign in to follow this  

Pong implemented in network,but too slow

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, First of all thanks to everyone for there right suggestions. I have implemented Pong game in network,Which can be played by two player in the network.But it is too slow to be played, rather we can say it can'nt be played.But it(ball and the two paddles) runs smoothly on the same computer,in which one window is server and the other is client.Data transfer is okay .I'm using thread to accept connection and the data. I'm not understanding why it's runs smoothly on the same computer. But creating problem when run from other. It will be better if you kindly suggest a way to be out from this. If possible just tell me how should I tranfer paddle(y position )and ball(xpos and ypos). And Tell me how the multiple send and receive works.

Share this post


Link to post
Share on other sites
well first of all what networking tech are you using? Is it DirectPlay? Are you connecting directly via tcp sockets? What is the speed of your local network?
Usually for a game like pong you only need to send updates when the player moves his paddle. The two games should be able to extrapolate contact points and such on their own. There is no point sending the ball position every frame.

Periodically you can send a state update so that the two can synchronize time. And a separate thread for network input as Ive always maintained (though I know others may disagree) is wasteful. You can achieve the same result by polling the network socket from the gameplay thread. ESPECIALLY for a game like ping pong.

Share this post


Link to post
Share on other sites

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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