Page 1 of 1

Expose logistic networks per force without spatial queries

Posted: Wed Dec 03, 2025 3:16 am
by bits-orio
Currently there's no way to retrieve all logistic networks belonging to a force.

The existing API offers spatial queries like LuaSurface.find_logistic_networks_by_construction_area() and LuaSurface.find_logistic_network_by_position(), but nothing that maps forces to their networks directly.

Spatial queries become inefficient in scenarios like OARC where players from the same force can be spread across very large areas and multiple surfaces.

The only workaround is maintaining a custom cache by hooking into roboport build/destroy events and handling network merging/splitting manually.

Proposed addition:

A property like LuaForce.logistic_networks returning an array of LuaLogisticNetwork, or a surface-scoped method like LuaSurface.get_logistic_networks(force).

This would enable efficient force-level queries without requiring mod authors to implement custom caching infrastructure.

Re: Expose logistic networks per force without spatial queries

Posted: Wed Dec 03, 2025 3:50 am
by bits-orio
Nevermind, I didn't do my research properly.
This already exists:
https://lua-api.factorio.com/latest/cla ... c_networks

Please close this request.