Results 1 to 9 of 9

Thread: Winsock realtime

  1. #1

    Thread Starter
    Hyperactive Member MeTTa@'s Avatar
    Join Date
    Aug 2005
    Posts
    312

    Winsock realtime

    I made a small game were 2 players share a screen, they both edit the screen, but the screens are looking different at different times, how can i make both screens change at the exact time and stay accurate?

  2. #2

    Thread Starter
    Hyperactive Member MeTTa@'s Avatar
    Join Date
    Aug 2005
    Posts
    312

    Re: Winsock realtime

    Well? Is there anyway to make sure lag doesnt make the two screens differ?

  3. #3
    New Member
    Join Date
    May 2006
    Posts
    2

    Re: Winsock realtime

    You should sync the user inputs. For example: Users A and B, if they both make a move at the same time, you decide which move first. ie. if A decides to move first, then you make screen change according to A's move, then update all player screens before you allow B to move, and also check if B is a valid move because A might made some move that prevent B's movemeng.

  4. #4

    Thread Starter
    Hyperactive Member MeTTa@'s Avatar
    Join Date
    Aug 2005
    Posts
    312

    Re: Winsock realtime

    Here, anyone can have a look, im kinda proud of this project, i made an older version that was 10x the ammount of code. See if you can solve my lag problem that causes the games to varry.
    Attached Files Attached Files

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Winsock realtime

    The only way to "solve" lag is to have a lagless connection - and that's not possible.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  6. #6

    Thread Starter
    Hyperactive Member MeTTa@'s Avatar
    Join Date
    Aug 2005
    Posts
    312

    Re: Winsock realtime

    I dont mean to get rid of it, bah!, i want to do what every other game does, if theres lag, it makes everyone wait, or it speeds them up.

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Winsock realtime

    About the best you can do is constantly measure lag to each of your users (or have each user measure lag to the server) by pinging, but that uses a lot of bandwidth. There's no way to make lag an "event", or to trigger something if the connection lags.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  8. #8

    Thread Starter
    Hyperactive Member MeTTa@'s Avatar
    Join Date
    Aug 2005
    Posts
    312

    Re: Winsock realtime

    damn, i guess il try sharing each players x and y coord's, and see how well that goes, i have a feeling the lines will skip.

  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Winsock realtime

    I don't know what games you think have "solved" the lag problem, but my wife is a dedicated gamer, and complains about lag all the time, on some pretty sophisticated gaming systems. Not even IRC networks, some of which are over 10 years old, can do anything about lag except to reroute servers - and you don't want to do that unless you have someone doing just that all the time.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width