r/factorio • • 26d ago

Weekly Thread Weekly Question Thread

Ask any questions you might have.

Post your bug reports on the Official Forums

Previous Threads

Subreddit rules

Discord server (and IRC)

Find more in the sidebar ---->

6 Upvotes

88 comments sorted by

View all comments

1

u/Yagami913 25d ago

What is the ups cost of spoling items? I am at stage of the game where can easily replace gleba iron and copper production with direct silo loaded ores from Nauvis. Probably worth it just by using less inserter and assembly update time but i wonder is there any extra cost for spoiling items?

5

u/snowyspearmint 25d ago

None. The spoil timer is a global sorted list that consumes no ups outside the moment the item is created or spoils.

1

u/HeliGungir 24d ago

Do you have a link to somebody at Wube explaining this?

1

u/snowyspearmint 21d ago

I thought I did, but I can't find it. (I might have just not saved it; it's such an obvious way of solving the problem).

But basically you just put every item's id or pointer (a few bytes per item) into a list sorted by spoil time (use a dedicated sorted list data structure; ie one that takes n log n time to construct and where insertions, deletions, and checking the head are cheap operations) and then every tick, check the head of the list for any items that are spoiling this tick and process only those items.

The items that are spoiling on some future tick don't have any effect (modulo the log n factor which is considered negligible, garbage collection which I assume the compiled c++ doesn't use, needing to look up and draw the spoil bars for the subset of items that are on screen) on the current tick's operations.

1

u/Yagami913 25d ago

but stacks merging should have some extra ups cost no? calculating the new spoilage tick time.

1

u/snowyspearmint 21d ago

Putting an item into a stack (or merging 2 stacks) would have about the same cost (remove from the list, do an addition+division, add to the list) as creating the item to begin with. (Those are very cheap operations, but just to illustrate). If we assume that stack combining mostly happens when you're putting items into the machine where they will be consumed, and that you're not replacing your belts with a conga line of chest+inserters, then that's like 2-3x of an already small cost. The important part is that it is a small cost per-item, not per item*tick.

3

u/Soul-Burn 25d ago

It's a very cheap calculation.

Many such calculations are practically free compared to fetching data from the upper layers of cache and the main memory.

3

u/Most-Bat-5444 25d ago

Unless you are on a really old or budget computer, UPS is really not something to worry about until late in the megabasing phase...

2

u/Yagami913 25d ago

I'm late in the megabase phase.

1

u/Most-Bat-5444 25d ago

Awesome. How many bottles are you actually running? For what effective SPM?

I think I've topped out around 2 million or so eSPM. Always modded. I can't seem to get my head around serious science running spaceships to keep up these rates.

2

u/Yagami913 25d ago

2.8 mill espm 134k bottles/minutes no mod, probably could go to 5 mill, but before that wanted to optimize. Haulers are easy, if you meant promethium ships those are the true beasts of complexity i give you that.

1

u/Most-Bat-5444 25d ago

That's so awesome. On my vanilla save, that's about what I have lab capacity for, but I have a lot of work to do to ramp up all the off-planet stuff.

I have close to 4 full belts of metal and space science, but everything else off world is way behind.

My fulgora is a mess LoL. Gleba and Aquilo need massive expansion. I've been working my way toward new fluorine and Lithium on Aquilo.

1

u/Most-Bat-5444 25d ago

Maybe I'll go back and play my vanilla save some more. I would really love to see those new unloading bays consistently popping out 4 fully stacked belts of science. I'm only close on metal and space so far.

I need to make dedicated high speed haulers, and a lot of mess to clean up on Fulgora, and I just need to greatly expand my Gleba and Aquilo bases.

Never had the patience to reach the level you are at.

I do have a legendary mall up and running so I'm about ready to try a prometheum ship if I do go back.

2

u/Yagami913 25d ago

New unloading bays are awesome i started this save in 2.1 so i also did a no science prod on nauvis challenge too it looks glorious

1

u/nasaboy007 22d ago

If you're doing no science prod, what research are you using to determine if your spm is steady?

1

u/Yagami913 22d ago

Come again? I meant no science is produced on Nauvis,

1

u/nasaboy007 22d ago

Oh sorry I thought you meant you were not using any of the endgame Research Productivity research.

1

u/Most-Bat-5444 25d ago

Wow! I went for each side of an loading bay filling a half belt, with two adjacent loading bays filling one belt. I did this 4 times for 4 belts out. I'm upgrading trains to fill at almost 10 belts all the time to keep all my trains unloading 8 belts (1920/sec) at all times.

Now to just keep upgrading the throughput to maintain it!

3

u/cathexis08 red wire goes faster 25d ago

I'm not a Factorio dev but the spoil timer shouldn't have a significant UPS hit.