1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

How can I log things to debug desync issues ?

Discussion in 'World Editor Help Zone' started by Ricola3D, Apr 9, 2020.

  1. Ricola3D

    Ricola3D

    Joined:
    Feb 27, 2019
    Messages:
    291
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    Hello,

    Like many developers, sometimes, with some players, my map desync. It is not systematic, happens at different time, and doesn't happen often.

    So it is hard as hell to debug this sh*t...

    This is a reason why I added log in my maps. I made functions to write rolling logs in a file on the computer of the player. So each player has a log file. And I hope that with luck:
    - I will see what trigger executed last before desync for at least 1 of the player
    - I will see a difference between the log files of 2 players for a same game

    However, I cannot log everything all the time... Writing in a disk file is a time consuming operation, and its consumption is even higher the bigger the file is..

    So can you help me please : how can I write in file just after any desync ?


    I tried using the "On player leave" event, but it doesn't happen when on the computer of the player when:
    - The last player of the game leaves (it seems to be the same for solo, local network & Battle.net)
    - The local player leaves

    So If I desync on Battle.net, nothing is logged ...
     
  2. bigbull

    bigbull

    Joined:
    Mar 7, 2020
    Messages:
    16
    Resources:
    1
    Maps:
    1
    Resources:
    1
    How about detecting if its a Replay and print your debug messages there? If someone is having an issue with your map, they can send you a replay.

    Replay Detection
     
  3. Ricola3D

    Ricola3D

    Joined:
    Feb 27, 2019
    Messages:
    291
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    The idea is not bad.
    Is replay automatically saved on their side ? Because if they desync it is too late to save the game manually :S

    I don't know the replay feature.
    The replay will reproduce the "leave" evenement. But does it reproduce the same trigger executions, or are there differences ? :)
     
  4. bigbull

    bigbull

    Joined:
    Mar 7, 2020
    Messages:
    16
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Replay is automatically saved (even if the player desync). This is how i tracked down my desync issue (here).

    Im not an expert on this but if u look at the Replay Detection script there are slight diffrences. However, i would say that they have no influence on 99% of the maps.