Page 1 of 3

Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 7:58 pm
by slpwnd
This week Blue Cube brings a bit more technical look at the Multiplayer: http://www.factorio.com/blog/post/fff-76

Re: Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 8:17 pm
by MeinAccount
Technical posts are always awesome. :D (I'm a developer myself.)
A peer acting as a proxy sounds like a good idea for future development. Couldn't that also be done by a dedicated server?

Re: Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 8:19 pm
by thuejk
To help with this, in Factorio we implement sort of a buffer time interval (called "latency" when starting the game). This determines amount of time that a peer can wait for anyone's messages without lagging the game. Unfortunately this also causes the game to delay all local actions by this time.
But why do I have to guess the latency manually, instead of the game automatically (and perhaps dynamically) determining it?

Re: Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 8:23 pm
by FrozenOne
Because 0.11 is multiplayer for the brave ones, and if you are not the brave one then you need to wait for 0.12 and finished multiplayer.

Re: Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 8:29 pm
by marsch
I always wondered why you chose such difficult algorithm.

Go on with the Friday facts as usual.

Re: Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 8:54 pm
by Rakshasa
marsch wrote:I always wondered why you chose such difficult algorithm.

Go on with the Friday facts as usual.
Because not going for a deterministic state engine with only delta's passed around would mean we would never have MP in this game.

It isn't original, EVE Online does the same thing to enable 3000+ player fleet fights.

Re: Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 8:59 pm
by pcmaster160
Technical posts are my favorite Friday facts.

I'm curious of the details on what you guys plan in .12 to handle latency better.

Re: Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 9:58 pm
by Marconos
Really enjoyed this. The lock step model is something that I hadn't considered in how information is passed between clients and makes a lot of sense.

Great post, keep them coming.

Re: Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 10:08 pm
by Sharlenwar
Hey Blue Cube! Thanks for writing the post. I love the technical posts to see how the inner workings of Factorio work. Keep it up devs!

Re: Friday Facts #76 - MP inside out

Posted: Fri Mar 06, 2015 11:23 pm
by Narnach
I liked reading it. Nice change of pace. Do write more! :-)

Re: Friday Facts #76 - MP inside out

Posted: Sat Mar 07, 2015 4:57 am
by SHiRKiT
I still think that the buffer should be calculated instead of being an user input.

Also, I suggest you to allow people to a information/data share with the developers. You can create a totally optional checkbox on the options menu that players, when selected, will record some informations and will send to the server (the devs). This can give input on the average user usage of your game. Things like internet speed (?), bandwidth usage, entity count, computer specs etc. I would be one of the players that would gladly share information with the devs, as long as it's anonymous.

Re: Friday Facts #76 - MP inside out

Posted: Sat Mar 07, 2015 9:07 am
by MF-
MeinAccount wrote:Couldn't that also be done by a dedicated server?
Good point.
If I would be paying for a dedicated map storage/server, I would probably like
this particular computer to also help clients with "internet issues".
Or aid with network configuration in general, for that matter.

Re: Friday Facts #76 - MP inside out

Posted: Sat Mar 07, 2015 4:25 pm
by provet
Would it be possible to change the "latency-buffer" in-game in later versions of factorio? Rather than per started server?

Re: Friday Facts #76 - MP inside out

Posted: Sat Mar 07, 2015 5:49 pm
by Xterminator
Even though I am not a programmer and know nothing about programming, I still find these technical posts very interesting. :) I like to see how things behind the screen work for Factorio. Definitely keep the technical type of posts coming in the future!

Re: Friday Facts #76 - MP inside out

Posted: Sat Mar 07, 2015 6:37 pm
by nours77
i dont really like the peer to peer idea, beacause it punish player who have a poor upload like me, 0.75 upload 5.75 download...(i don t want see end game with a lot to upload) I m not in a city and i don t want to go for play factorio... not a good news !

Re: Friday Facts #76 - MP inside out

Posted: Sat Mar 07, 2015 6:57 pm
by Dupl3xxx
nours77 wrote:i dont really like the peer to peer idea, beacause it punish player who have a poor upload like me, 0.75 upload 5.75 download...(i don t want see end game with a lot to upload) I m not in a city and i don t want to go for play factorio... not a good news !
In fact, using P2P is one of the most efficient ways to do it, and because they use lockstep, and as they said in the post itself, there is only a few hundred bytes that is generated each second. Think 0.0003Mbps.
FF#76 wrote:Because people with keyboards can only generate a few hundred bytes per second, this approach scales really well for large maps.
So no, it doesn't punish people with poor upload at all. And even if it did, using P2P doesn't mean it uses more or less bandwidth. And 5.75/0.75 isn't bad at all. More would always be better, but most if not all multiplayer games work with a lot less than 0.75 up. And remember, you only have to send your own input to others, and you receive input from many. In other words, factorio (along with most other multiplayer games) use a lot less upload than download.

Re: Friday Facts #76 - MP inside out

Posted: Sat Mar 07, 2015 8:37 pm
by Richwarf
Why cant you mix both server client and step locking together?

Have the "auto-save" become "auto-push", so all the clients still run on there own but one player pushes there game to all other clients. So this way everyone wins.

I don't know, call it "step server"?

Re: Friday Facts #76 - MP inside out

Posted: Sat Mar 07, 2015 8:43 pm
by ssilk
They currently send as much checksum-data as possible over the line to see as soon as possible if there is some desync.

Re: Friday Facts #76 - MP inside out

Posted: Sun Mar 08, 2015 2:54 am
by albatrosv13
deleted

Re: Friday Facts #76 - MP inside out

Posted: Sun Mar 08, 2015 4:10 am
by ofca
Major changes from current architecture probably won't happen, nor would they be feasible. As to the hundred thousand entities, while one can't dispute their existence, I think there's only one troublesome entity in this game, and it's the more-or-less unpredictable player. Other entities are deterministic to a fault, and one may argue that them behaving differently on multiple ends are either 1) coding errors, 2) result of cheating, or 3) hardware/software errors outside the game, right?

Could you tell us more about your final vision for multiplayer? What are the gains of true full visibility P2P over other solutions? What are your plans for making game playable in scenarios like 10 players playing on LAN and one playing with over 100ms latency or on ZX Spectrum-class machine? ;)