Logistic Network Modding

Place to get help with not working mods / modding interface.
Post Reply
Lindor
Inserter
Inserter
Posts: 30
Joined: Sat Sep 28, 2019 10:54 pm
Contact:

Logistic Network Modding

Post by Lindor »

Hello :)

I came back to factorio after 4 years and want to create a lot of mods now, and right on top of my list is the logistic network. What i envision so far:



1. Logistic chests get an (ingame settable) ID and can only request from / send to chests inside the same network with the same ID. Default ID is 0, which is also what construction bots and the player(s) send to / request from. This way proper logistic subnetting is achievable.

2. Ingame upgrade-planner-like tool for easily setting the ID of all chests in an area. Has blacklist/whitelist option for chest types. I envision it to be yellow.

3.1 Bots pathing gets fixed + less calculation heavy: instead of limiting the accumulator size and letting them charge mid-flight, the bots have infinite accumulator size and calculate how much juice they need and charge up before the flight. This way bots don't fly passed the very roboport they need to charge from and it's more UPS-friendly at the same time. It saves calculations as there's exactly 3 straight pathways per task to calculate. No need to recalculate the path everytime the bot charges.
3.2 Alternatively, i could have limited accumulator size and search only for requests within flight range. Potential tasks out of flight range would be ignored. Then i would introduce a bot accumulator size research. The charging/pathing pattern as described in 3.1 would stay. There would be no "staggering" introduced. If you want a bigger network, you'd need to research more accumulator size.

4. Strict Request priority hierarchy. Bots always prioritize storage chests for taking items no matter how far the distance. Hierarchy would be something like: active provider -> storage -> passive provider -> buffer. Not set in stone, i'm still thinking about the order. I'm open for suggestions.

5. Ingame settable whitelist for the type of chest a requester/buffer chest can request items from. So if you e.g. want a buffer chest to only receive items from active providers, you can do this. Buffer chests can never request from other buffer chests.

6. Roboports have dedicated slots for construction and logistic robots. A logistics bot won't take away a construction bot's slot and vice versa.

7. It's possible to read the amount of bots inside a single roboport into a connected circuit network. It's also possible to read the amount of repair packs.

8. Maybe higher tier roboports with more charging spots and storage. I know this is possible as i played with a mod which did that at some point. Can't remember the name.



I'm not as new to programming as i was 4 years ago, but over the years i have gotten unfamiliar with the factorio API. So i have lurked around the forums and the API pages to look for where i could possibly start. The API documentation is very massive and confusing, not easy to find what i'm looking for, but unfortunately the logstic network system seems to be pretty hardcoded.

At first, there seemed to be no way to micromanage the chest requests. So i thought: let's just throw the old chests out of the window and recreate them from scratch, then.

But then second, there also didn't seem to be a way to micromanage bot tasks. If i code my own logistic requesting system, then i need control over the bots. So i thought: okay, then let's also ignore the Vanilla bots and create our own ones.

And maybe i will even have to do my own roboports if i fail to get the vanilla ones to hold my bots inside. I think getting my bots to charge at a vanilla roboport would be possible, i just don't know how to get them inside yet.

So basically, i would first need to recreate everything that Vanilla does for the logistic network from scratch, and then on top of this i'd need to do the changes i envision.


Now here are my questions:
1. Are my observations correct that the API gives you not the power to micromanage from which LuLogisticPoint requests request? If no, then how can it be done?
2. Are my observations correct that there's no way to micromanage bot tasks? If no, then how can it be done?
3. Do you think my idea of recreating everything from scratch could work? If no, do you have suggestions how to do it then?
4. If i was a skilled programmer who does it for his living (and i don't know wether i have what it takes yet), would my estimation of one week work be realistic?
5. Is it worth it?
6. Do you have any further suggestions / opinions / comments? What do you think about my ideas?

Thanks for reading and for every reply :D

Post Reply

Return to “Modding help”