Page 2 of 2

Re: Why is my UPS low?

Posted: Sun Nov 17, 2019 4:29 am
by Kidster3001
@Koub and Darkfrei
Thanks to both of you for helping me understand better how the game works.
Yes, I realize the warehouse issue was explained early in the thread. I was not aware of it before I started this conversation and I most likely didn't give enough credit to the comment when it was given. Logically, it didn't make sense to me, but I think I understand better why now. Thanks for the link. I will do some testing to see how it affects my factory. I'm sure it will, since the devs said it.

I am into the lower 50's now for UPS, mostly just by replacing vanilla machines with Schalls Scaling. With that mod I have reduced the number of major entities as follows:
Electric Furnace from ~3200+ to ~630
Assembling Machine 3 from ~12,000 to ~800
Oil refineries from almost ~1000 to less than 100
Chemical plants will go from ~2800 down to about 300.
Also removed 20+ Bobs Nuclear Reactor 3 (2x2) power facilities, replacing them with 135k of Bobs Large Solar Panel 3, roughly 30 GW worth.

The logistics around delivering resources and taking away products has not changed. Figuring out the puzzle of how to smoothly orchestrate that in a complicated factory is what I enjoy; circuits, trains, requests, etc... I get no enjoyment out of spamming blueprints to create more circuits or launching rockets for that matter.

Re: Why is my UPS low?

Posted: Sun Nov 17, 2019 6:03 am
by Kidster3001
I've added two mods
1. Increase stack size for everything x100
2. Decrease all container slots x100

Iron plates = 10k stack size
Warehouses = 18 slots

I am not seeing a noticeable difference in UPS. ~51 with the mods running or not.

Re: Why is my UPS low?

Posted: Sun Nov 17, 2019 2:31 pm
by mmmPI
Kidster3001 wrote:
Sun Nov 17, 2019 4:29 am
The logistics around delivering resources and taking away products has not changed. Figuring out the puzzle of how to smoothly orchestrate that in a complicated factory is what I enjoy; circuits, trains, requests, etc... I get no enjoyment out of spamming blueprints to create more circuits or launching rockets for that matter.
Maybe these topics will interest you : (viewtopic.php?f=204&t=77314) It is precisely about the challenge of solving those puzzle with best UPS. If you plan to further modify the factory it can give inspiration/explanation.

Also in game, you can press F4 by default and shows the " cpu time usage ". It can allow to measure improvements, and track where they are possible/worth. It would tell you how much time is used by CPU for 'trains' vs 'fluids' vs 'signal' in your current game.

Re: Why is my UPS low?

Posted: Tue Nov 19, 2019 3:55 am
by Honktown
I'm tooting my own horn here: https://mods.factorio.com/mod/DeepPockets

I (re)wrote a stack size changer, if you need one

edit: nvm you got one already

Re: Why is my UPS low?

Posted: Tue Nov 19, 2019 3:58 am
by Honktown
Kidster3001 wrote:
Sun Nov 17, 2019 4:29 am
@Koub and Darkfrei
Thanks to both of you for helping me understand better how the game works.
Yes, I realize the warehouse issue was explained early in the thread. I was not aware of it before I started this conversation and I most likely didn't give enough credit to the comment when it was given. Logically, it didn't make sense to me, but I think I understand better why now. Thanks for the link. I will do some testing to see how it affects my factory. I'm sure it will, since the devs said it.

I am into the lower 50's now for UPS, mostly just by replacing vanilla machines with Schalls Scaling. With that mod I have reduced the number of major entities as follows:
Electric Furnace from ~3200+ to ~630
Assembling Machine 3 from ~12,000 to ~800
Oil refineries from almost ~1000 to less than 100
Chemical plants will go from ~2800 down to about 300.
Also removed 20+ Bobs Nuclear Reactor 3 (2x2) power facilities, replacing them with 135k of Bobs Large Solar Panel 3, roughly 30 GW worth.

The logistics around delivering resources and taking away products has not changed. Figuring out the puzzle of how to smoothly orchestrate that in a complicated factory is what I enjoy; circuits, trains, requests, etc... I get no enjoyment out of spamming blueprints to create more circuits or launching rockets for that matter.
There's a belt mod that can make belts go 120 items per second, and miniloader's are loaders that are 1x1, which can fit inside beacon'd layouts, if you're trying to super duper maximize throughputs

Re: Why is my UPS low?

Posted: Tue Dec 03, 2019 8:08 am
by Kidster3001
Thanks Honktown.
I'll try your addon. I think I'd like the option to not change some stack sizes.

