Jump to content
  • Advertisement
Sign in to follow this  
pulsar

Pong implemented in network,but too slow

This topic is 5171 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
Advertisement
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
definitely need more information about your pong game and how it is structured before we can come up with an answer to your question.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!