0ptera / Inventory-Sensor

Factorio mod adding a combinator that reads inventories of wagons, cars, furnaces and more
Other
5 stars 6 forks source link

Could this be updated to read the filters on a wagon and supply an outstanding inventory ? #8

Closed billbo99 closed 5 years ago

billbo99 commented 5 years ago

I was wondering if this mod could read the filters in the wagon its next to ? If so my thought was it could get the stack size of the item requested in each filter slot and add that to a running total. Once it knows what is requested, it looks to see what is in the wagon and removes that from the running total. The running total is then returned by the inventory sensor as what is still outstanding to be loaded onto the wagon.

This way when you a long way off from your main base you could send a train to your "mall" with a set of filters applied for what you currently need. It then returns back to you with the required materials you requested.

0ptera commented 5 years ago

Short answer: Adding this would tank performance way too much for what little it adds.

Long answer: To read filters you have to iterate over every single slot in a wagon, just to see if a filter is set. Adding this on top of scanning for cars and manual trains, summing up all inventories and fluid boxes would make this mod use up more performance than entity update for a megabase.

PS: The described scenario is better handled by LTN.

billbo99 commented 5 years ago

no problems, was an idea, did not know how much it would cost in performance