Friday Facts #46

Regular reports on Factorio development.
_aD
Fast Inserter
Fast Inserter
Posts: 212
Joined: Sat Apr 12, 2014 12:03 am
Contact:

Re: Friday Facts #46

Post by _aD »

bobingabout wrote:...mine is supposed to be 1Mbps up and 8Mbps down, but last time I checked it was only 500kbps up, due to poor line quality.
Andrews and Arnold can almost certainly help you with that.

DWMagus
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Aug 25, 2014 11:21 pm
Contact:

Re: Friday Facts #46

Post by DWMagus »

I apologize if this was already asked before, but I haven't caught up on all the dev logs and I had a couple questions regarding this dev update;
  1. In a peer-to-peer situation like this, if one of the 'players' is basically set to invulnerability (through some means) then doesn't it basically turn into a client/server connection?
  2. In relation to a true client/server setup, would it make more sense to do things the way AVI codecs do things? i.e. Transfer all data only very few times and then just transfer differencing states instead of the entire game state? As a subset, can there be logic in differenced states so that not everything is transferred? If you place an item on a belt, you only need to transmit that an item was placed on the belt and trust that the clients will move the item accordingly rather than transferring constant updates about that item?
  3. Last, since it definitely seems a lot of thought was put into the different ideas regarding multiplayer, are there any plans to put together a write-up or some other information regarding "The Theory Behind Factior"? Something that explains why you guys decided to do things a specific way.
Thanks again for making such a wonderful game. :)

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

Re: Friday Facts #46

Post by kovarex »

DWMagus wrote:I apologize if this was already asked before, but I haven't caught up on all the dev logs and I had a couple questions regarding this dev update;
  1. In a peer-to-peer situation like this, if one of the 'players' is basically set to invulnerability (through some means) then doesn't it basically turn into a client/server connection?
  2. In relation to a true client/server setup, would it make more sense to do things the way AVI codecs do things? i.e. Transfer all data only very few times and then just transfer differencing states instead of the entire game state? As a subset, can there be logic in differenced states so that not everything is transferred? If you place an item on a belt, you only need to transmit that an item was placed on the belt and trust that the clients will move the item accordingly rather than transferring constant updates about that item?
  3. Last, since it definitely seems a lot of thought was put into the different ideas regarding multiplayer, are there any plans to put together a write-up or some other information regarding "The Theory Behind Factior"? Something that explains why you guys decided to do things a specific way.
Thanks again for making such a wonderful game. :)
True client server setup really isn't possible, as we just can't send the whole map, or map changes. we need to rely on deterministic game.

Maybe we could try some technical blog, but we have a lot of times on our hands already, maybe when we get more people :)

Wynillo
Burner Inserter
Burner Inserter
Posts: 5
Joined: Wed Aug 20, 2014 11:39 am
Contact:

Re: Friday Facts #46

Post by Wynillo »

Can't wait. To shoot my brother. Ingame ofc.


Wibble di wabble di du!

shadoh
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Aug 13, 2014 8:18 pm
Contact:

Re: Friday Facts #46

Post by shadoh »

kovarex wrote: True client server setup really isn't possible, as we just can't send the whole map, or map changes. we need to rely on deterministic game.

Maybe we could try some technical blog, but we have a lot of times on our hands already, maybe when we get more people :)
Just curious, why couldn't deterministic style networking be done over client-server?

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: Friday Facts #46

Post by cube »

shadoh wrote:
kovarex wrote: True client server setup really isn't possible, as we just can't send the whole map, or map changes. we need to rely on deterministic game.

Maybe we could try some technical blog, but we have a lot of times on our hands already, maybe when we get more people :)
Just curious, why couldn't deterministic style networking be done over client-server?
It could be done that way, but you would essentially lose all the the advantages of client-server (mainly the centralized game state) and gain all of its disadvantages (double latencies). When only the user inputs are transfered, peer to peer architecture comes as a natural result (IMO :-) ).

User avatar
Penrif
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Aug 25, 2014 7:22 pm
Contact:

Re: Friday Facts #46

Post by Penrif »

Indeed, there are games out there that use deterministic simulation to keep bandwidth low but still operate under client-server in order to preserve security. I work on one ;)

In the case of Factorio however, security isn't that huge of a deal, since presumably you're playing with people you like anyway so if they cheat there's the natural consequence of you liking them less. Keeping latency down however is critical - if you have to wait for a round-trip for any input to be recognized the game won't be enjoyable on anything above ~50ms ping. I wager even having the single-trip latency of needing all inputs before simulating might be killer, leading to the need to have a prediction-rollback scheme.

All good fun, and a helluva lot of work.

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

Re: Friday Facts #46

Post by kovarex »

Penrif wrote:Indeed, there are games out there that use deterministic simulation to keep bandwidth low but still operate under client-server in order to preserve security. I work on one ;)

