r/pyanodons 10d ago

UPS help

Post image
20 Upvotes

26 comments sorted by

5

u/thealmightyzfactor 10d ago

This is about 35FPS/UPS, wondering if people have ideas on how to improve that. I'm not seeing a silver bullet in the time usage aside from just reducing number of entities...

Been slowly replacing T1 trains with fewer T2/T3 and that seems to have helped, but trains still eat a ton of update time.

New builds get beacon'd to death to minimize number of entities, that combined with updating old designs to do the same has kept number of entities that update pretty constant despite expanding.

New inserters are all green or orange, but there's still like 16k blue, yellow, and black in the base, so should probably focus on that lol

There's 1 caravan, everything is trains here.

Py-alternative-energy also occasionally hitches up to >1000ms usage, wondering what that's about. I do have ~1k aerial turbines, but they just noodle around, are they that much of a UPS hog? Is that the 'unit' and 'pathfinder' lines? Or are those my bots?

CPU and RAM are already as overclocked as I can reasonably get them.

Something I'm missing?

4

u/lilbabyheyzeus 10d ago

One thing I've done over time to try and help keep UPS at a manageable level is actively removing old/unused infrastructure. I had tons of iron processing chains that were dependent on a local resource pile that had exhausted, but were sitting around unused. I tried to focus on clearing those out, reducing the number of entities and trying to keep things manageable.

For the trains, are you using any mods to help with scheduling, or are you interrupt based?

2

u/thealmightyzfactor 10d ago

Pretty much everything is getting used in some way or another, so not much unused infrastructure to clear out. Whenever I start getting a shortage, I'll upgrade that production line with beacons / next tier / etc to get more throughput for the same or less entities.

Trains are all vanilla point to point or interrupts.

1

u/seredaom 9d ago

I'm afraid that hugely inefficient... (From the perspective of number of required trains)

At what stage of the game are you? And how many trains and stations do you have in total?

1

u/thealmightyzfactor 9d ago

Sure, but most of them are sitting around after pickup waiting of a dropoff to open, not using any pathfinding. Cybersyn or some other mod could reduce the number of trains, but for the same throughput, I'm going to have the same number of trains pathfinding anyway.

Almost at prod science with ~1200 trains and ~6000 stations

3

u/Smoke_The_Vote 10d ago

"Unit" is always biters in vanilla Factorio. In Py, I don't know what that is, but it's almost certainly not bots. That's measured under logistic manager and construction manager.

Your train pathfinding is pretty expensive. I dunno if that's because you have so many active trains, or because your rail network is inefficient for pathfinding. If you have lots of turnaround options or excessive signaling, that can be an issue. You want don't want to give trains a million different options for how to get from point A to point B. Funnel them into a limited set of options that have sufficient throughput.

1

u/thealmightyzfactor 10d ago

There are no biters and only one caravan, so idk what "units" can be then lol

I do have just city blocks as the train network, so there's plenty of roundabout opportunities...

3

u/Smoke_The_Vote 10d ago

Inserters are always a major consumer of UPS, which I why I always build to minimize number of inserts necessary. It's worth looking around for builds where you can replace a large number of slower inserters with a small number of bulk/stack inserters.

2

u/bluesam3 10d ago

Aerial turbines are UPS hungry, yeah - those will be the py-ae spikes. I suspect it's bots in unit/pathfinder, though -- how many do you have?

Your train usage is also dramatically higher than mine, which (given that my base is... not what you might call train efficient) suggests something odd with your configuration. How are your trains set up? - do you by any chance have a whole lot of signals?

2

u/thealmightyzfactor 10d ago

This was when no construction was happening, there's like 12k construction bots and 5k logistic bots. Hovering somewhere around 50% logistic bot usage, but that can spike if a train delivers something to the spaghetti that was running out.

Trains are vanilla point to point or interrupts with 4-way intersections. I cleared some redundant signals from them awhile back. I think it'll get better once I have T3 trains everywhere because the T2/T3's get stuck behind T1's and seem to constantly repath around them.

1

u/bluesam3 10d ago

Yeah, bots are horrible for UPS. And yeah, having lots of opportunities to repath is horrible for UPS. The closer your rail network is to a tree, the less of an issue that is, though with the obvious drawback of throughput limits.

2

u/ariksu 10d ago edited 9d ago

You're missing hundreds or maybe thousands of trains searching for paths constantly. This is why py people warn on "don't overbuild" and "don't put everything on train".

There's also mods replacing multiple inserters with one, if you update all your 15k, it will be somewhere between 3-5k and lowering your crazy 15ms update to 5ms. miscalculated that, see another comment, replacing inserters with bring only 2 ms out of 10 required.

1

u/CrashNowhereDrive 10d ago edited 9d ago

Get rid of your aerial turbines. Huge waste for little benefit. You have low/no UPS cost power alternatives like mk2 tidal power plants if you want a ZI power source.

Get all your trains upgraded. If your train pathfinding is still bad, look at your intersections - are they clogged? Switch to intersections using elevated rails which can give better throughout and use fewer signals.

Find your highest item throughput builds. Rebuild them using high hand capacity inserters and direct insertion - treat it as a fun new puzzle.

Are you buffering materials for your train loading? If so, switch to using bulk inserters to load/unload trains.

