A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [CS3] Approach to synchronize real-time game

  1. #1
    Junior Member
    Join Date
    Jul 2005
    Posts
    10

    [CS3] Approach to synchronize real-time game

    Hi!

    I'm planning a real-time multiplayer game. It is a racing game where players change its position all the time and keeping all players in sync is very important.
    This is my first real-time game in flash and I don't really know which synchronization approach I should use. I can think of three different and I would like to know what you other guys thinks about them.

    Approach 1
    One basic approach is to let each player send a notification to the server every time it moves position. The server then sends the information to all other players.

    But I can think of one problem with this. If one player plays on a very slow computer it may move slower than the other players and lag after.

    Approach 2
    One way to solve the problem that the player on the slower computer lag after is to let the server handle everything. If the server continuously calculates and sends information about movements of all players noone will lag. The players have to send a message to the server when he wants to turn right or turn left and so.

    Approach 3
    One other way to solve the problem in Approach 1 is to let the client calculates new movements the time factor. On every new movement the player checks for how long it was since the last movement. The longer time since the last movement, the longer the new movement will be!

    This is the approaches I can think of. Feel free to post questions about them if something is unclear. I would like to hear your comments about them and maybe some of you can think of any other?

    /Regards Tobias

  2. #2
    ....he's amazing!!! lesli_felix's Avatar
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    1,506
    I think you're worrying about the wrong issue here.

    Make sure your code is frame/cpu independent so you won't get issues with different speed computers.

    Your real problem is going to be network lag - the time it takes to send a message from the client, to the server and then to the other client.

    If you're building a fast-paced shooter, you're going to have a hard time, as there's no avoiding network lag, so you have to hide it using techniques like predicting where other players are going to be in the future depending on the lag time.

  3. #3
    Junior Member
    Join Date
    Jul 2005
    Posts
    10
    I see! I will have to wait until its finished and see how much lag it is. But for now I have to choose approach. I have no idea in what way it is used to do. And therefore i'm asking if someone has any idea or experience to share!

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

HTML5 Development Center