[0.11.1] Multiplayer mod GUIs broken
-
- Filter Inserter
- Posts: 402
- Joined: Fri May 23, 2014 8:54 am
- Contact:
[0.11.1] Multiplayer mod GUIs broken
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.
Last edited by JamesOFarrell on Mon Nov 17, 2014 8:23 pm, edited 1 time in total.
Re: [0.11.1] Multiplayer mod GUI weirdness
I've tried working around it by having all GUI actions stop the moment someone joins the game, but so far no luck..
-
- Filter Inserter
- Posts: 402
- Joined: Fri May 23, 2014 8:54 am
- Contact:
Re: [0.11.1] Multiplayer mod GUI weirdness
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,
Re: [0.11.1] Multiplayer mod GUI weirdness
Could you also attach the version with the workaround, please?
Re: [0.11.1] Multiplayer mod GUI weirdness
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.
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.
Re: [0.11.1] Multiplayer mod GUI weirdness
Is this mod? Or do you overwrite control in save?
What do you do with that file????
What do you do with that file????
Re: [0.11.1] Multiplayer mod GUIs broken
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
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.
-
- Filter Inserter
- Posts: 402
- Joined: Fri May 23, 2014 8:54 am
- Contact:
Re: [0.11.1] Multiplayer mod GUIs broken
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.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
Re: [0.11.1] Multiplayer mod GUIs broken
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.
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.
-
- Filter Inserter
- Posts: 402
- Joined: Fri May 23, 2014 8:54 am
- Contact:
Re: [0.11.1] Multiplayer mod GUIs broken
Thanks Kovarex, looking forward to getting my hands on 0.11.4.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.