How can I log things to debug desync issues ?

Level 9
Joined
Feb 27, 2019
Messages
298
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 ...
 
Level 9
Joined
Feb 27, 2019
Messages
298
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

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 ? :)
 
Level 3
Joined
Mar 7, 2020
Messages
16
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 ? :)

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.
 
Top