DoubleDeez / MDFramework

A multiplayer C# game framework for Godot 3.4 Mono.
https://discord.gg/UH49eHK
MIT License
77 stars 13 forks source link

Bug: Synching doesn't work #45

Closed Meister1593 closed 4 years ago

Meister1593 commented 4 years ago

After merging 98c7f92390a48572915d2f0b71526bff4733f746 and 66e9ae3302fe7e9362e821eed8df5a1b2d3972ff commits onto my fork suddenly, any signs of synch are not there (with debugger, i couldn't catch events about start, update and ending of synch outside) Is that intentional? Or i forgot to enable something?

Beider commented 4 years ago

Edit: Sorry my original assumption was wrong I am not sure what is going on here. What exactly are you looking at when you say any sign of synch? Did you turn on the logging and print out logs?

Beider commented 4 years ago

Ok I took a minute to look at this, I noticed the synch status event is only spitting out 0, this looks like the number is getting rounded down to zero during transmission. So most likely some kind of rounding error was introduced.

Meister1593 commented 4 years ago

Logs are enabled by default. When someone joins, there should be synch happening, like it was before those commits. Now, there's none synching happening. All three events (OnSynchStartedEvent,OnSynchCompleteEvent,OnPlayerSynchStatusUpdateEvent) are now silent.

Beider commented 4 years ago

Are you using the IMDSynchronizedNode interface for your nodes? From what I can see it looks like replication isn't happening properly during synchronization at the very least. This was not a problem in the example I used as I didn't use the IMDSynchronizedNode, however when using that interface we never finish synching.

Most likely this is due to pause mode and replication not happening or some other weird thing. I will take a look at it later.

Meister1593 commented 4 years ago

Are you using the IMDSynchronizedNode interface for your nodes? From what I can see it looks like replication isn't happening properly during synchronization at the very least. This was not a problem in the example I used as I didn't use the IMDSynchronizedNode, however when using that interface we never finish synching.

Most likely this is due to pause mode and replication not happening or some other weird thing. I will take a look at it later.

I haven't used this interface, my game is mostly BasicLobbyExample, with one exception being zeroed resume after synch (i've reverted that, no effect, it was also in SyncInterface so it shouldn't matter anyway). Also i overrided IsPauseOnJoin to be false in MyMDGameSynchronizer, but enabling it back doesn't help either.

Beider commented 4 years ago

I will try to figure out what is going on later today or tomorrow, I can see by using the PredictiveSynchronizationExample that something is very wrong, this example used to work fine and now it is not synching.

Meister1593 commented 4 years ago

I tried debug in _Ready function inside MDGameSynchronizer and it does not seem to even trigger. This means that synchronizer isn't even instantiated when: session started, host connected to own server, someone connected to host server.

Beider commented 4 years ago

That sounds weird, for me it is instansiated. Go debug into the GameInstance.CreateGameSynchronizer() and see what is going on there.

Meister1593 commented 4 years ago

I forgot to do base._Ready() in overrided MyMDGameSynchronizer._Ready() function... That was one line of all problems, wow... I will check new commits when i fix my game.

Beider commented 4 years ago

That being said there is still a problem with synchronization in the PredictiveSynchronizationExample, so that will have to be figured out and fixed.

Beider commented 4 years ago

I will close this now and file a separate backlog for the issue I discovered in the scope of looking into this.