All Projects → RomanZhu → Frame-Number-Sync

RomanZhu / Frame-Number-Sync

Licence: MIT License
Keeps time in sync between server and client.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Frame-Number-Sync

ENetUnityMobile
Using ENet-CSharp for a multiplayer setup with a Unity Client and .Net Core Server environment
Stars: ✭ 27 (-12.9%)
Mutual labels:  multiplayer, enet
my-first-realm-app
ToDo demo app using Realm and Realm Object Server to synchronize tasks.
Stars: ✭ 38 (+22.58%)
Mutual labels:  synchronization
cakeMP
An experimental GTA 5 multiplayer mod.
Stars: ✭ 39 (+25.81%)
Mutual labels:  multiplayer
node-v
🔒 Secure ❄️ Synchronized ⚡️ Realtime ☁️ Cloud 🌈 Native JavaScript Variables & Events
Stars: ✭ 27 (-12.9%)
Mutual labels:  synchronization
midgard
⛰️ Universal clipboard sharing service (supports macOS/Linux/Windows/iOS)
Stars: ✭ 81 (+161.29%)
Mutual labels:  synchronization
code-frame
Minimal Code Frame like babel-code-frame, but smaller
Stars: ✭ 22 (-29.03%)
Mutual labels:  frame
voxelsrv
Voxel browser game inspired by Minecraft
Stars: ✭ 49 (+58.06%)
Mutual labels:  multiplayer
cards-over-lan
A Cards Against Humanity clone for LAN play. Works on desktop and mobile. Supports custom cards in multiple languages.
Stars: ✭ 45 (+45.16%)
Mutual labels:  multiplayer
worldcore
Croquet-based multi-player game engine
Stars: ✭ 17 (-45.16%)
Mutual labels:  multiplayer
reisen
A simple library to extract video and audio frames from media containers (based on libav).
Stars: ✭ 41 (+32.26%)
Mutual labels:  frame
UniRate
Unity plugin to easily manage the application frame rate and rendering interval. Preventing battery power consumption and device heat, especially on mobile platforms.
Stars: ✭ 26 (-16.13%)
Mutual labels:  frame
XREngine
Immersive infrastructure for everyone. Everything you need to build and deploy scalable realtime 3D social apps and more. 🤖 🚀 👓 🚀 🕹️ 🚀 🧑🏿‍🚀
Stars: ✭ 423 (+1264.52%)
Mutual labels:  multiplayer
cells-sync
Sync Client for Pydio Cells
Stars: ✭ 21 (-32.26%)
Mutual labels:  synchronization
broken seals
An open source third person action RPG with multiplayer support.
Stars: ✭ 223 (+619.35%)
Mutual labels:  multiplayer
Pytorch-ENet-Nice
Pytorch to train ENet of Cityscapes datasets and CamVid datasets nicely
Stars: ✭ 30 (-3.23%)
Mutual labels:  enet
com.unity.multiplayer.samples.coop
A small-scale cooperative game sample built on the new, Unity networking framework to teach developers about creating a similar multiplayer game.
Stars: ✭ 794 (+2461.29%)
Mutual labels:  multiplayer
virtual-dom
Application framework for real time collaboration using Croquet
Stars: ✭ 14 (-54.84%)
Mutual labels:  multiplayer
Cavemen-GGJ2019
A multiplayer survival game developed during Global Game Jam 2019.
Stars: ✭ 21 (-32.26%)
Mutual labels:  multiplayer
S4
🔄 Fast and cheap synchronisation of files using Amazon S3
Stars: ✭ 69 (+122.58%)
Mutual labels:  synchronization
Crystalshire
Legacy VB6 open-source ORPG
Stars: ✭ 24 (-22.58%)
Mutual labels:  multiplayer

Frame-Number-Sync

Features

  • Time synchronization
  • Client tick frequency modification
  • Uses ENet for networking
  • Networking is handled by a separate thread, lockless communication with that thread
  • Simple logger

Overview

The project keeps time in sync between server and client. Both sides know how many ticks were performed at a certain time.

The algorithm can survive through ping spikes and bad network conditions. For simplicity, the server supports only one client.

Overview

Client

Client sends request to server 1/TimeUpdateDelay times per second. Request contains client local time.

When he receives a response - he finds delta between local time and first float in the packet. That delta is added to the second float in the packet, the resulting time is increased on each update. From that approximation, the client calculates the number of ticks that happened on the server. The client modifies his tick frequency to smoothly reach approximated tick value.

Idea for more advanced approximation (Will try to implement in the future)

In that implementation, only the server will send his local time to clients with specified frequency. The client can utilize ENet.Peer's RTT value to understand how far behind he is generally.

When client receives the first packet with server time, he will add RTT/2 to it and store local time and offset(RTT/2). When client receives the next packets, he will calculate the delta between current local time and last stored local time, then the total time will be equal to receivedTime + offset + delta. Then local time is stored again.

In that approach, the most important part is getting the correct RTT value at the first packet.

Fields

  • IP - The client will try to connect to that IP.
  • Max Ticks Behind - If the current tick is less than approximated tick by more than that value, then a tick will be snapped to approximated tick.
  • Max Predicted Time - If approximated time is greater than last received time by more than that value, then the client will stop executing ticks.
  • Time Update Delay - Client will send request to get server time 1/TimeUpdateDelay times per second.
  • Normal Delta - Ticks executed 1/Delta times per second. This delta is used when local tick count and approximated tick count are equal.
  • Lower Delta - When the count of executed ticks is greater than approximated tick count, then the client will use this delta to slow down.
  • Higher Delta - When the count of executed ticks is less than an approximated tick count, then the client will use this delta to speed up.

Server

The server increases his local tick count. When he receives a request from a client - he will send back time from request and his local time.

Fields

  • IP - Server will bind itself to that IP.
  • Delta - Ticks executed 1/Delta times per second.

Dependencies

  • Unity 2019.1
  • ENet CSharp 2.2.6
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].