Could use better time synchronization for game API
- Lenguaje dominante
- Haskell
- Estrellas
- 1.3k
- Forks
- 201
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.)
Guía de contribución
Línea de trabajo
El issue no menciona archivos, pruebas ni puntos de entrada. Empieza localizando la inicialización de la marca de tiempo del cliente y el código de sincronización de eventos de la API del juego; después, sigue cómo el mensaje game-started establece el tiempo. Se considera terminado cuando los clientes convergen hacia una marca de tiempo monótona y coherente sin que el tiempo local disminuya, y las pruebas cubren mensajes de inicio retrasados o retransmitidos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- haskell
- Área
- distributed-systems, game-dev, networking
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100