Topic: Network Synchronization testing

Hello All

Im having issues with game desync.  It doesn't disconnect , just both copies of the game end up in a different state.
I Intend to use the playback tool to try and diagnose this however I realise that when its its triggered , My mouse is not visible (as we have disabled it in the game).  This should be simple to fix as I can issue the command to enable it once more however I'm having trouble finding an event for desync.  Please can you direct me to where in the code this is , or what calls the relevant replay tool, that way I can insert the relevant code to enable the mouse pointer.

Thank's for your time.
Kind regards

Share

Thumbs up Thumbs down

Re: Network Synchronization testing

I dont think the mouse pointer issue is related to UFE. Maybe its another script that is causing it.
As for your network issues, look into the following:
- Watch the videos about desync and replay tools
- Run the animation mapper on all of your characters
- Make sure the characters have  "Use Animation Maps" toggled under Character Editor -> Move Editor
- Under Global Editor -> Network -> Synchronization Test, make sure the desync action is set to "Playback Tool" so you can better analyze and discover the causes for your desyncs.
- For benchmark purposes, test the demo characters as well. If you are using legacy animations, test the Mike character, otherwise use Robot Kyle, Ethan or Mecanim Bot. Characters entirely built using custom hitboxes dont need the animation mapper.
- If the error persists and you cant find the cause, try documenting your findings in the forum. The more data you can share the easier it is to find the cause, and the more tests you make the easier it will be to narrow down the problem and replicate the issue. Record videos, take screenshots, write down console errors. The best person to find the solution is most likely going to be you.

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.

3 (edited by Crux-Actual 2023-08-23 04:40:25)

Re: Network Synchronization testing

Dear Mistermind.

Thanks for getting back to me.  Im going to try and address the points you made as Ive been going through these to try and diagnose the issue.

- Watch the videos about desync and replay tools
I did actually go through these and have enabled the replay tool as detailed in these videos.  The main problem is that it doesn't seem to actually detect that the two versions of the games are out of sync and just carries on.  This can lead to a situation where the two players are in very different situations.  If it detected this and disconnected / activated the playback tool (when set to do this), that would be better as we would be able to start diagnosing the exact point that it diverges (again using the method and logs detailed in those videos).  May be worth mentioning that sometimes (not always) , when I have the replay tool enabled, it triggers as soon as the game starts but this is quite random and doesn't seem to follow a specific pattern.  I have tried different Float Desync Thresholds but am currently using 0.03 as detailed in the videos.  I dont believe its de-syncing as soon as we start as I have been testing with a colleague where we could on multiple points of the game, stop fighting and compare the states.

- Run the animation mapper on all of your characters
- Make sure the characters have  "Use Animation Maps" toggled under Character Editor -> Move Editor
We are using 3d characters so I have baked the animation maps and set the characters to use them

- If the error persists and you cant find the cause, try documenting your findings in the forum.
Currently I am unable to invoke the issue reliably.  One thing I have noticed that on my side(my colleague hasn't noticed this) sometimes I am hearing a sound glitch whilst using online.  Its like the audio clip is being played twice in very quick succession.  There are no errors in the log indicating the issue and I am wondering if this could be indicating a time discrepancy between the two games?  Just to be specific , this isn't the two computers I am hearing, I am hearing the sound being played twice on one computer.

Given that the desync / replay tool is not seeming to pickup the problem, do you have any suggestions that I can try to narrow this down?

Thanks for your help, it is very much appreciated.

Share

Thumbs up Thumbs down

Re: Network Synchronization testing

Dear Mistermind.

A small update , for the first time ive been able to get the replay tool to correctly trigger during a match however I wasn't able to generate the logs for comparrison as the mouse cursor was disabled.  We have it set this way by default but I added ->
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;

Around line 1350 of the FluxCapacitor.cs
Just underneath where it says

UFE.replayMode.SetStartingFrame(UFE.currentFrame - UFE.replayMode.GetBufferSize(1), 1);
UFE.replayMode.enableControls = true;
UFE.replayMode.enablePlayerControl = false;
UFE.replayMode.enableRecording = false;
UFE.replayMode.StopRecording();
UFE.replayMode.Play();
UFE.replayMode.Pause();

Is this the correct place?  If I need to do anything else to re-enable the mouse, please let me know.

Share

Thumbs up Thumbs down

Re: Network Synchronization testing

Crux-Actual wrote:

Dear Mistermind.

A small update , for the first time ive been able to get the replay tool to correctly trigger during a match however I wasn't able to generate the logs for comparrison as the mouse cursor was disabled.  We have it set this way by default but I added ->
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;

Around line 1350 of the FluxCapacitor.cs
Just underneath where it says

UFE.replayMode.SetStartingFrame(UFE.currentFrame - UFE.replayMode.GetBufferSize(1), 1);
UFE.replayMode.enableControls = true;
UFE.replayMode.enablePlayerControl = false;
UFE.replayMode.enableRecording = false;
UFE.replayMode.StopRecording();
UFE.replayMode.Play();
UFE.replayMode.Pause();

Is this the correct place?  If I need to do anything else to re-enable the mouse, please let me know.

Have you tried searching around all of your scripts to see who is disabling the mouse cursor in the first place? It could be a custom script you've added to your project that is causing it. To do so, open Visual Studios and use the "Find and Replace" command (Ctrl + Shift + F) to search for any script that could be doing this:
https://i.ibb.co/Hq5CxNG/image.png

Also, if you are not entirely sure how the synchronization system works, I recommend not changing the core files. Adding functionality or modifying certain core behaviors can absolutely cause desyncs.

What type of game are you trying to make? a 2D fighter with 3D models or a 3D fighter style? Have you tried just using the templates and comparing changes made to the original demos? That can help you narrow down where the desyncs are coming from.

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.

Re: Network Synchronization testing

Dear Mistermind.

It was another developer who made the changes to remove the mouse but I believe it may have been set in several places.  It was my hope to not have to change those parts of the code and just find the relevant part of UFE that is triggered when a desync is detected and just re-enable the mouse at this point.  Its only then would we ever want the mouse to be visible and useable.  If we can find that one place it will save having to change it several times through the code (for debug purposes).

In regards to the actual de-syncs themselves, I am not wanting to make any changes to this code , it is simply from a point of view of trying to diagnose what is causing these problems.  Our fighting game is using 3d assets but is using the 2d fighting mode (effectively 2.5d).   I have baked the animations maps and have ensured that all the characters are using them.

Our characters are significantly different from the template characters so its not really practical to try and test those against ours.  I am sure i've seen it somewhere on the forum where somebody was having similar issues with the template characters in the base project as well. 

Part of the problem is that it doesn't always seem to detect the desync (and activate the replay tool), that being said if we can get the mouse re-activated and get the two log files from the computers, it should help to diagnose where the difference is.

The last time we tried this and it did detect the desync, both characters were in the air and hit each other.  Any further suggestions would be very much appreciated.

Kind regards

Share

Thumbs up Thumbs down