[0.11.17] Multiplayer Still Desync Loop When New Player Joins

This subforum contains all the issues which we already resolved.

[0.11.17] Multiplayer Still Desync Loop When New Player Joins

Postby FishSandwich » Mon Mar 09, 2015 2:30 pm

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.
Image
FishSandwich
Smart Inserter
Smart Inserter
 
Posts: 1893
Joined: Sun Feb 23, 2014 3:37 pm

Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins

Postby psorek » Mon Mar 09, 2015 2:40 pm

Do you know any specific conditions when this bug appears? Generic joining doesn't cause desync loop.
psorek
Fast Inserter
Fast Inserter
 
Posts: 248
Joined: Thu Mar 07, 2013 3:07 pm

Re: [0.11.17] Multiplayer Games Still Desync When New Player Joins

Postby SHiRKiT » Mon Mar 09, 2015 2:43 pm

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.
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
 
Posts: 675
Joined: Mon Jul 14, 2014 11:52 pm
Location: Brazil

Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins

Postby FishSandwich » Mon Mar 09, 2015 3:25 pm

psorek wrote:Do you know any specific conditions when this bug appears?

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.

SHiRKiT wrote:<snip>

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.
Image
FishSandwich
Smart Inserter
Smart Inserter
 
Posts: 1893
Joined: Sun Feb 23, 2014 3:37 pm

Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins

Postby kovarex » Mon Mar 09, 2015 3:41 pm

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.
kovarex
Factorio Staff
Factorio Staff
 
Posts: 5847
Joined: Wed Feb 06, 2013 12:00 am
Location: Prague

Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins

Postby FishSandwich » Mon Mar 09, 2015 4:04 pm

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:
desync-report-2015-03-09-15-57-08.zip


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.
Image
FishSandwich
Smart Inserter
Smart Inserter
 
Posts: 1893
Joined: Sun Feb 23, 2014 3:37 pm

Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins

Postby FishSandwich » Mon Mar 09, 2015 5:10 pm

Okay, been testing(and redoing some stuff), it seems to be related to setting the player force to enemy when player first joins:

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


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
player.force = getProperForce(event.playerindex)
Image
FishSandwich
Smart Inserter
Smart Inserter
 
Posts: 1893
Joined: Sun Feb 23, 2014 3:37 pm

Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins

Postby kovarex » Mon Mar 09, 2015 5:40 pm

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 :)
kovarex
Factorio Staff
Factorio Staff
 
Posts: 5847
Joined: Wed Feb 06, 2013 12:00 am
Location: Prague

Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins

Postby FishSandwich » Mon Mar 09, 2015 6:07 pm

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

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.
Image
FishSandwich
Smart Inserter
Smart Inserter
 
Posts: 1893
Joined: Sun Feb 23, 2014 3:37 pm

Re: [0.11.17] Multiplayer Still Desync Loop When New Player Joins

Postby slpwnd » Tue Mar 10, 2015 6:18 pm

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.
slpwnd
Factorio Staff
Factorio Staff
 
Posts: 1859
Joined: Sun Feb 03, 2013 2:51 pm
Location: Prague, Czech Rebublic


Return to Resolved Problems and Bugs

Who is online

Users browsing this forum: No registered users and 3 guests