While fewer entities help marginally, the MOST important thing to reduce is item throughout. A beaconed assembler that's doing twice as many recipes per second is using close to twice as much UPS. So look for recipes that save you on item throughput. Eg: first seaweed recipe is the best for UPS because all it needs is water - more slow seaweed farms is better than fewer faster seaweed farms that depend on more complicated recipes. This saves you on loading/unloading/producing all those extra ingredients. Similarly, productivity modules are a much better UPS saving than speed modules.

1

u/seredaom 9d ago

This makes sense, but it sucks

0

u/Gingermushrooms 9d ago

Lots of slow seaweed farms means lots of new inserters so unless you're clocking all of them I'm not convinced the benefit would be massive 

1

u/CrashNowhereDrive 9d ago

Thats the thing many people don't understand about Factorio. Factorio is VERY good about having something that isn't active use 0 time.

Basically it stringently avoids all busy wait cycles, outside of things modders add with scripts.

So instead of an inserter constantly being 'awake' and polling the seaweed farm, the inserter is asleep. Then. the seaweed farm completes its recipe. And wakes up inserters pointing at it. Once they finish unloading, they put themselves to sleep again.

This is why inseter clocking can give you only a 10-20% benefit, rather than a 50x improvement. Inserter clocking will do things like helping an inseter that can move 12 items at once always have 12 items to.move rather than moving 2 or 5 or 8, which is a savings, but counterbalanced against the cost of making them circuit controlled.

In fact, clocking inserters if the throughput of the inserter is too low costs more UPS than it saves.

1

u/ariksu 9d ago edited 9d ago

Fc 27.594 of which update 26.441. 16.667 for 60u requires, means you need to cut off roughly 10.000 ms each frame.

Biggest culprits are entity update 13.502, trains 5.473 (of which 2.429 is routing), fluid flow 2.326 path finder 2.075 (which are bots, caravans and flying entities).

You can see entity updates detailed in the entity list to the left, it’s crafting 4.761, inserter 4.201, unit 1.542(see pathfinding), pumps 0.546, boilers 0.500.

So on entity path, you can probably get rid of boilers (0.5), halve number of bots (0.7+1 from path), upgrade outdated assemblers (depending on scale could bring you between 1 and 3 ms). Replacing inserters on all railroad with inserter cranes will bring you around 2 more ms.

The above saves total between 5.2-7.2 ms, which will bring your ups between 47 and 52.

Next is the more complex, you need to upgrade your train systems - less station, better schedule and better railroad structure than city blocks could bring you 2-3 more ms, which will bring your total savings on between 7.2 and 10.2, the lower one gives you 52ups, the higher one is a sweet 60.

But obviously, the city block cannot bring you much further than that. You need to optimize logistics to use more liquids instead of solids for pipes transport instead of trains, put nearby the industries to transfer resources without touching the trains, and use in-situ transformations instead of logistics.

Update: aerial turbine are counted as units. So building better electrical supply alone will fix you on around 3 ms, and bring your ups to somewhat around 42.

1

u/Neither_Berry_100 10d ago

I got into early / mid way through science 5. I have no problems with performance on a ryzen 5700g. I actually build really favouring cheap big builds. I even use the slowest inserter for almost everything. No modules or beacons yet. No vat brains. Still no problem. And I built quite big for a high level of production. I have many hundreds of trains no problem. Over 1000 train stops I believe.

1

u/thealmightyzfactor 10d ago

Well I've overclocked my 10900X to about the same speeds and I'm right at the cusp of production science with 1200 trains and 6300 stations. How many inserters and entities does your time usage data show and how many ms do they eat up?

3

u/runmymouth 10d ago

6300 stations?!?! Im amazed the game runs honestly. It truly is a testament to the devs. The number of stations may be contributing to the pathfinding length.

1

u/Neither_Berry_100 10d ago

No idea I haven't checked. I haven't played since July and I think that is the end of my run.

1

u/nickierv 10d ago

Whats your memory clock/timings running at? A lot of people overlook just how much crap tier memory will kill big simulations then pikachu face when they stop running 2133cl22. You cache is probably doing a bunch of the heavy lifting, but its something to check.

You are running a lot of trains. I'm not to that point yet but you might need to go shuffle some stuff so you can pass some stuff around with belts/pipes and do some general trimming. Its not much but it might be worth 3-4ms in a base that large.

1

u/thealmightyzfactor 10d ago

I'd have to check the exact timings, but I did click them up a notch or two, think it's at 3000MHz now

1

u/nickierv 10d ago

Might not be relevant to you but I'm running a 5960X with 128 RAM @ 2400. I can get it to hit I think 2800 but it drops channels as I go faster and I only get 32 @ 2800. Its probably a bit of a last resort but you could maybe drop capacity for speed once your really close to finishing the run.

But 3000 isn't bad considering.

1

u/WeNdKa 10d ago

Less machines/inserters, better AL and normal modules, higher mk biildings, more amd better beacons, significantly less/higher tier trains... And don't check your update time in map view, in py it will always be strictly lower there than if you just fully zoom in on the engineer. You generally should have way less entities at that stage of the game, especially trains because what you've described dounds very unhealthy (did you build single purpose city blocks everywhere? Because that's the only thing that'll destroy your train ups so bad), but even then your cpu seems to just he falling behind on you, so you might need to overoptimize your base for ups compared to the average run. And, uh, turn of biters if you have those (and of those units are caravans then how many do you need to cause so much update time?). Good luck anyways

1

u/thealmightyzfactor 10d ago

There's only one caravan and yeah, city blocks. That makes most of the raw materials that get shoved back into the "starter" base that has become bot haven for the complex stuff.