[0.11.1] Multiplayer mod GUIs broken

This subforum contains all the issues which we already resolved.
JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

[0.11.1] Multiplayer mod GUIs broken

Post by JamesOFarrell »

If you create a GUI object within a mod the next time someone connects you will get an endless cycles of desyncs. If you create the exact same gui with console commands everything works fine. I've attached a mod that creates a button at the top of the screen for all connected players every few seconds (if it doesn't already exist). Running a multiplayer game with this mod will cause the desync every time.
CrashButton_0.0.1.zip
(891 Bytes) Downloaded 173 times
Last edited by JamesOFarrell on Mon Nov 17, 2014 8:23 pm, edited 1 time in total.

jeroon
Filter Inserter
Filter Inserter
Posts: 351
Joined: Sun Jan 26, 2014 10:18 am
Contact:

Re: [0.11.1] Multiplayer mod GUI weirdness

Post by jeroon »

I've tried working around it by having all GUI actions stop the moment someone joins the game, but so far no luck..

JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

Re: [0.11.1] Multiplayer mod GUI weirdness

Post by JamesOFarrell »

I have had luck with a workaround but there is 1 unavoidable desync, either when someone connects or when the game saves depending on the work around you use,

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: [0.11.1] Multiplayer mod GUI weirdness

Post by drs9999 »

Could you also attach the version with the workaround, please?

jeroon
Filter Inserter
Filter Inserter
Posts: 351
Joined: Sun Jan 26, 2014 10:18 am
Contact:

Re: [0.11.1] Multiplayer mod GUI weirdness

Post by jeroon »

https://www.dropbox.com/s/6fdsgp77hdq5k ... l.zip?dl=0

It's a bit messy, but basically what it does is:

In the game.oninit, game.onload and in a function that checks if someone joined/left (simple if #game.players ~= oldnumberofplayers) are flags that delete any current GUI, activate a timer, and once that timer runs out, redraws the GUI.

(For the timer I tried a simple counter++ in the ontick loop, but if timers don't start at the exact same tick, it creates an desync, so now I round off to current tick + 300 )

This solution desyncs once, right after the second player joins, but auto/manual saves are fine.

User avatar
cpy
Filter Inserter
Filter Inserter
Posts: 839
Joined: Thu Jul 31, 2014 5:34 am
Contact:

Re: [0.11.1] Multiplayer mod GUI weirdness

Post by cpy »

Is this mod? Or do you overwrite control in save?

What do you do with that file????

Rseding91
Factorio Staff
Factorio Staff
Posts: 14150
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.11.1] Multiplayer mod GUIs broken

Post by Rseding91 »

Looking at this a much simpler explanation is: mod-added GUIs "game.players[1].gui.top.add()" are not maintained between MP saves.

Adding a GUI with a mod (not the console) in a MP game
Save the game
Exit the game
Load the game back up in MP
The GUi will be gone
If you want to get ahold of me I'm almost always on Discord.

JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

Re: [0.11.1] Multiplayer mod GUIs broken

Post by JamesOFarrell »

Rseding91 wrote:Looking at this a much simpler explanation is: mod-added GUIs "game.players[1].gui.top.add()" are not maintained between MP saves.

Adding a GUI with a mod (not the console) in a MP game
Save the game
Exit the game
Load the game back up in MP
The GUi will be gone
This is correct and a much better way of describing it. When this bug was logged I didn't fully understand what was going on just what was happening. It happens in multiplayer maps opened in single player as well.

kovarex
Factorio Staff
Factorio Staff
Posts: 8194
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.11.1] Multiplayer mod GUIs broken

Post by kovarex »

Hello, thank you for the report.

All the gui created by mods was really removed when loading the game, it is now fixed for 0.11.4, and only the gui of mods that were removed is removed as before.

JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

Re: [0.11.1] Multiplayer mod GUIs broken

Post by JamesOFarrell »

kovarex wrote:Hello, thank you for the report.

All the gui created by mods was really removed when loading the game, it is now fixed for 0.11.4, and only the gui of mods that were removed is removed as before.
Thanks Kovarex, looking forward to getting my hands on 0.11.4.

Post Reply

Return to “Resolved Problems and Bugs”