expose a function to do the frontend resource patch calculations

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
ahicks
Inserter
Inserter
Posts: 23
Joined: Sat Jul 13, 2024 10:45 pm
Contact:

expose a function to do the frontend resource patch calculations

Post by ahicks »

Pretty much what it says. At runtime a mod can't easily find out about a whole patch of resources save to do the calculations in lua, as far as I can tell. We'd like to do this calculation efficiently, which probably means C++ given that Lua isn't so great at data structures.

We are aware that the engine probably doesn't have a concept of patch at runtime and that probably the heuristic can go wrong when e.g. mods do strange things to maps. For our use case, being a heuristic is perfectly fine.

Also, as a short-term solution exposing resource_patch_search_radius would be nice. I'm about to smuggle those across with hacks. Doesn't seem worth a small API request for that when I'm making the big one, though I suppose if this can't be done in general I may make a small one for that.

Post Reply

Return to “Modding interface requests”