posila wrote:Other problems: what if somebody with significantly slower computer connects to the game? What if you want to play with such person? What if you don't?
Yup. Personally, I'm okay with having an option on the server which reduces game speed to either a configurable minimum or else to the lowest common denominator.
posila wrote:The game we want to make is one where Factory you build does its job even when you don't see it. We also want every item to be accounted for, no faking like "this chest gets average of 10 red circuits per minute so when you look at it after 20 minutes, it will have 200 more than the last time". That is why Factorio exists as a standlone game and not as mod in Minecraft (see IndustrialCraft and BuildCraft mods, which inspired Factorio). If that is not a game you want to play, that is perfectly understandable.
I don't believe clients need to have the entire game state for that to happen; just the server needs it. If a client wants to be able to play in single-player, then that specific client should have the option to save the game then, which would then request the entire map data from the server.
posila wrote:So basically we require Factorio to update whole factory all the time. That is not a bug nor oversight, that is intentional behavior. Can we make it so that only server needs to update whole game state? I don't know. Probably yes, but it seems like huge rewrite of ... everything, unless we just send draw commands to clients, which would require massive amount of bandwidth. And frankly, it is quite opposite to what majority of our players want. They would like to run the server on Raspberry Pi or on some crappy machine with Intel Atom.
First, can you point me to the ARM-compatible (eg, Raspberry Pi) Factorio game binaries? I happen to have a few Raspberry Pis laying around and would be interested in trying it out. As for Intel Atom... I don't see how changing how the
client processes a multiplayer game would detrimentally affect the hardware requirements for the server. As a matter of fact, I would argue that taking better advantage of threading would
benefit the Atom-based server;
many Atoms (not all, sure, but many) have more than one core.
Second, being a huge rewrite of... everything? Yes, indeed. I have no doubt. But I
strongly believe that Factorio would come out with far superior performance both on server-side and client-side as a result. The better architecture to handle that, in my experience, would also lend itself to facilitate the ability to find and resolve bugs, too, as well as unit testing. I mean, the game
does have unit tests, right?
posila wrote:As for multithreaded update. It is very likely it will come in not so distant future.
Sunder1977 wrote:@OP: Your anecdotal evidence has been completely countered.
viewtopic.php?f=53&t=32649
Over 150 people connected, caught up, and played just fine. Obviously it's not a problem with the software.
As @kogimus already stated, this really doesn't prove anything at all.
- 14.5 vs 14.3 (I want to work with @kogimus tonight and try 14.5)
- vanilla server vs mods (honestly vanilla has a lot of blandness to it, particularly with inserter capabilities and storage sizes)
- fresh server vs one with a medium-ish factory already built
- fresh server vs one with (probably) tens of thousands of aliens spawned
- unknown CPU vs overclocked i7-6950X
- unknown RAM vs overclocked DDR4 3200 14/14/14
- unknown network bandwidth vs 10Mbit upload
More to the point, the mere fact that we
did have problems connecting rather proves that it's a problem and not something fake or made up ("anecdotal"). Don't get me wrong, it's pretty cool that vanilla Factorio starting fresh can handle 159 connections. But get all of those people to play off-and-on for a week and let me know how that goes.
Mind you, I don't imagine it
won't go well. @kogimus and I have a server running on
old hardware and we're able to play on that; we can connect just fine because as we indicated at the beginning of the thread, our client computers have
faster hardware than the server. So there's no reason we can't keep up. It's when we move that server instance to my computer with the most recent hardware that suddenly nobody except myself (and apparently a laptop) can keep up.
posila wrote:Thanks for the save.
Not related to underlying problem, but small quality of life improvement: The way you use Warehouse mod for coal murders performance. Chest inventories are not optimized for so many slots and having inserters trying to insert to almost full Warehouse all the time just kills it. On my home Core-i5 3470S it ran ~42 UPS and after removing inserters inbetween coal Warehouses it jumped up to ~78 UPS (I set game.speed = 2 in order to get more then 60 UPS)
Good to know! The warehouse mod wasn't
just for coal but it solved a problem with regards to running out of it before we realize the belts are empty
It sounds to me like that info should hopefully make it into a performance optimization task. We're talking "merely", what, 15 or so fast inserters? And, what, 2400 or so inventory slots?
Lee_newsum wrote:so I will pick out the games I no all Command & conquer work on 50 units and 30 buildings per team, 8 teams 50 + 30 X 8 =640 c&c has 640 items to keep up to date but no more than 1000 items.
Okay, sure, so it doesn't meet up to the scale.
Lee_newsum wrote:eve online this looks like a big game and it is but 90% of the dater has no connection or no links between them. this thinks can be done in parallel. the biggest think is 1000 vs 1000 ship fights (this has to be done in real time) so one ship has 50 thinks to track 50 X 2000= 100,000 that is a lot and will done to ccp for doing that. and this is done on 1 core.
I'm not sure I follow you. No links between them is probably true to an extent. It absolutely can be done in parallel and I believe their devblogs have pointed at that indeed.
Lee_newsum wrote:Factorio there about 220 items, use 1-6 Assembling machines for this 4 , that have 3+ Inserter on them that is 2640. add to that 200 Electric Mining Drill, add 20,000 iron ore, copper ore, iron ,copper, steel and 7= items that is 12X20,000=240,000 and a not more. this game has a lot of items to track in real time and on 1 core. the devs has said in the past there is no game/ software out there that dues what Factorio can do or has to do in a game tick. the bigger the map get the more items to keep up to date. this game works with items counts of 500,000 and more all in real time
If you want to start tracking
individual items, yeah sure. Maybe. But, like I said, I'm a software engineer. I write software to do things in parallel
all the time. Moving stuff from one belt to another? Relatively trivial. Inserters moving? Trivial. Assembler/smelter producing something? Relatively trivial. Most of these you can throw into a SIMD structure (SSE/AVX or GPU) and make multiple calculations simultaneously. I hope Factorio already does that.
But my point about being able to break that down into separate chunks, I think, still stands. Why does
one core have to process the entire map? I don't believe it does.
Loewchen wrote:
Just to clear up if you misunderstood me when I filed this as not a bug:
The corner case or small window as I described it is not in regards of your map being especially big, old or performance taxing. The special case is only, that the usually inferior Intel i5-6300U processor handles the task better than the FX-8350 (this is most likely because of the shared FPU, as all Bulldozer chips perform poorly in FP operations in my experience) giving the incorrect impression that worse hardware performs better.
The FX-8350 is a Piledriver chip.
As far as Bulldozer is concerned, your statement does echo performance characteristics I've encountered when writing AVX instructions for use on quad-socket
AMD Opteron 6272 (which
is Bulldozer). We had to disable the "faster" AVX instructions in favor of SSE, when the running CPU was AMD. I believe the reasoning was that AMD actually ended up taking a pair of 64-bit registers and hacking them together to make a 128-bit register, instead of actually creating dedicated 128-bit registers.