Belt Overflow

by sparr

Causes full belts to overflow at the end.

Content
2 days ago
0.13 - 2.1
647
Logistics

Changelog

Version: 2.1.3
Date: 2026-09-27
  Bugfixes:
    - Fixed the background reading of the map finding nothing at all, so a belt that changed in a way the game reports no event for never started or stopped overflowing to match. A belt wired to a circuit or turned by another mod's script, a linked pair joined by one, and an inserter arriving beside a dead end are all noticed on their own again, rather than waiting for somebody to build something nearby
    - Fixed a loader being taken for a dead end with nobody waiting at the end of it, which shed what it was carrying onto the ground. Nothing is ever taken off a loader
Version: 2.1.2
Date: 2026-09-15
  Features:
    - Another mod can now tell this one that a single spot or a single chunk has changed, rather than asking for every belt on every surface to be looked at again, either by remote call or by raising belt-overflow-changed
    - Added a setting for how far an overflowing item may be carried to find somewhere it fits, which is thirty-two tiles unless you say otherwise. Nine hundred spills into open ground reached seven, so a factory never meets it
    - Added a setting for whether what comes off a belt gathers into a stack on the ground or lies there an item at a time, which is an item at a time unless you say otherwise. Either way a belt sheds at the same rate; separate items are only more for the game to keep track of. A heap does cover less ground than the same items lying loose, so a belt with a clear tile between it and the pile waits longer for the pile to reach it
  Changes:
    - An overflow that comes to rest against water slides in, and one that comes to rest against the edge of a space platform goes over it, in the direction it was already leaning, out of the middle of the tile it was lying in. Asked the same way a belt is offered one: by which tiles the item is touching, so one that landed square in the middle of its tile is against nothing and stays where it fell. A belt touching it is still asked first
    - A belt running straight into water drops what comes off it in, rather than making a heap on the bank
    - Water here means water you cannot walk on: lakes, lava and the ammoniacal ocean. Anything you can wade through holds a dropped item as dry ground does, so an overflow that reaches shallow water, mud, one of Fulgora's oil oceans or a Gleba wetland stays where it lands
    - A dead end an inserter unloads is looked at four times a second while it stands empty, rather than once. Such a belt is empty whenever the inserter keeps up and fills the moment it pauses, which is the one belt that could sit full for a second before anything came off it
    - An overflow reaches a belt by landing on a tile that belt is touching, rather than by the game hunting for the nearest thing with room in it. A belt with a gap between it and the pile is one the pile has to grow across before anything gets on it
    - An overflow never lands on the belt it came off, nor on a belt with nothing waiting at the end of it. It may land on one that carries it back round to the same jam, which fills the loop up and then jams, the same as if it had fallen there
    - Overflow is no longer put onto a loader
    - An overflow that lands as a heap larger than a belt slot will hold is split, and what fits rides away
    - What comes off a belt is always taken from that belt, rather than from further and further back up the line once the ground beside it filled up
    - A belt overflows when whatever is at the end of it is not getting on as fast as the belt could carry it, rather than when it has filled up. A dead end sheds its first item instead of holding four, and how much a lane holds no longer comes into it, which matters most where belt stacking is researched and a lane holds four times as much
    - A belt held up rather than stopped overflows too: a fast belt handing over to a slow one is carrying a third of what it could, and that now shows as plainly as a belt with nothing ahead of it at all. What comes off is the surplus and no more, so whatever is at the end of the line still gets everything it can take
    - A belt is looked at as often as it needs to be for what comes off it to be right, worked out from how fast it carries things, rather than on one beat for every belt
    - Removed the setting for how often belts are checked. How often a belt is looked at decides how much comes off it, so a slower setting quietly took away overflow that was due rather than saving work harmlessly. A setting may return as a share of a tick the mod may spend, which is a different promise
    - A belt carrying stacks overflows a whole stack at a time rather than an item at a time
    - Items overflowing over the side of a space platform are thrown clear and drift away, the same as anything an inserter drops over the edge
    - Overflowing items can be made to gather into a pile rather than scattering one by one, which fills the ground beside a belt up more slowly. Off unless you ask for it
    - The mod reads the map again in the background for the things nothing reports, such as another mod building or removing a belt silently or a wire being connected. Such a belt starts overflowing on its own instead of waiting for somebody to build something nearby, within moments on a small map and around a minute on a large one
    - What the mod costs no longer grows with how many belts are on the map. Belts that have shed something lately are watched closely and the rest are looked at in turn, so a belt that jams may take up to a second to start overflowing and sheds everything the line behind it brings from then on
  Bugfixes:
    - Fixed an overflow being put back on the belt it came off whenever the ground beside that belt was full. The game puts a spilled item wherever there is room nearest, prefers a belt to ground further away, and will squeeze one onto a lane that is already full, so a belt with a gap in it was always the best place it could find. Overflow now goes on the ground only, and what ends up on a belt is put there deliberately afterwards
    - Fixed two dead ends within reach of one another passing the same item back and forth through the gaps each left in the other. Nothing is taken off a belt until every overflow of the tick has been put down
    - Fixed an overflow being squeezed onto a belt that had no room for it, past the spacing the lane itself keeps
    - Fixed a belt with nothing waiting at the end of it shedding at half the rate it could. Taking the last stack off gives the one behind a clear run, which a look that judges by movement reads as a belt that is flowing and leaves alone. Where nothing will ever take what reaches the end, a stack that has got there is stuck whatever it did on the way, and is now judged on that
    - Fixed an overflow being put on a belt beside it that has nothing waiting at its end either, which only sheds it again a tile further on. Two dead ends side by side passed the same items to and fro
    - Fixed an overflow being thrown over the side of a space platform when a belt running past would have carried it away. Whether a belt will take it is asked first
    - Fixed a belt gathering its overflow into piles never putting anything on a belt running past, where the same belt dropping items separately would. Which of the two is chosen decides how tidy the ground looks and nothing else
    - Fixed an overflow the floor would not take being kept on the belt when a belt beside it had room for it
    - Fixed an overflow that nothing at all would take being lost. Whether anything took it is known now rather than guessed, so a belt with nowhere to put its overflow keeps it, unless it is pointed at water
    - Fixed an overflow on a space platform whose floor is full being lost rather than thrown over the side
    - Fixed belts on one planet or platform being taken for the belts at the same coordinates on another, which left some dead ends never overflowing
    - Fixed belts that another mod builds, revives from a ghost or takes away being ignored until something else nearby changed
    - Fixed overflowing items losing their quality on the way to the ground
    - Fixed belts built or taken away on a space platform being ignored: a platform builds its own belts and says so in its own event, not the one construction robots use, so everything stamped onto a platform was invisible until the mod next read the whole map
    - Fixed items being destroyed when a belt was aimed at a hole in the world that was not the edge of a space platform, which only another mod can arrange; they are put down on whatever ground can be found instead
    - Fixed a belt held still by a circuit condition never overflowing: the belts feeding it now spill, while the one that was switched off keeps what it is carrying
    - Fixed the last stack on a belt that goes nowhere standing at the end for ever while the stack behind it was shed over and over. A belt with nothing at all ahead of it now sheds that one too, while a belt with something waiting at the end still keeps it for them
    - Fixed a belt handing over to a slower one taking about half of what the slower belt should have been given, rather than only the surplus. Whatever is at the end of a line now gets everything it would have had with this mod switched off
    - Fixed a belt feeding a loader making items out of nothing: what came off it went onto the loader and was put back on the belt as well
    - Fixed an overflow that landed on a belt further off than the one it was aimed at being put back on the belt it came from as well, making a second copy of it
    - Fixed a belt another mod builds without announcing it being left unwatched until the mod next read that part of the map, which was half a minute on a large save. The game itself now reports every belt as it appears, whatever built it
    - Fixed a loader being built or taken away never being heard at all, by a player as much as by a script, which left a belt beside it thought to be flowing when it had in fact become a side load
    - Fixed a belt another mod destroys without announcing it leaving the belt behind it backed up in silence until the mod next read that part of the map. The game now reports every belt going away, whatever removed it
    - Fixed the game crashing when another mod passed a surface, rather than its name or index, to the refreshPosition or refreshChunk interface this mod offers
  Info:
    - A belt that a circuit may switch off is noticed when its window is closed, when settings are pasted onto it, or when a blueprint is stamped over it. Nothing in the game reports a wire being connected at all, so a belt wired up with none of those happening waits for the mod to read that part of the map again
    - A circuit condition stops the one belt it is wired to, not the run it stands in
    - Much of how the mod works out where a belt ends, and where what comes off it lands, is now asked of the game rather than worked out from the map around each belt
