Friday Facts #302 - The multiplayer megapacket

Regular reports on Factorio development.
User avatar
FactorioBot
Factorio Staff
Factorio Staff
Posts: 422
Joined: Tue May 12, 2015 1:48 pm

Friday Facts #302 - The multiplayer megapacket

Post by FactorioBot »

User avatar
BattleFluffy
Fast Inserter
Fast Inserter
Posts: 200
Joined: Sun Mar 31, 2019 4:58 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by BattleFluffy »

wooo :D

This was a fascinating read. Looking forward to my next multiplayer session now.. :>
Last edited by BattleFluffy on Fri Jul 05, 2019 1:33 pm, edited 1 time in total.
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 525
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by Mylon »

Why does the game state need to know what entity the player has selected anyhow? If the player executes an action, pass that action to the server rather than passing the player.selected property. This seems like an unnecessary linkage between view and controller of model/view/controller design.
User avatar
ledow
Fast Inserter
Fast Inserter
Posts: 102
Joined: Sat Sep 24, 2016 3:00 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by ledow »

In terms of debugging multiplayer, can't you just pull a frozen state out of the multiplayer server for offline replay for, say, the last dozen ticks?

Then if you crash out, you could instruct the server to send you that state, and then replay it offline to your heart's content without interfering with other people's games and without having to guess, by proper breakpointing and retrace?

I'm sure that's how everything multiplayer since the days of Doom has done debugging on multiplayer games.
ske
Filter Inserter
Filter Inserter
Posts: 412
Joined: Sat Oct 17, 2015 8:00 am
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by ske »

Twinsen, you are a hero!
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by ratchetfreak »

If it were me I'd have added another edge case, if the packet has too many selection changes, delete them all from the queue instead have it send single absolute value.

But I'm sure there'd be issues with that as well
Ultros
Fast Inserter
Fast Inserter
Posts: 129
Joined: Thu Apr 04, 2019 4:25 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by Ultros »

What exactly are the giant basketball hoop and the four pillars entities in the video linked in the FFF?

I've only played on .17, but they don't look like any .16 graphics entity I know of. Are mods allowed on specific clusterio servers?
User avatar
Lubricus
Filter Inserter
Filter Inserter
Posts: 298
Joined: Sun Jun 04, 2017 12:13 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by Lubricus »

Mylon wrote: ↑Fri Jul 05, 2019 1:29 pm Why does the game state need to know what entity the player has selected anyhow? If the player executes an action, pass that action to the server rather than passing the player.selected property. This seems like an unnecessary linkage between view and controller of model/view/controller design.
I was thinking the same. Other players don't have to see what you have selected and what you have selected shouldn't directly influence any gamestate that have effect on other players. Similar to the details on mouse movements.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2370
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by Jap2.0 »

Lubricus wrote: ↑Fri Jul 05, 2019 4:00 pm
Mylon wrote: ↑Fri Jul 05, 2019 1:29 pm Why does the game state need to know what entity the player has selected anyhow? If the player executes an action, pass that action to the server rather than passing the player.selected property. This seems like an unnecessary linkage between view and controller of model/view/controller design.
I was thinking the same. Other players don't have to see what you have selected and what you have selected shouldn't directly influence any gamestate that have effect on other players. Similar to the details on mouse movements.
I don't know - can mods do things when you hover over something? Does the server tell clients what you click on, or just that you click?

Edit - all very interesting, by the way. I'm looking forward to testing it out :).
There are 10 types of people: those who get this joke and those who don't.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 579
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by raiguard »

Jap2.0 wrote: ↑Fri Jul 05, 2019 4:29 pm
Lubricus wrote: ↑Fri Jul 05, 2019 4:00 pm
Mylon wrote: ↑Fri Jul 05, 2019 1:29 pm Why does the game state need to know what entity the player has selected anyhow? If the player executes an action, pass that action to the server rather than passing the player.selected property. This seems like an unnecessary linkage between view and controller of model/view/controller design.
I was thinking the same. Other players don't have to see what you have selected and what you have selected shouldn't directly influence any gamestate that have effect on other players. Similar to the details on mouse movements.
I don't know - can mods do things when you hover over something? Does the server tell clients what you click on, or just that you click?

Edit - all very interesting, by the way. I'm looking forward to testing it out :).
Yes, my mod absolutely depends on player.selected. If they were to take that out, my mod would not work at all in multiplayer.
Don't forget, you're here forever.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2370
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by Jap2.0 »

Raiguard wrote: ↑Fri Jul 05, 2019 4:35 pm
Jap2.0 wrote: ↑Fri Jul 05, 2019 4:29 pm
Lubricus wrote: ↑Fri Jul 05, 2019 4:00 pm
Mylon wrote: ↑Fri Jul 05, 2019 1:29 pm Why does the game state need to know what entity the player has selected anyhow? If the player executes an action, pass that action to the server rather than passing the player.selected property. This seems like an unnecessary linkage between view and controller of model/view/controller design.
I was thinking the same. Other players don't have to see what you have selected and what you have selected shouldn't directly influence any gamestate that have effect on other players. Similar to the details on mouse movements.
I don't know - can mods do things when you hover over something? Does the server tell clients what you click on, or just that you click?

