troelsbjerre / Bottleneck

Factorio mod that tell you which assemblers are starved of ingredients
Other
26 stars 21 forks source link

Phantom input blocked signal #83

Closed dirk-bester closed 3 years ago

dirk-bester commented 3 years ago

I ran into a phantom input starved issue: https://forums.factorio.com/viewtopic.php?f=23&t=93044&p=527487#p527487 Basically Factorio says there is ingredient shortage, but it is actually a side effect of an output block.

To summarize, an output full leads to a situation where the inputs deplete. Once the output empties enough production resumes, but from an ingredient starved state. This reports an ingredient shortage. Based on that Bottleneck shows a red dot. But there is no actual problem. Ingredients load again and output resumes without depleting the ouput and actually starving. The actual throughput is still maxed (but exceeding the output capacity).

I would expect that the mod shows the yellow output block instead of the temporary phantom red input block.

Which means ignoring the factory state sometimes and calculating based on the output buffer? Not sure this is even possible.

troelsbjerre commented 3 years ago

It is something that could be patched by the mod, but at a heavy UPS cost. This would be an inefficient way to cover for a corner case bug in how the game updates the status of an entity. I don't know the internals of the game engine, but it is conceivable that the same logic that prevents insertion of ingredients should set the status accordingly.

troelsbjerre commented 3 years ago

After having look further into it, this is not a bug, neither in the mod nor in factorio. The mod correctly displays the entity status, and the status correctly reflects that it briefly cannot produce due to missing ingredients. The logic of not inserting ingredients into an output blocked machine is highly desirable, even at the cost of sometimes being input starved. If you truely want the other behavior, the old version of the mod (prior to entity.status being introduced) gives you the desired behavior, but takes twice as long to update each tick.

dirk-bester commented 3 years ago

I am definitely OK with the current behavior vs increased UPS.

Realistically you probably need to check your design to make sure there is no actual blockage you can improve on.

troelsbjerre commented 3 years ago

If you wish to play around with the idea, the branch "feat-override-status" has your suggested behavior.