Issue:
Currently finding ghosts within a specific LuaLogisticNetwork is slow and cumbersome in lua.We have to iterate through every cell in the network to get the area and search on the surface for ghosts.
The main problem with this approach is that overlapping cells scan the same area multiple times resulting in terrible performance.
Now while each mod trying to fetch ghosts could calculate the complete network polygon and break it up into rectangles for find_entities itself, performance would be a lot better if that was a function of LuaLogisticNetwork.
Request:
Extend LuaLogisticNetwork with a find_ghosts function returning all ghosts, tile ghosts and requester proxies within any however shaped logistic network.Alternatively extend LuaLogisticNetwork with get_coverage returning a polygon and find_entities/find_entities_filtered to consume such a polygon as scan area.
I'm not sure if introducing a polygon data model makes sense, but once introduced it could be used for other things like collision boxes on curved rails.