In the case of Factorio however, security isn't that huge of a deal, since presumably you're playing with people you like anyway so if they cheat there's the natural consequence of you liking them less. Keeping latency down however is critical - if you have to wait for a round-trip for any input to be recognized the game won't be enjoyable on anything above ~50ms ping. I wager even having the single-trip latency of needing all inputs before simulating might be killer, leading to the need to have a prediction-rollback scheme.

All good fun, and a helluva lot of work.
Good to hear from someone who has practical experience with this, as we just try to predict and operate theoretically.

Our plan is not to have rollback scheme, as I believe it is almost imbossible in the case of Factorio. We would rather have something we call "locale state". Some addition to the "true game state" that would make the player feel like his actions were executed instantly, while they will be transferred to the true state with delay.

The example is when the player presses right, he wants to go right. The input action to go right in the true state might be processed 60 ticks from now (for example with big lag, that is one second), but I can create my local copy of the player entity and simulate on that one, that it was in fact executed instantly and so the player will see that he moved to the right instantly. Every tick, the local copy of the player entity will be copied from the true state, and all of the "waiting to be applied actions" will be re-applied on this one. It can always happen, that when the action to move right is really executed, something different happens: Someone builds building in the way for example. In that case the mechanism, without the need to do anything else, will automatically move the player back to where he stood one second ago. But as I expect that these kind of situations are going to be rare, and I also expect the delay to be much less than a second, I believe it should be usable.

There could be other things, like "local buildings built" etc.

This would allow the player to operate almost the same as there is no lag, the only problem would arise when two players interact, or the player interacts moving objects etc. But as the game isn't 3d shooter, it shouldn't be a big problem I hope.

What do you think about this theoretical idea? :)

User avatar
Penrif
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Aug 25, 2014 7:22 pm
Contact:

Re: Friday Facts #46

Post by Penrif »

kovarex wrote:In that case the mechanism, without the need to do anything else, will automatically move the player back to where he stood one second ago.
Yup, this is what I mean by a prediction-rollback scheme, you're just describing it for a single object - the player. In general, you have your "true state" as the agreed upon authoritative state of the world, and then the "client state" as each client's speculative state of the world. When a divergence is found - where input into the true state makes commands that were speculated upon in the client state invalid - you need to throw out the client state and re-evolve from the new true state to a new speculative state. That's what I mean by roll-back, not trying to undo commands to derive a previous state, but to re-evolve from a point of conflict between the true state and the speculative state to form a new speculative state without that conflict.

In short, you got the right idea. A general solution for all entities might save you some pain.

shadoh
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Aug 13, 2014 8:18 pm
Contact:

Re: Friday Facts #46

Post by shadoh »

cube wrote: It could be done that way, but you would essentially lose all the the advantages of client-server (mainly the centralized game state) and gain all of its disadvantages (double latencies). When only the user inputs are transfered, peer to peer architecture comes as a natural result (IMO :-) ).
Ok, I see what you're saying :) it's just the internet is not a perfect place. And I hope I don't experience the endless issues I get with games like command & conquer 3, which we have to play through hamachi. Time will tell, I suppose.

User avatar
Penrif
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Aug 25, 2014 7:22 pm
Contact:

Re: Friday Facts #46

Post by Penrif »

Thinking more about the kind of divergence you're likely to see, I reckon the most common one will be to do with factories. Taking/putting items is likely to cascade to a change in outputs of that factory. Normally you'd look to rollback-resimulate an area around the factory in that case, limited by the possible extent that divergence could travel. Unfortunately, with logistics robots that decision could cascade to the other side of the logistics network instantly.

Oye.

MrYodaylay
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Jan 23, 2015 11:39 am
Contact:

Re: Friday Facts #46

Post by MrYodaylay »

There seems to be a lot of concern floating around about huge de-sync errors and the game being unplayable, yet just the other day, I had a 7 hour multiplayer game over the internet without any errors of any kind.

My main concern at the moment is the map download time, after seven hours of building, (when we tried to join the map again the next day) the map download time reached almost 10 minutes, and I have 1.5 megabyte per second upload and 7 download.


Also,
Australian internet isn't really that bad, as I said, I get 7 megabytes per second download and 1.5 upload. :D

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Friday Facts #46

Post by Koub »

MrYodaylay wrote:Also,
Australian internet isn't really that bad, as I said, I get 7 megabytes per second download and 1.5 upload. :D
by Penrif » Thu Aug 28, 2014 11:47 am ==> by MrYodaylay » Fri Jan 23, 2015 12:54 pm

Sorry mate, you have almost 5 months of ping ... Australian internet isn't that great either :lol:
Koub - Please consider English is not my native language.

MrYodaylay
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Jan 23, 2015 11:39 am
Contact:

Re: Friday Facts #46

Post by MrYodaylay »

I just noticed that big number 46......... :lol: I don't know what I clicked on that brought me here.

DRBLN
Filter Inserter
Filter Inserter
Posts: 411
Joined: Sat Mar 23, 2013 12:44 pm
Contact:

Re: Friday Facts #46

Post by DRBLN »

please add multiplayer to the game.

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

Re: Friday Facts #46

Post by jeroon »

/agreed

and tanks, and gates!

Post Reply

Return to “News”