Belt Balancer 3


Adds Balancer Parts, that can be put together, to balance all adjusting lanes. Updated for better performance and Factorio 2.0, fixing some bugs from previous versions.

Content
14 hours ago
2.0 - 2.1
6.74K
Logistics

g UPS impact?

2 days ago

Would love to use this in a megabase, but what are the actual UPS impacts of using Balancer Parts?

2 days ago

Belt Balancer 3 is doing per-tick per-item Lua calculations, so it has significant impact on megabases.

If you want a megabase-suitable belt balancer mod, I suggest taking a look at Better Belt Balancer (disclaimer -- I'm the dev of BBB).

BBB does no per-tick per-item Lua operations, and it scales roughly on par with vanilla hand-crafted balancers in terms of UPS impact.

You can find some performance comparisons between BB3 and BBB (including megabase-scale benchmarks) here.

14 hours ago

Thanks for the question, and thanks Techrocket9 for the detailed comparison. The cost model he describes is right, so here is a plain explanation of how the two mods differ and when to use each one.

HOW THEY WORK
- Belt Balancer 3 (BB3) moves items with Lua. Every few ticks it takes items off the input lanes and puts them on the output lanes. Its cost grows with the number of items it moves, so a saturated balancer on fast belts is expensive and an idle one is cheap.
- Better Belt Balancer (BBB) builds a network of ordinary splitters on a hidden surface and connects it to your belts. The engine moves the items, so a running balancer runs no script at all. That is why its UPS cost stays close to a hand-built vanilla balancer.

NUMBERS
- From Techrocket9's benchmark: a saturated 4x4 on express belts costs BB3 about 23 microseconds per tick (BBB: about 0.5). Idle, BB3 costs about 3 microseconds. That is roughly 2.3 ms per tick for 100 saturated balancers, out of a 16.7 ms budget at 60 UPS, so a megabase with hundreds of them is not realistic with BB3.
- My own test on Factorio 2.1 (50 saturated 4x4 balancers on express belts) averaged about 2.2 ms per tick for the whole test, including its feed script. With 400 balancers it was about 17.8 ms, over the 60 UPS budget. Version 1.0.3 is about 8-9% faster than 1.0.2, but BB3 will not close this gap: the cost comes from moving items in Lua, and changing that would mean rebuilding the mod and breaking existing saves.

WHICH ONE TO USE
- Use BB3 for small and medium factories, a few balancers, mixed shapes, or when you want to keep an existing save. A part works with belts, undergrounds, splitters and any loader mod, and you can edit it at any time, because nothing is built behind the scenes.
- Use BBB for megabases or any save where UPS matters most. As its page says, it uses one belt per part and caps the size of a network, and edits rebuild the hidden network, so it is less free-form than BB3.

If you only need a handful of balancers, BB3 is fine. If you plan hundreds of saturated ones, BBB is the better tool.

New response