Best way to handle multiple users with different connection speeds. Graphic type game. Lang c. win.
Meow.
Best way to handle multiple users with different connection speeds. Graphic type game. Lang c. win.
Meow.
TCP or UDP? Little more details...
Buffer your data and send as much as you can when you get the opportunity - don't wait for a client. (Let no packet go to waste...) If a client can't keep up, assume network failure and kick them. (Or reduce the data you're sending, if this becomes problematic.) Consider an ability to remove out of date data from a buffer before it is actually sent.
Do you need details on handling multiple sockets in general? (select(), poll(), multithread, there are tons of approaches, all with pros/cons...) Since you mention Windows... select(), or WSAAsyncSelect() if you have GUI.
long time; /* know C? */
Unprecedented performance: Nothing ever ran this slow before.
Any sufficiently advanced bug is indistinguishable from a feature.
Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
The best way to accelerate an IBM is at 9.8 m/s/s.
recursion (re - cur' - zhun) n. 1. (see recursion)
You should define your undestanding of the term "best way"
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
i can do that. Ok with sockets. Question is more connection configuration for game setup. Ie one tcp connection per player or one connection per turn then next player connection .Do you need details on handling multiple sockets in general? (select(), poll(), multithread, there are tons of approaches, all with pros/cons...) Since you mention Windows... select(), or WSAAsyncSelect() if you have GUI.
Some options of consideration."best way"
1 one turn per player. Sit and wait for each player to respond.
2 ten turns for faster connection and one turn for slower connections.
3 let slower connection user game piece idle while waiting for responce
4 kick timeouted slower user.
5 only move piece with user input.
6 move piece based on previous input while waiting
7 give slower player connection more armor so that when they are “picked on” by faster user with faster connection they can survive until their input comes in.
8 deal with only one player at a time per turn then make next player connection.
9 deal with few players at time then next group of players
10 deal with all players tcp.
11 best for games udp or tcp.
12 other?
have some rereading to do.
http://www.gamedev.net/reference/list.asp?categoryid=30
multiple threads that copy the game state to a local buffer then send the buffer. Once the send is finished, copy the current game state and repeat. with seperate threads a slow connection player cant slow everyone else down, they will just get fewer updates.
also look into both asyncronous send/receive as well as WaitForSingleObject() as it pertains to a socket.