Version: 2.1.1
Date: 2026-09-10
  Features:
    - Added a test suite
    - Added a way to check every belt in an existing save and report the ends of lines that are full but not overflowing
  Info:
    - A belt switched off by a circuit does not overflow yet, even though nothing on it can move
Version: 2.1.0
Date: 2026-09-10
  Features:
    - Updated for Factorio 2.1
  Bugfixes:
    - Fixed a crash on any underground belt that was connected to its other half
    - Fixed the setting for how often belts are checked doing nothing until the game was restarted
Version: 1.2.2
Date: 2024-09-16
  Features:
    - Add support for Linked Belts
  Bugfixes:
    - Another underground belt ghost crash
Version: 1.2.1
Date: 2024-09-16
  Bugfixes:
    - Another underground belt ghost crash
    - Accidentally disabled removing items being spilled in last update
Version: 1.2.0
Date: 2024-09-15
  Changes:
    - Added LuaLS annotations to source
    - Code refactoring
    - Performance optimizations
  Bugfixes:
    - Crash when bulding paired ghost/real underground belts
    - Added handling for ghosts causing other belts to curve or not
    - Removing empty rows from global arrays
Version: 1.1.0
Date: 2021-12-29
  Changes:
    - Version bump for Factorio 1.1
    - Remove unnecessary mod settings definition properties
  Other:
    - Retroactive changelog entries based on Github releases
Version: 0.17.0
Date: 2019-??-??
  Changes:
    - Version bump for Factorio 0.17
Version: 0.16.0
Date: 2018-05-28
  Changes:
    - Version bump for Factorio 0.16
Version: 0.15.4
Date: 2017-09-17
  Bugfixes:
    - Fix crash related to math.random
Version: 0.15.1
Date: 2017-05-06
  Bugfixes:
    - Fix validity check bug in the configuration change code
Version: 0.15.0
Date: 2017-05-02
  Changes:
    - Version bump for Factorio 0.15 (experimental)
  Bugfixes:
    - Many, especially for underground belts
Version: 0.13.0
Date: 2016-06-28
  Changes:
    - Version bump for Factorio 0.13
  Bugfixes:
    - Some
Version: 0.12.1
Date: 2016-06-09
  Bugfixes:
    - Fixed problem with application of terminal belt highlight option
Version: 0.12.0
Date: 2016-06-09
  Features:
    - Optional highlight of terminal belt locations
  Optimizations:
    - Major rewrite and refactor
  Bugfixes:
    - Some
  Other:
    - Mod versioning aligned with Factorio version
Version: 0.0.2
Date: 2016-06-03
  Changes:
    - Items spill in a slightly better location
  Optimizations:
    - Some
  Bugfixes:
    - Some
Version: 0.0.1
Date: 2016-06-01
  Other:
    - First version!