[0.11.17] Multiplayer Still Desync Loop When New Player Joins
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
[0.11.17] Multiplayer Still Desync Loop When New Player Joins
This was a known issue in 0.11.16 so I'm kind of surprised that it wasn't fixed in 0.11.17
Steps to reproduce:
Start a new multiplayer game.
Have someone join.
Steps to reproduce:
Start a new multiplayer game.
Have someone join.
Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins
Do you know any specific conditions when this bug appears? Generic joining doesn't cause desync loop.
Re: [0.11.17] Multiplayer Games Still Desync When New Player Joins
It happens from time to time, and I have a better description for the issue:
Many of us players are using third-party softwares to create virtual LAN, such as Evolve and Hamachi. More specifically with Evolve, this issue is happening, but it's totally unrelated to Factorio:
- Start Evolve and create a party.
- Have players join the party and start Factorio.
- Host a game and have a friend join a game.
- In some random % of the loading, the connecting player will drop
This happens due to Factorio using a lot of the bandwidth available, and Evolve keeps requesting, checking and verifying the connecting between client and server, and clients to each other. Since Factorio is using a lot of the available bandwidth, Evolve's connection drops and resets, disconnecting for a second or so, to then reconnect (after about 1 second). This comes by unnoticed by players, and thinks that Factorio is causing issues.
If you are using Evolve Fish, I suggest to try out with another software, or just use public IP's with NAT with Virtual Servers. Using public IPs makes the game less laggy and loads the map faster, since Evolve does add some overhead to the bandwidth consumption.
Many of us players are using third-party softwares to create virtual LAN, such as Evolve and Hamachi. More specifically with Evolve, this issue is happening, but it's totally unrelated to Factorio:
- Start Evolve and create a party.
- Have players join the party and start Factorio.
- Host a game and have a friend join a game.
- In some random % of the loading, the connecting player will drop
This happens due to Factorio using a lot of the bandwidth available, and Evolve keeps requesting, checking and verifying the connecting between client and server, and clients to each other. Since Factorio is using a lot of the available bandwidth, Evolve's connection drops and resets, disconnecting for a second or so, to then reconnect (after about 1 second). This comes by unnoticed by players, and thinks that Factorio is causing issues.
If you are using Evolve Fish, I suggest to try out with another software, or just use public IP's with NAT with Virtual Servers. Using public IPs makes the game less laggy and loads the map faster, since Evolve does add some overhead to the bandwidth consumption.
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins
The specific condition is it only happens when a new player joins. Saving the game after the player has joined, desynced, left and then loading that map again fixes the problem.psorek wrote:Do you know any specific conditions when this bug appears?
Just to confirm, I wasn't using evolve at the time, and the player gets into the game fine(doesn't drop) then instantly goes into a desync loop. Tested 10 times and it happened 100% of the time.SHiRKiT wrote:<snip>
Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins
It might be specific to the map or to the computers or something else.
We have been playing in 4 people a lot these days, we have been connecting and disconnecting all the time and everything worked fine.
So either a save, log of specification of the player that has this problem would be helpful.
We have been playing in 4 people a lot these days, we have been connecting and disconnecting all the time and everything worked fine.
So either a save, log of specification of the player that has this problem would be helpful.
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins
Okay, my bad, it is related to my PvP mod. I assumed it was the problem from 11.16 because the behaviour was identical.
Anyway, desync report is attached: I was testing this locally on my own computer, but it also happens when playing over the internet.
Saving after desync, quitting and loading the save game fixes the problem for each new player. Also getting everyone into the map with the mod disabled, then saving and reloading with the mod enabled also works.
Anyway, desync report is attached: I was testing this locally on my own computer, but it also happens when playing over the internet.
Saving after desync, quitting and loading the save game fixes the problem for each new player. Also getting everyone into the map with the mod disabled, then saving and reloading with the mod enabled also works.
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins
Okay, been testing(and redoing some stuff), it seems to be related to setting the player force to enemy when player first joins:
Commenting out this line fixes the desync loop, but obviously the player won't be set to the correct team until they die.
Code: Select all
game.onevent(defines.events.onplayercreated, function(event)
local player = game.players[event.playerindex]
if player.character then
player.force = getProperForce(event.playerindex)
player.force.researchalltechnologies()
player.insert{name="pvp-armor", count=1}
player.insert{name="biter-attractor-ON", count=1}
end
end)
function getProperForce(index)
if index % 2 == 0 then
game.getplayer(index).color = {r = 1}
return game.forces.enemy
else
game.getplayer(index).color = {b = 1}
return game.forces.player
end
end
Code: Select all
player.force = getProperForce(event.playerindex)
Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins
Now we are talking 
This seems to be much better clue than in the beginning, we will take a look at it tomorrow I'm almost sure we will find a solution

This seems to be much better clue than in the beginning, we will take a look at it tomorrow I'm almost sure we will find a solution

-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins
I genuinely thought it was the same bug from 11.16, so I didn't take the report seriously until I realised it was my mod causing it.kovarex wrote:This seems to be much better clue than in the beginning, we will take a look at it tomorrow I'm almost sure we will find a solution
I've isolated the problem to the line of code that sets a player onto the enemy team when they first join, so it's definitely something to do with that.
In the mean time, I have a workaround where we can just kill any player that's meant to be on the enemy team, and when they respawn they get put onto the enemy team without any desync issues, so I guess this isn't really an urgent fix.
Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins
Thanks for the report. This problem was actually introduced during bug fixing for 0.11.17 (fix one bug create another
). Anyway it will be fixed for the 0.11.18.