Edit - all very interesting, by the way. I'm looking forward to testing it out :).
Yes, my mod absolutely depends on player.selected. If they were to take that out, my mod would not work at all in multiplayer.
Well there's everyone's answer :P.
(also, there's a debug option that shows what everyone has selected in multiplayer. I like to leave it on, just for fun.)
There are 10 types of people: those who get this joke and those who don't.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by eradicator »

@Raiguard: Which one? Tapemeasure at least seems to not need them seperate.
Jap2.0 wrote: ↑Fri Jul 05, 2019 4:29 pm I don't know - can mods do things when you hover over something? Does the server tell clients what you click on, or just that you click?
Currently "pressed a button" and "selected something" are different events. If i.e. my mod needs to know "did player click on my_building" then i have to listen for the "pressed mouse button" event and then in that event check what the player has currently selected. So theoretically most things could still be done if the two events where combined into a single "player pressed button on something" event. Practically it would be a lot of work to change all existing mods, and of course you lose the edge-case scenarios where you actually want only the selection event, i.e. for some mods that let you "manually revive" ghosts just by hovering them, etcpp.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
OvermindDL1
Fast Inserter
Fast Inserter
Posts: 193
Joined: Sun Oct 05, 2014 6:12 am
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by OvermindDL1 »

eradicator wrote: ↑Fri Jul 05, 2019 4:50 pm @Raiguard: Which one? Tapemeasure at least seems to not need them seperate.
Jap2.0 wrote: ↑Fri Jul 05, 2019 4:29 pm I don't know - can mods do things when you hover over something? Does the server tell clients what you click on, or just that you click?
Currently "pressed a button" and "selected something" are different events. If i.e. my mod needs to know "did player click on my_building" then i have to listen for the "pressed mouse button" event and then in that event check what the player has currently selected. So theoretically most things could still be done if the two events where combined into a single "player pressed button on something" event. Practically it would be a lot of work to change all existing mods, and of course you lose the edge-case scenarios where you actually want only the selection event, i.e. for some mods that let you "manually revive" ghosts just by hovering them, etcpp.
Tapemeasure uses a blueprint to get extents, so it wouldn't.

Look at a mod like the Picker Pipe Tools (I think was the name), it shows overlays of the entire pipe network and dead-ends and all just based on the position of the mouse (of any player); it feels integrated and a natural part of the game.
Twinsen
Factorio Staff
Factorio Staff
Posts: 1348
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by Twinsen »

Mylon wrote: ↑Fri Jul 05, 2019 1:29 pm Why does the game state need to know what entity the player has selected anyhow? If the player executes an action, pass that action to the server rather than passing the player.selected property. This seems like an unnecessary linkage between view and controller of model/view/controller design.
Since it was done super long ago, probably only kovarex knows the real answer.
But I can think of 3 reasons:
- we tend to put as much as possible in the game state. By having almost all game information in the game state, it's less probable to cause desyncs, and it's generally easier to work with code wise.
- keeps actions like open entity, rotate entity, copy settings, paste settings, shoot, etc quite simple and small since they don't need to send the selected entity.
- more flexibility for mods, as mentioned above
posila
Factorio Staff
Factorio Staff
Posts: 5341
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by posila »

In addition, since LuaControl::selected exists in the API, entity selection input action has to be sent anyway. And I haven't check but I would say the API property is older than multiplayer.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2370
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by Jap2.0 »

I've been playing online some (redmew mostly) and it seems that a decent number of people agree that lag/latency (especially in combat) got worse in .54, what are everyone else's thoughts?
There are 10 types of people: those who get this joke and those who don't.
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 525
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by Mylon »

Raiguard wrote: ↑Fri Jul 05, 2019 4:35 pm
Jap2.0 wrote: ↑Fri Jul 05, 2019 4:29 pm
Lubricus wrote: ↑Fri Jul 05, 2019 4:00 pm
Mylon wrote: ↑Fri Jul 05, 2019 1:29 pm Why does the game state need to know what entity the player has selected anyhow? If the player executes an action, pass that action to the server rather than passing the player.selected property. This seems like an unnecessary linkage between view and controller of model/view/controller design.
I was thinking the same. Other players don't have to see what you have selected and what you have selected shouldn't directly influence any gamestate that have effect on other players. Similar to the details on mouse movements.
I don't know - can mods do things when you hover over something? Does the server tell clients what you click on, or just that you click?

Edit - all very interesting, by the way. I'm looking forward to testing it out :).
Yes, my mod absolutely depends on player.selected. If they were to take that out, my mod would not work at all in multiplayer.
I'm not saying to remove player.selected property. But the player.selected event. You could still fetch it via a hotkey or possibly a timer. This could lead to some weird edge cases in multiplayer where the server asks, "What do you have selected?" And before the server gets the client's reply, the entity could be removed so mods would have to validate it to avoid an error.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by eradicator »

OvermindDL1 wrote: ↑Fri Jul 05, 2019 5:17 pm Tapemeasure uses a blueprint to get extents, so it wouldn't.
I have no clue what you tried to say there, but tapemeasure uses a capsule.
Mylon wrote: ↑Fri Jul 05, 2019 10:10 pm I'm not saying to remove player.selected property. But the player.selected event.
The event is a consequence of syncing the "selected" input action as far as i understand. Thus "removing the event" would only reduce moddability while doing nothing for latency. And besides the server doesn't "ask" stuff as explained in the FFF.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
ukezi
Filter Inserter
Filter Inserter
Posts: 390
Joined: Sat Jul 02, 2016 11:02 pm
Contact:

Re: Friday Facts #302 - The multiplayer megapacket

Post by ukezi »

Ultros wrote: ↑Fri Jul 05, 2019 3:22 pm What exactly are the giant basketball hoop and the four pillars entities in the video linked in the FFF?

I've only played on .17, but they don't look like any .16 graphics entity I know of. Are mods allowed on specific clusterio servers?
That would be the clusterio custom entity that does the sending and receiving of stuff. Clusterio itself is a mod. You could probably also play it with bob's or angel+bob's
Post Reply

Return to β€œNews”