Page 1 of 2

Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 1:22 pm
by FactorioBot

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 1:23 pm
by BattleFluffy
wooo :D

This was a fascinating read. Looking forward to my next multiplayer session now.. :>

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 1:29 pm
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.

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 1:42 pm
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.

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 2:10 pm
by ske
Twinsen, you are a hero!

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 2:35 pm
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

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 3:22 pm
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?

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 4:00 pm
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.

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 4:29 pm
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 :).

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 4:35 pm
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.

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 4:38 pm
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.)

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 4:50 pm
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.

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 5:17 pm
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.

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 7:13 pm
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

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 7:34 pm
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.

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 9:14 pm
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?

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Fri Jul 05, 2019 10:10 pm
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.

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Sat Jul 06, 2019 9:26 am
by Unknow0059
Clusterio is /r/nextfuckinglevel

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Sat Jul 06, 2019 9:30 am
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.

Re: Friday Facts #302 - The multiplayer megapacket

Posted: Sat Jul 06, 2019 10:38 am
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