Search Unity

Network time synchronization

Discussion in 'Multiplayer' started by at, Oct 17, 2008.

  1. at

    at

    Joined:
    Oct 9, 2008
    Posts:
    6
    Hi all.

    I'm developing a 3D MMO game using Unity 3D and SmartFoxServer on the server side. Now I'm facing a problem with writing a network interpolation algorithm which would smooth the synchronizations of player's Transform. Unity has Network.time property which seems to be automatically synchronized on all the clients.
    Or anyway there is NetworkMessageInfo.timestamp property which is somehow relative to local Network.time.
    But I cannot use this, because I don't deal with the Unity's built-in networking.

    Given that interpolation algorithms are based on the time the message was sent, I need a way to have some synchronized value of time between all the connected users in order to compare the time when the remote message was sent with recipient's local time.

    Has anybody solved this problem using SmartFox ?
    Or does there exist another method to synchronize the network time using Unity ?

    Thank you.
     
  2. at

    at

    Joined:
    Oct 9, 2008
    Posts:
    6
    Seems that noone did it.
    Ok, I have found that the SmartFoxServer has no implemented time synchronization methods for now. So I solved the problem by writing a simple server extension that sends the time value to all the clients.
    Now interpolation works fine.
     
  3. yazzgoth

    yazzgoth

    Joined:
    Oct 7, 2008
    Posts:
    7
    at what are your thoughts of working with SmartFoxServer?
    I'm currently starting a project where I'm planning to use SFS. Do you completely rely on SFS for networking or are you using a hybrid approach with Unity3D networking?
    Have you done any performance testing of SFS with Unity3D?
     
  4. at

    at

    Joined:
    Oct 9, 2008
    Posts:
    6
    I use only SFS without Unity networking and it completely fulfills my requests so far. I like its room conception, the way of sending objects and messages, and I think it's the easest server solution to start working with Unity and some other 3D engines that support .NET. Another plus is its extensions mechanizm, based on Actionscript. So if you want to develop 3D application based on Unity and Smartfox you have to know only a Javascript-like language and C# (the last for working with the SmartFoxClient object).
    I haven't done any perfomance tests yet, but given that unity application is a thick client which is responsible for the physics and all the actions, the server now has to synchronize only animation and Transform messages, and some non-realtime stuff.
    On the SFS site they write they can handle thousands of clients on a single server. But if I need more performance in future, there is a cluster solution for SFS based on Terracotta.
     
  5. addy55

    addy55

    Joined:
    May 2, 2014
    Posts:
    5
    Facing the same problem.. can you share some of your code for reference so that I also achieve something like this.
    I have also implemented a custom day/night cycle, is there a way to sync time for all clients in the same zone?
    Thanks for your time.