I'm experimenting with avoiding loaders just now. Stack Inserter stack size is 39 at the moment. 6 of Bob's Ultimate Inserters are about 3.5 times as fast as one green loader. I like watching inserters fly :-) If they start consuming a lot of game cycles I'll try the single loaders.

Re: Why is my UPS low?

Posted: Tue Dec 03, 2019 8:21 am
by Honktown
Kidster3001 wrote:
Tue Dec 03, 2019 8:08 am
Thanks Honktown.
I'll try your addon. I think I'd like the option to not change some stack sizes.

I'm experimenting with avoiding loaders just now. Stack Inserter stack size is 39 at the moment. 6 of Bob's Ultimate Inserters are about 3.5 times as fast as one green loader. I like watching inserters fly :-) If they start consuming a lot of game cycles I'll try the single loaders.
Belts/loaders can only go at 120 items per second, but with Merging Chests you can insert/remove from a chest that can be any units long. It eats memory the larger the max size - side effect of supporting NxM chests, each one has its own entity information, so 100x100 max dimensions is 100!x100! different chests (I do 60x60 and limit it to 240 max area without issues). I wonder if getting the inserter stack size above 52 items is faster than a maxed loader (120 items per second * .433 seconds per full turn = 52 items per grab). There's a mod that removes inserter animations, which would improve FPS if you were going for super-fast turns vs more per stack.

I mention in the tooltip and in my mod's page, if something's caught in a group you don't want changed at all, set it to -1 in a more obvious group. Check the log if something's weird, I added messages for most everything. (please report any bugs if you do use it kthnx)

Edit: also forgot to mention, machines can only go at 60 cycles per second, so speed above that won't help you (only if you're doing super fast wires, gears, rails, etc would it probably come up)

Re: Why is my UPS low?

Posted: Tue Dec 03, 2019 9:38 am
by Oktokolo
Honktown wrote:
Tue Dec 03, 2019 8:21 am
It eats memory the larger the max size - side effect of supporting NxM chests, each one has its own entity information, so 100x100 max dimensions is 100!x100! different chests (I do 60x60 and limit it to 240 max area without issues).
How can there be factorials in the chest entity count calculation? What absurd workarounds need that much entities?

Re: Why is my UPS low?

Posted: Tue Dec 03, 2019 10:05 am
by Honktown
Oktokolo wrote:
Tue Dec 03, 2019 9:38 am
Honktown wrote:
Tue Dec 03, 2019 8:21 am
It eats memory the larger the max size - side effect of supporting NxM chests, each one has its own entity information, so 100x100 max dimensions is 100!x100! different chests (I do 60x60 and limit it to 240 max area without issues).
How can there be factorials in the chest entity count calculation? What absurd workarounds need that much entities?
Unfortunately it's the way it has to be implemented I think. Graphics aren't dynamically generable (generateable?), so all the sprites have to be pre-allocated.

Basically, if you start with 1x1 chests, when you go up to max dimensions 2x2, you have 2x2, 2x1, 1x2, and 1x1. 3x3 has 3x3, 3x2, 3x1, 2x3, 2x2, 2x1, 1x3, 1x2, 1x1. Not factorial per-se, but NxM dimensions need NxM unique sprites allocated. I think I was thinking of it as factorial because as you add +1 to a dimension, you need n+1 more boxes. It's a squared amount in total, so 100x100 only needs 10,000 sprites. It grows extremely more in terms of the amount of memory needed, because of the area growth. 1x1 = 1 tile, 2x2 max = 4 + 2 + 2 + 1 = 9 tiles, 3x3 = 9 + 6 + 3 + 6 + 4 + 2 + 3 + 2 + 1 = 36 tiles.

Re: Why is my UPS low?

Posted: Tue Dec 03, 2019 11:58 pm
by Oktokolo
Honktown wrote:
Tue Dec 03, 2019 10:05 am
Basically, if you start with 1x1 chests, when you go up to max dimensions 2x2, you have 2x2, 2x1, 1x2, and 1x1. 3x3 has 3x3, 3x2, 3x1, 2x3, 2x2, 2x1, 1x3, 1x2, 1x1. Not factorial per-se, but NxM dimensions need NxM unique sprites allocated.
If it is about the sprites, just look at early window decoration theming:
You would have the sprites for the four corners, four sprites wich are tiled at the edges and one fully tileable sprite to fill the interior with. So that would be nine unique sprites of wich four are tiled either horizontally or vertically and one is tiled in both directions.

