One of my biggest problems with the Construction Signaler mod was how it performed in larger networks with lot of roboports. That mod would individually scan the logistic network area of each roboport, even though that meant scanning the same are potentially multiple times. I made a change to that mod to get the bounding box of the entire logistic network area first and then scan that area once, which made a massive difference in performance. It is possible that the bounding boxes of abnormally shaped logistic networks can overlap each other slightly, which means you might get one ghost signal reported in two different networks. This means I could end up with a couple extra items getting delivered to a location that didn't need them, but that was an insignificant price to pay in comparison with the performance improvement.
I am about to start a new game and was wondering if you have done anything similar to this mod.
For reference, here is the code change I made from the original mod. Likely it could be improved by someone who is actually proficient in LUA :)
local function find_ghosts(network)
if not network then
return {}
end
local minx = 0
local miny = 0
local maxx = 0
local maxy = 0
local startpos = network.cells[1].owner.position
minx = startpos.x
miny = startpos.y
maxx = minx
maxy = miny
for _,cell in pairs(network.cells) do
local pos = cell.owner.position
local r = cell.construction_radius
if r > 0 then
if pos.x - r < minx then
minx = pos.x - r
end
if pos.y - r < miny then
miny = pos.y - r
end
if pos.x + r > maxx then
maxx = pos.x + r
end
if pos.y + r > maxy then
maxy = pos.y + r
end
end
end
local bounds = { { minx, miny, }, { maxx, maxy } }
local ghosts = network.cells[1].owner.surface.find_entities_filtered{area=bounds, type={"tile-ghost", "entity-ghost"}, force=network.force}
return ghosts
end