Friday Facts #188 - Bug, Bug, Desync

Regular reports on Factorio development.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5290
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Friday Facts #188 - Bug, Bug, Desync

Post by Klonan »

After a crazy week, here's another dose of the Friday facts: https://www.factorio.com/blog/post/fff-188
matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by matjojo »

That speaker setup was really quick

Will there ever be a way to upload the desync reports ingame, or maybe automatically to the forum?
Dagobert
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Nov 02, 2014 5:25 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by Dagobert »

We love you! :)
User avatar
sporefreak
Fast Inserter
Fast Inserter
Posts: 183
Joined: Sun Apr 17, 2016 12:55 am
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by sporefreak »

Actually, I was surprised it was last Monday. i thought it was next Monday :O
sparr
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by sparr »

In before anyone complains about a low-content FFF before they think about what the devs have been spending their time on this week.
User avatar
Ohz
Fast Inserter
Fast Inserter
Posts: 199
Joined: Tue Feb 03, 2015 11:40 am
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by Ohz »

0.15.1 in 3 hours
0.15.3 in 4 days

You are my heroes <3
I'm not english, sorry for my mistakes
User avatar
MnHebi
Inserter
Inserter
Posts: 41
Joined: Thu Jun 16, 2016 5:17 am
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by MnHebi »

I don't have a archive folder despite having had desyncs...
One including where I desynced from a server. and every attempt to join after that lead to desync during the joining process. :(
mattj256
Fast Inserter
Fast Inserter
Posts: 203
Joined: Sun Mar 27, 2016 7:25 am
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by mattj256 »

Ohz wrote:0.15.1 in 3 hours
0.15.3 in 4 days

You are my heroes <3
Wait, you're up to 15.3 already? *Scrambles to read release notes.*
We love you!
joon
Fast Inserter
Fast Inserter
Posts: 133
Joined: Mon Jan 19, 2015 7:11 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by joon »

After 3 years it still surprises me how good the dev team is. It's awesome to see how they handle a new update, bugfixing and making it run so smooth.
Great job guys ;) To many years of Factorio : :mrgreen:
KrzysD
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Mon Oct 27, 2014 6:49 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by KrzysD »

Ok Wube enough about .15 when is .16 coming out!? :lol: :lol: :lol:

Just kidding! You guys are doing a great job, I just wish other devs would learn from you.
hoho
Filter Inserter
Filter Inserter
Posts: 681
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by hoho »

I've been too busy enjoying 0.15 to really say much about the game on forums. It's just pure awesomeness, as usual.
JoeWhizer
Inserter
Inserter
Posts: 40
Joined: Thu Dec 29, 2016 4:42 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by JoeWhizer »

Really enjoying 0.15. Thanks to the whole team for the great work!

I just have a question, because I'm a bit confused about lockstep. I know that Path of Exile changed their netcode from predictive to lockstep with 2.0 and this pretty much completely solved desync issues, because there is only one version of the map running. An issue though is that you have a hard time playing with more than 100-150ms latency.

https://www.pathofexile.com/forum/view-thread/1262596
Deterministic Lockstep: When you perform an action, it is sent to the server for confirmation before it is shown to you. In this mode everything will stay completely in sync, including all monsters. There is a delay equal to your latency to the server. If you suffer from an internet lag spike, everything stops moving until you receive more data. This mode is amazing if you have low latency to the server.

Could someone explain why Deterministic Lockstep is causing desync in Factorio while it solved desyncs in Path of Exile?
Are there different approaches to implement lockstep into a game?

What you've explained in the FFF seems to me that there is still more than one copy of a map running at the same time.

Thanks and great weekend to you guys, well deserved!
Joe
exi2163
Inserter
Inserter
Posts: 38
Joined: Wed Mar 09, 2016 6:50 am
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by exi2163 »

Easiest example of why a desync occurs would be via mods. For example you could write a mod that increases your inventory count of wood by 1 if you run left. If you just iterate your local gamestate and increase the wood instead of telling all running clients to increase the wood in inventory of player x by 1 the game state will be different and the game detects a desync.

As soon as multithreading is involved the complexity of having lockstep multiplies. For example if one cpu takes 20 cycles to compute something while on the other pc the task is rescheduled and has to wait the first cpu might calculate something else next (because of jump prediction or some other optimization magic). This has to be catched and synchronized in software or the game will desync.
anstow
Burner Inserter
Burner Inserter
Posts: 10
Joined: Mon Mar 16, 2015 10:34 am
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by anstow »

Hi Joe,

I don't know a huge amount about the internals of either game so you should take what I say with a pinch of salt.
JoeWhizer wrote:Could someone explain why Deterministic Lockstep is causing desync in Factorio while it solved desyncs in Path of Exile?
Are there different approaches to implement lockstep into a game?
I believe that the answer is in part in the article you quoted

"...while Deterministic Lockstep mode guarantees no desync in theory, the practical results depend on all the gameplay code being completely bug-free..."

guaranteeing your code is bug-free is really difficult. It is especially difficult when you're supporting multiple platforms with multiple compilers, and are allowing mods to run almost arbitrary code on each machine. Not to mention the lag hiding.
JoeWhizer wrote:What you've explained in the FFF seems to me that there is still more than one copy of a map running at the same time.
For deterministic lockstep you need a copy of the game running per machine, which are all kept in sync (hence "lockstep").

I hope that helps for now, I'm sure someone else will jump in if I've made any huge error.
JoeWhizer
Inserter
Inserter
Posts: 40
Joined: Thu Dec 29, 2016 4:42 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by JoeWhizer »

I agree, the bug-argument make sense for some circumstanced. I did read that as well but while lockstep was lately introduced in PoE, all skills and calculations was based on client predictive mode and everything needed to be re-written for lockstep. I don't think this is the case for Factorio.
For deterministic lockstep you need a copy of the game running per machine, which are all kept in sync (hence "lockstep").
Also, this is in contradiction of what Chris Wilson says and for Path of Exile this is not true. There is only one map running on the server and this version is send to the client. When you run an action on the client, it first has to be send to the server for confirmation, the character on the server will be moved and a confirmation will be send back to the client.

For Client-Predictive mode there are two versions of the map runnung, one of the client and one of the server. And actions are send to the server while performing the action on the client will be done before a confirmation was sent back. That could result in a desync because due to the latency the results of the actions may vary and you are running into two different versions of the map (desync) instead of having two identical versions of the map (in-sync).

Of course the map is loaded into every computers memory, but it should not be running separately from the server when in lockstep mode, because all actions you do need to be confirmed by the server first before the client will perform them.

I do understand that the games are in a lot of things very different, that was why I did ask.

Thanks,
Joe
User avatar
vaderciya
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Nov 07, 2015 1:55 am
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by vaderciya »

I fucking LOVE this update, this is exactly the high quality high quantity improvements, changes, and additions we've come to know and love from the factorio dev team. Please never change!!
User avatar
hitzu
Filter Inserter
Filter Inserter
Posts: 539
Joined: Tue Sep 09, 2014 5:55 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by hitzu »

So, what now the plans for 0.16? :D
ThorsDragon
Inserter
Inserter
Posts: 46
Joined: Mon Jul 04, 2016 7:29 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by ThorsDragon »

YOU GUYS ARE AWESOME!!!! THANKS FOR ONE OF THE BEST GAMES EVER!!!!!!!!!!!!!!!!! :D
Loewchen
Global Moderator
Global Moderator
Posts: 9307
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by Loewchen »

MnHebi wrote:I don't have a archive folder despite having had desyncs...
One including where I desynced from a server. and every attempt to join after that lead to desync during the joining process. :(
You need to stay on the server for the map to be downloaded again to create the report.
AcolyteOfRocket
Fast Inserter
Fast Inserter
Posts: 124
Joined: Sun Mar 06, 2016 9:58 pm
Contact:

Re: Friday Facts #188 - Bug, Bug, Desync

Post by AcolyteOfRocket »

I don't know if this is a thing, but I have noticed the game graphics look like they are rubber-banding when I run around while zoomed in.

I mention this because the effect is similar to a deterministic lockstep (multiworld) game I programmed myself many years ago, and I am wondering if you changed something in that area recently. You might want to you look into it as the effect is quite annoying, but its only noticeable when you move around while zoomed in - If you zoom out the effect reduces until its not an issue anymore.

Of course it could be my graphics card, but effect seems only to apply to the terrain, not my character.

I was playing single player, not multi.
Post Reply

Return to “News”