Search Unity

Lockstep client-server

Discussion in 'Multiplayer' started by Staples, Dec 5, 2012.

  1. Staples

    Staples

    Joined:
    Jan 14, 2009
    Posts:
    224
    Is it possible to implement a lockstep model using client-server and not peer-to-peer?

    Any suggestions in how to proceed?
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,072
    Of course it is :)
    If the networking part confuses you, maybe it's easier to first implement a lockstep system that's only running on one system/client. Then think about how you get the input from other clients.
    By the way: There is no Peer to Peer in Unity, unless you use some thirdparty solution that implements this. With Unity, some client is the host (server) of any game.
     
  3. Staples

    Staples

    Joined:
    Jan 14, 2009
    Posts:
    224
    Yeah fair enough, I guess it's just that for rts games peer-to-peer seems to be associated with lockstep since each peers knows if each other peer has each command.

    Not sure if you can do the same concept through client-server though. I'll work on the lockstep first then figure it out.
     
  4. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Starcraft 2 and most other recent multiplayer RTS's are lockstep client-server.
     
  5. Staples

    Staples

    Joined:
    Jan 14, 2009
    Posts:
    224
    Do you have a source for that? I've been reading conflicting views on SC2, some have said it's a client-server / peer-peer hybrid of sorts as well.

    Anyway as long as it can be done, I just need to figure out how the lockstep should be done in Unity. Seems difficult to find information on how to implement it, I guess not many RTS compared to other genres in Unity.
     
  6. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    No need for a source, play a game of starcraft and use netstat in windows. You only have one open connection, to blizzard's server. P2P would be hilariously easy to do packet injection and toy with the datastream, and that game is way too competitive for blizzard to allow that risk and let you to communicate directly with anyone but their server.