Jump to content
  • Advertisement
Sign in to follow this  
NickyP101

Network Game Progamming

This topic is 4900 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

Here is my current structure: Client - ClientIO ----------------------------------------- Server - ServerIO (THREAD)-----------------------------------------------------(THREAD) Client is the main game class, with the game loop in it. Client IO is a thread which is listening for input, and can also write. Server is the server lol server io is a thread assigned for each connection to listen and to write. Clients send information every loop of the game, everyLoop the update method is called in the Client IO and it sends the Server the new X, Y Co-ordinates etc. Is this an efficient way of doing this? Or will it cause problems? Thanks in advance, Nick

Share this post


Link to post
Share on other sites
Advertisement
This, in theory, is an ok way of doing your network. BUT, I wouldn't suggest sending data every frame, as this creates excess lag with the bult of information sent every 1/30th of a second (if 30fps). Maybe send every 3 frames or something. I guess you'll see when you test it but experiment and you'll find a good solution. I believe sending everyframe would be ok onLAN but definately across a modem.

toXic1337

Share this post


Link to post
Share on other sites
you can send data every frame, or segments of data. Yo uwill need some kind of throttling device to make sure the bandwidth usage is not too great. Some objects will barely need to send updates every seconds, some other faster, like every 30th of a second.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What type of game are you doing? Most games only send data when something changes that is unexpected like user input from a mouse, keyboard, joystick, etc. Most of everything else can be handled on each client. Randomness is not that random, send the seed to each client at the beginning and everytime the Random Function is called each computer will produce the same number. As long as the game states are in sync the calls to random will always produce the same number.

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!