Friday Facts #75 - False hopes

Regular reports on Factorio development.
dee-
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Jan 19, 2015 9:21 am
Contact:

Re: Friday Facts #75 - False hopes

Post by dee- »

As Factorio's behaviour is specifically designed to be deterministic you won't have to send every position and state of everything to all clients - those clients can calculate for themselves where all the items are on any future time chosen.
So say you have a massive factory with tens of thousands items moving around, inserters grabbing, etc. An initial state is sent to all clients and from then on - nothing has to be sent ever again. Every client can simulate the factory for itself and they will match perfectly 1:1.
Now the interesting thing is when something changes on one client that is not deterministic, which in our case is user interaction. The game does not know when a user does whatever to the simulation so it is not able to simulate this change, therefore this new input has to be sent to all other clients so they can incorporate this change to their simulation. After the "interruption" by the user, nothing has to be send again, because then the determinism kicks in again and all clients simulate everything the same way, keeping them in sync.
Therefore it is irrellevant how many items are moving, things are doing stuff, etc.
What is relevant however how many interruptions of the determinism occur, that is, how many things players do happen, because these have to be synchronized between the clients.

That aside the question is now - does it make more sense to propagate the "interruptions" through P2P or through a central hub? P2P has a faster RTT as every connection is direct, whereas a host has at least one step more. Then again I can't say how Factorio's tick system is implemented internally and which approach makes more sense. That the devs have to decide.
If it has been abstracted good enough it should be possible to swap the implementations halfway easy enough to test both / change in the future if demands arise as it's just a transfer protocol.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by slpwnd »

bobingabout wrote:Lets first assume P2P relationship, because, many of the posts here, and even you, the devs, insist is the only options.
From the experience I have with multiplayer, you have a pre-defined server "latency" setting, lets say 500ms (because, anything else is stupid when trying to play with someone on the oposite side of the planet) You press W to move north, you wait half a second, then you start to move north. Why? Because you have those 30 ticks worth of action pre-processed, so when it sends the "I pressed W" command to the other peers, the commands are all syncronised.
We are well aware that this is a big annoyance, but this is something that will be addressed in 0.12. We plan to introduce a kind of hybrid approach inspired by Quake where some of the input actions (moving, building, etc.) would seem to take effect immediately. However they would be kept in a temporary running queue and be actually applied to the simulation only in the proper order defined by incoming ticks from other peers. If for some reason the action is not possible (should be very rare - for instance another player moved to the place where I wanted to build something) it would be discarded and the player who made it would get kind of a "glitch" (suddenly a building he thought he build would disappear or so). But again this would be rather rare.
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by SHiRKiT »

slpwnd wrote:We are well aware that this is a big annoyance, but this is something that will be addressed in 0.12. We plan to introduce a kind of hybrid approach inspired by Quake where some of the input actions (moving, building, etc.) would seem to take effect immediately. However they would be kept in a temporary running queue and be actually applied to the simulation only in the proper order defined by incoming ticks from other peers. If for some reason the action is not possible (should be very rare - for instance another player moved to the place where I wanted to build something) it would be discarded and the player who made it would get kind of a "glitch" (suddenly a building he thought he build would disappear or so). But again this would be rather rare.
This is a solution, but it can be quite tricky: clients would need to be able to undo actions, remembering what was done in the past and correct the future game state.
Also, if you introduce this kind of stuff, when you hold down the F key while standing in a running factory with 10 express belts side by side, things may explode.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by bobingabout »

