Could use better time synchronization for game API
- 主要言語
- Haskell
- スター
- 1.3k
- フォーク
- 201
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Currently, game clients are synchronized relative to the moment they receive the "game started" message from the game server. If that one packet is delayed (by a TCP drop and retransmit, for example), a client will persistently remain behind the others in time. That means other clients will appear jerky, as they keep going back to add events in the more distant past, then replaying their own events from that point. In fairness terms, the lagged client gets an unfair advantage, as it receives other players' events in the future before they actually occur, but other clients don't see its own events until well after they occur.
To fix this, we should add some kind of NTP-like time management code to revise each client's current timestamp toward a consistent value regardless of any original discrepancy. (But keep in mind that it's critical for correctness that time is monotonic, so we can never decrease a client's timestamp; only slow its rate of increase to allow other clients to catch up.)
コントリビューションガイド
調査の方向性
この issue では、ファイル、テスト、エントリポイントが指定されていません。まず、game API のクライアントタイムスタンプの初期化とイベント同期コードを見つけ、次に game-started メッセージがどのように時刻を確立するかを追跡してください。クライアントがローカル時刻を減少させることなく、一貫した単調なタイムスタンプへ収束し、遅延または再送された起動メッセージをテストでカバーできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- haskell
- 領域
- distributed-systems, game-dev, networking
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100