Sprite tiling:

Code: Select all

TL ⇐T⇒ TR
⇑  ⇖⇑⇗  ⇑
 L  ⇐C⇒   R
⇓  ⇙⇓⇘  ⇓
BL ⇐B⇒ BR
Not sure if there can be chest entities with runtime defined clickable/pickup/drop area though. So maybe there would still have to be N*M different prototypes for a performant implementation. But there should be no need for having more than one entity for the actual chest at runtime.
If having N*M prototypes, they would be generated with precalculated tiled sprite definitions if possible.
In case of a dynamically resizable entity, the sprites would have to be placed by script on build (as the game itself has to display a shitton of arrows and stuff in ALT mode, there probably is a prototype for some lightweight simple sprite entity to inherit from).

Maximum entity count of any sane implementation is N * M lightweight sprites + 1 chest.

Re: Why is my UPS low?

Posted: Wed Dec 04, 2019 12:31 am
by Honktown
Oktokolo wrote:
Tue Dec 03, 2019 11:58 pm
...
If you want to read the discussion for yourself:

https://mods.factorio.com/mod/WideChest ... 000d717e8e

Re: Why is my UPS low?

Posted: Wed Dec 04, 2019 4:20 am
by Oktokolo
Thanks - and necroed that thread.

Re: Why is my UPS low?

Posted: Wed Dec 04, 2019 7:34 am
by Kidster3001
Never make your inserters turn more than 90 degrees if you're modding them. Mine never turn 180 for pickup/dropoff. An inserter at one end of a cargo wagon pulls from towards the middle of the wagon and drops directly below where it picked up from. 90 degree turn for a standard length inserter. I haven't done much testing, but I think they are even faster if they are at max length for pickup and dropoff and only need to turn 30 degrees or so.
Now, if they could interfere with each other it would spoil that fun. My inserters would bust each other to pieces in that case.

Re: Why is my UPS low?

Posted: Thu Dec 05, 2019 12:05 am
by Honktown
Kidster3001 wrote:
Wed Dec 04, 2019 7:34 am
Now, if they could interfere with each other it would spoil that fun. My inserters would bust each other to pieces in that case.
Oh my god. That would make a great mod. 1x1 inserters next to eachother could collide, the longer ones would need more space.

Re: Why is my UPS low?

Posted: Thu Dec 05, 2019 8:37 am
by Honktown
Koub wrote:
Thu Nov 14, 2019 6:39 am
Kidster3001 wrote:
Thu Nov 14, 2019 2:54 am
I had no idea the number of slots in a container affected performance.
That's the first thing we told you : that warehouses could be the source of your issues :).
Koub wrote:
Thu Nov 07, 2019 8:40 am
Train pathfinding and warehouses are my best guesses for your low UPS.
darkfrei wrote:
Thu Nov 07, 2019 11:33 am
Koub wrote:
Thu Nov 07, 2019 8:40 am
Train pathfinding and warehouses are my best guesses for your low UPS.
Can the mod https://mods.factorio.com/mod/SmallChests fix the warehouse UPS dropping?
You've even acknowledged our warnings :
Kidster3001 wrote:
Fri Nov 08, 2019 2:23 am
@darkfrei
I didn't realize the number of chest slots affected UPS. I had assumed a chest was just X of these and Y of those, regardless of stack size or number of slots. I'll look into how that affects it. Unfortunately, the production lines in my base would consume SmallChests 6 slots in far less than 1 second. The bots would have it all gone before the train could even start moving after dropping it off. OMG, 10 Warehouses with million+ quantities of various types of concrete... Lot of things to test!
Here's more explanations from the devs :
viewtopic.php?f=23&t=20666
I hadn't seen your post or I would've responded earlier. I wonder if the devs have considered to 'link' groups of items into a single pseudo-stack. Instead of checking each slot they should be checking each item and taking from the last entry in the slots (this way the list of item stacks becomes smaller from the end, an important optimization of memory use). If the items are (internally) sorted alphabetically, by an ID/key, etc they can even do an optimized search on it, which is probably overkill.

Re: Why is my UPS low?

Posted: Thu Dec 05, 2019 9:53 pm
by darkfrei
Kidster3001 wrote:
Wed Dec 04, 2019 7:34 am
Never make your inserters turn more than 90 degrees if you're modding them. Mine never turn 180 for pickup/dropoff.
I've made the mod without rotation, just sliding items from one belt lane to the nearest another one, they are really fast.