• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help with lag in multinetwork ping pong game

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
we are developing a multi networked ping pong game in java for class and the problems we are facing is that the game lags for some reason and it ruins the whole game. Our server is responsible for controlling the game and etc. We are using TCP to send messages constantly to the server with the following info: paddle x and y coordinate, paddle length, paddle height, ball x and y coordinate, and ball radius. Then the server broadcast the message to everyone the gui can be updated with the info that the server sent. The client and server are sending and receiving messages to each other every 40ms. We have tried running our program in different comp and we still have the same problem. does anyone have an idea how we can resolve this issue? We are thinking that the buffer can handle this constant messaging. We might be overflowing the tc buffer. If you need me to post some code let me know. I really need t fix this bug its driving me insane
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think 40ms is a bit too frequent, for my rpg the server sends messages on average every 200ms, the client just sends message whenever through the tcp socket.
I do implement path prediction tho.
 
Ranch Hand
Posts: 287
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also why are you sending the paddle length and height and ball radius each time? does these things change during the game? Would it be better just to send some info giving the speed and bearing of the ball then this info only needs to be sent when the ball direction etc changes rather than 25 times a second.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic