Page 1 of 2

Friday Facts #188 - Bug, Bug, Desync

Posted: Fri Apr 28, 2017 4:01 pm
by Klonan
After a crazy week, here's another dose of the Friday facts: https://www.factorio.com/blog/post/fff-188

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

Posted: Fri Apr 28, 2017 4:16 pm
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?

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

Posted: Fri Apr 28, 2017 4:26 pm
by Dagobert
We love you! :)

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

Posted: Fri Apr 28, 2017 4:26 pm
by sporefreak
Actually, I was surprised it was last Monday. i thought it was next Monday :O

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

Posted: Fri Apr 28, 2017 4:34 pm
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.

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

Posted: Fri Apr 28, 2017 4:35 pm
by Ohz
0.15.1 in 3 hours
0.15.3 in 4 days

You are my heroes <3

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

Posted: Fri Apr 28, 2017 5:19 pm
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. :(

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

Posted: Fri Apr 28, 2017 5:50 pm
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!

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

Posted: Fri Apr 28, 2017 6:00 pm
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:

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

Posted: Fri Apr 28, 2017 6:01 pm
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.

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

Posted: Fri Apr 28, 2017 9:02 pm
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.

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

Posted: Fri Apr 28, 2017 9:22 pm
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

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

Posted: Fri Apr 28, 2017 10:16 pm
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.

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

Posted: Fri Apr 28, 2017 10:17 pm
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.

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

Posted: Fri Apr 28, 2017 10:49 pm
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

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

Posted: Sat Apr 29, 2017 12:22 am
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!!

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

Posted: Sat Apr 29, 2017 1:39 am
by hitzu
So, what now the plans for 0.16? :D

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

Posted: Sat Apr 29, 2017 3:08 am
by ThorsDragon
YOU GUYS ARE AWESOME!!!! THANKS FOR ONE OF THE BEST GAMES EVER!!!!!!!!!!!!!!!!! :D

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

Posted: Sat Apr 29, 2017 11:18 am
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.

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

Posted: Sat Apr 29, 2017 11:46 am
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.