GewaltSam wrote:I can't believe that your internet connection really is the problem. May I ask what kind of connection you and your friend are having? I am playing with someone literally (at least virtually ;) ) on the other side of the world (Central Europe to California). We both have passable connections, but nevertheless 200ms just because of the distance. 200ms lag isn't great to begin with, but it's fine after one gets used to it. And other than the map download, I can't say that there is that much traffic going on between us (although the map is 40MB big, and the simulation itself is getting so complex that my CPU can't keep up without some engine performance tweaks; that's another story though).
Mine is in England, 8Mbps down, 512kbps up. His is in Australia, 1Mbps down, 100kbps up. MINIMUM ping is 350ms, average ping is 450ms, to make factorio happy, a latency of 500ms is required. we were able to play multiplayer in 0.11.2, but by 0.11.5 our game was about 5 frames of play, followed by a 10 second pause. According to our diagnostics, this was due to Factorio's traffic usage, his 100kbps pipe was too slow to transmit everything his instance Factorio was trying to send to mine. This isn't even taking into account my monthly data allowance.

Also, just a point, Australia. To paraphrase a Sony quote about Australian internet. "How can you live with this shit!?", it's why most australian game servers are in America or China, you get better speeds and pings connecting to them from australia than trying to connect to an australian server.
slpwnd wrote:We are well aware that this is a big annoyance, but this is something that will be addressed in 0.12. We plan to introduce a kind of hybrid approach inspired by Quake where some of the input actions (moving, building, etc.) would seem to take effect immediately. However they would be kept in a temporary running queue and be actually applied to the simulation only in the proper order defined by incoming ticks from other peers. If for some reason the action is not possible (should be very rare - for instance another player moved to the place where I wanted to build something) it would be discarded and the player who made it would get kind of a "glitch" (suddenly a building he thought he build would disappear or so). But again this would be rather rare.
That's pretty much what I'd expect to happen.


as for the host/peer argument, basically what we want is a central computer that we can connect to, and continue the game, reguarless of if the other players are online or not.
Another example I suppose... OpenTTD.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by SHiRKiT »

bobingabout wrote:as for the host/peer argument, basically what we want is a central computer that we can connect to, and continue the game, reguarless of if the other players are online or not.
Like a "dedicated server", but it would be more like a "dedicated peer". A ghost player that does nothing, doesn't interact with the game, just enabling the game to keep running, a persistent world. With no graphics of course. This would enable "dedicated hosting" =]
Yaua
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Thu Jan 22, 2015 4:26 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by Yaua »

Bad surprises may happens, even with a lot of good work ! Factorio is a (very) high-quality game, even in this pre-release stage, you're making an awesome work (and it is greatly appreciated :D), and honestly, I think it's better to delay something like you did here for having a better game when there is troubles.

Please all, take care, and especially Kovarex !

