I've developing a small pong-like game for educational purposes and I've reached the point where I'm looking at implementing network gameplay. The idea is that a player can either wait for someone to connect to him (as the host) or he can attempt to connect to someone else (as the client). This means there is no server-arbitrer or other authoritative middleman.

I was looking into what optimizations are usually performed for a smooth experience since latency can cause jitterry movements if not handled properly. I know that client-side prediction is used and read up on it but it seems to me that this is applies in client-server types of multiplayer. Is this true, and if yes why?

Are there any other techniques or tricks that I should look into? The game as you can understand isn't at all complicated and the only movement that might be jitterry is the remote player's paddle movement. Also, although the ball's movement in general is not controlled by the player, it's reaction to a paddle hit depends on where exactly on the paddle the ball landed. This might differ from one client to another. Would prediction for example help in this case?

  • \$\begingroup\$ I'm trying to get you to focus on the particulars of your game, rather than asking what "is used" — games are a huge field, and there's a lot that "is used" or not used in some games somewhere that would be utterly unhelpful for the one game we're trying to make. So: if you think prediction might help your game, try it! It wouldn't matter if zero other games have used it for this purpose, and no network prediction police will arrest you for using prediction outside the legally-prescribed bounds of an authoritative server. If that doesn't work, describe the problem symptoms & ask for solutions. \$\endgroup\$ – DMGregory Apr 20 '18 at 12:56
  • \$\begingroup\$ Ok I'll try the prediction if necessary. Are there any sources where you can point me to for more such optimization techniques? \$\endgroup\$ – Konstantine Apr 20 '18 at 13:24
  • \$\begingroup\$ I don't know what concrete problems your game is manifesting, so I'm not in a good position yet to suggest solutions. If you edit your question to describe the problems you're observing, we can post answers that solve those specific problems. That's generally how our Q&A format here works best, giving you tailored help rather than broad links. \$\endgroup\$ – DMGregory Apr 20 '18 at 13:27
  • \$\begingroup\$ There is no implementation done for network play yet thus there are no problems. The whole question was for knowledge gathering on what I should look out for and what to implement. \$\endgroup\$ – Konstantine Apr 20 '18 at 15:06
  • \$\begingroup\$ StackExchange Q&A isn't really the best tool for broad background research. It does much better for questions that have a concise, correct/verifiable/working answer. "How can I implement prediction in my game" or "how can I compensate for network latency in this case" or "how can I assign authority over the ball's bounce in peer-to-peer pong?" fit the bill. "List any network optimization techniques" opens it up too broadly for the Q&A structure used on this site, so you'd likely have better luck asking that kind of thing on another site, like a search engine or discussion forum. \$\endgroup\$ – DMGregory Apr 20 '18 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.