PS: I wish you good luck and bravery for all the technical stuff (which I didn't understand at all)
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by bobingabout »

Yeah, Dedicated host is what I'm looking for.

Also, I do hopw you don't find me too abrasive with my points of view sometimes, I really don't mean to offend anyone with what I write here.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
Piranha
Fast Inserter
Fast Inserter
Posts: 152
Joined: Fri Nov 21, 2014 8:15 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by Piranha »

I don't know how relavent this is anymore, never read the thread when it first happened.. If I did I would have tried my best to bring it to attention.. But I found this a week or so ago while randomly searching to see if one existed..

Anyways, seems like the right place to bring it back to life..

Dedicated Multiplayer Server Guide
User avatar
Legoman165
Inserter
Inserter
Posts: 31
Joined: Thu Feb 26, 2015 7:15 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by Legoman165 »

Soo much talk about server issues, ITS IN ALPHA PEOPLE. And the multiplayer we have (as mentioned before) was designed for LAN not cross country/ ocean internet connections.
Marconos
Filter Inserter
Filter Inserter
Posts: 301
Joined: Mon Jun 02, 2014 10:46 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by Marconos »

IMO, getting multiplayer right is one of the most critical parts of the game. Getting it right can make or break the game, ie it should be discussed. Without solid multiplayer the game loses out on soooooo much.
User avatar
Nova
Filter Inserter
Filter Inserter
Posts: 959
Joined: Mon Mar 04, 2013 12:13 am
Contact:

Re: Friday Facts #75 - False hopes

Post by Nova »

Not really, in my opinion the singleplayer mode is much more important.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by bobingabout »

Single player/Multiplayer, which is more important, it could be quite a long debate.

Both are equilly as important for different reasons, you could say there are 3 parts of the game.
1. The Core and Base, these are the rules, the graphics, and everything that makes the game.
2. The Single player side, these are the missions.
3. The Multiplayer side.

Undoubtably the most important part of the game is the Core/Base. As for the Single player Missions or Multiplayer, well, consider how many hours you'd be likely to do each, the one with more hours is likely the most important of the 2. Single player Missions is obviously very important, this is likely the first thing you'll be doing when you buy the game. I personally have played this once, and only once, spending most of the rest of my gaming hours in open sandbox mode. I've also put quite some time in the Multiplayer side of the game.

Currently, I have spent more time in the Missions than multiplayer, but which of these 2 do I see myself playing most in the future? Multiplayer, obviously. From this perspective Multiplayer is more important than Single player (missions).
Just because Multiplayer is most important to me, doesn't mean it is for everyone, I do not deny the importance of the missions. But we should also consider that Multiplayer has only been in developement for a few months, where the game's Base, Core, and Engine have been in development for years, and so have the missions. Both sides deserve some love and effort.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Marconos
Filter Inserter
Filter Inserter
Posts: 301
Joined: Mon Jun 02, 2014 10:46 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by Marconos »

Look at games that have longevity, real longevity. They all are multiplayer. Do you think a game like minecraft would be anywhere near what it is today without multiplayer? That is where things are at today, wind the clock back 15 years to when I was a kid (okay 20+ ) and single player was all that was really required.

It's very important and one leg of the stool, as was pointed out, it's not the only things but one of the primary importance areas.
Gammro
Filter Inserter
Filter Inserter
Posts: 361
Joined: Wed Oct 09, 2013 1:45 pm
Contact:

Re: Friday Facts #75 - False hopes

Post by Gammro »

Marconos wrote:Look at games that have longevity, real longevity. They all are multiplayer. Do you think a game like minecraft would be anywhere near what it is today without multiplayer? That is where things are at today, wind the clock back 15 years to when I was a kid (okay 20+ ) and single player was all that was really required.

It's very important and one leg of the stool, as was pointed out, it's not the only things but one of the primary importance areas.
Look at simcity 4, Crusader Kings, the Europa universalis series, civilization series, and countless others. All those games are single player only or played single player primarily. Their multiplayer component have had no big influence in their popularity and longlivety.

I look forward to being able to play this MP, but claiming it's such an important part as you make it out to be for every game is just untrue.
Ignore this
d.kr
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Dec 24, 2014 1:04 am
Contact:

Re: Friday Facts #75 - False hopes

Post by d.kr »

SHiRKiT wrote:
slpwnd wrote:We are well aware that this is a big annoyance, but this is something that will be addressed in 0.12. We plan to introduce a kind of hybrid approach inspired by Quake where some of the input actions (moving, building, etc.) would seem to take effect immediately. However they would be kept in a temporary running queue and be actually applied to the simulation only in the proper order defined by incoming ticks from other peers. If for some reason the action is not possible (should be very rare - for instance another player moved to the place where I wanted to build something) it would be discarded and the player who made it would get kind of a "glitch" (suddenly a building he thought he build would disappear or so). But again this would be rather rare.
This is a solution, but it can be quite tricky: clients would need to be able to undo actions, remembering what was done in the past and correct the future game state.
Also, if you introduce this kind of stuff, when you hold down the F key while standing in a running factory with 10 express belts side by side, things may explode.
You only need to undo action, if you are "merging" two actions (= interruptions in the determinism) at the same frame at the same place. A server could see this and could send a definite version to both clients.

Sorry for off topic: Are monster (or their ai) deterministic or are they act like an omnipresent npc (=client)?

Edited: Reactivate BBCode
Post Reply

Return to “News”