Factorio

Factorio

View Stats:
Hurkyl Nov 3, 2024 @ 9:40am
Automated mixed rocket delivery
I've noticed that when you load a rocket silo up with a single item type, it will automatically deliver the cargo to a space platform requesting it.

I worked out a system to load rockets with mixed item types to satisfy multiple small requests. Unfortunately, autodelivery doesn't seem to work and I have to manually deliver cargo and choose a platform.

Am I doing something wrong, or is this just impossible? To be explicit, the question is:

Can you make the rocket silo ever automatically launch a rocket when the silo contents have two or more types of items? If so, how?
< >
Showing 1-10 of 10 comments
Halko Nov 3, 2024 @ 9:46am 
There is no easy way because solving that issue is really stupidly hard. You will either waste rockets sending too much to space or waste rockets sending too little. The problem is actually a really famous logic problem for computers that i cant remember the name of ATM that people have thrown literal supercomputers at with no proper solution. Just set it and forget it and only worry about mixed rockets when you are doing something specific like building a station or ship.
Chindraba Nov 3, 2024 @ 9:47am 
So far, no can do. Manual for mixed loads.

The second best, and no good for you, is the ability to allow autolaunch with less than full loads, still of a single item, in special item cases.
Chindraba Nov 3, 2024 @ 9:47am 
Originally posted by Halko:
There is no easy way because solving that issue is really stupidly hard. You will either waste rockets sending too much to space or waste rockets sending too little. The problem is actually a really famous logic problem for computers that i cant remember the name of ATM that people have thrown literal supercomputers at with no proper solution. Just set it and forget it and only worry about mixed rockets when you are doing something specific like building a station or ship.
Backpack
RiO Nov 3, 2024 @ 9:49am 
Originally posted by Halko:
The problem is actually a really famous logic problem for computers that i cant remember the name of ATM that people have thrown literal supercomputers at with no proper solution.
Let me help you with that one.
It's the knapsack problem[en.wikipedia.org].

It's one of those famous problems that are NP-complete.
I.e. for which it's only known that an efficient polynomial-time solution exists to verify the correctness of a given answer; but no solution is known to exist to compute such an answer itself in polynomial time.

Or to think of it in another way: it's the class of problems that can only be solved by brute-force.


For knapsack in particular, approximations do exist in polynomial-time - however.
But it'd be hell to express as Factorio circuit combinators, no doubt.
Last edited by RiO; Nov 3, 2024 @ 10:00am
Zaflis Nov 3, 2024 @ 9:51am 
Originally posted by Hurkyl:
Can you make the rocket silo ever automatically launch a rocket when the silo contents have two or more types of items? If so, how?
I believe so yes. You can fill rocket inventory with inserters IF it is not in automatic mode. Rocket will automatically launch them to platforms if they request those items. But rocket may need to have full ton of items on it. It would be tricky to prepare even mixed loads with circuits to maybe a chest buffer first.

All in all it's better to have automatic mode deal with it and just build more silos. They're cheap.
Hurkyl Nov 3, 2024 @ 9:59am 
Originally posted by Halko:
There is no easy way because solving that issue is really stupidly hard. You will either waste rockets sending too much to space or waste rockets sending too little. The problem is actually a really famous logic problem for computers that i cant remember the name of ATM that people have thrown literal supercomputers at with no proper solution. Just set it and forget it and only worry about mixed rockets when you are doing something specific like building a station or ship.
I already solved the automatic loading problem, it was the automated launching that I wask asking about.

The difficulty of the knapsack problem is about worst-case storage requirements. Individual problems can be very easy. For example "give exact change" is a very easy to knapsack problem to solve, because of the actual denominations of coins: the greedy solution (always pick the biggest item that still fits) always works.

For loading a rocket, I found the greedy solution usually works. I was willing to accept manual intervention for "not quite full" situations (although it would be even better if I could give the silo a signal to launch anyways) for the added convenience when inventories are actually full. Even better would have been if I had an automatic way to tell the silo to launch.
Brad Jan 7 @ 7:38am 
Originally posted by RiO:
Originally posted by Halko:
The problem is actually a really famous logic problem for computers that i cant remember the name of ATM that people have thrown literal supercomputers at with no proper solution.
Let me help you with that one.
It's the knapsack problem[en.wikipedia.org].

It's one of those famous problems that are NP-complete.
I.e. for which it's only known that an efficient polynomial-time solution exists to verify the correctness of a given answer; but no solution is known to exist to compute such an answer itself in polynomial time.

Or to think of it in another way: it's the class of problems that can only be solved by brute-force.


For knapsack in particular, approximations do exist in polynomial-time - however.
But it'd be hell to express as Factorio circuit combinators, no doubt.
OK, but why do I care about value? Factorio items don't have built in sets of values as presented in the knapsack problem. The knapsack problem has an additional variable that doesn't exist in this situation. The problem of mixed rockets is solvable with linear algebra, where we only care about weight being below or equal to a set maximum. Value doesn't play into it, so the problem here is much, much simpler.
Originally posted by Brad:
Originally posted by RiO:
Let me help you with that one.
It's the knapsack problem[en.wikipedia.org].

It's one of those famous problems that are NP-complete.
I.e. for which it's only known that an efficient polynomial-time solution exists to verify the correctness of a given answer; but no solution is known to exist to compute such an answer itself in polynomial time.

Or to think of it in another way: it's the class of problems that can only be solved by brute-force.


For knapsack in particular, approximations do exist in polynomial-time - however.
But it'd be hell to express as Factorio circuit combinators, no doubt.
OK, but why do I care about value? Factorio items don't have built in sets of values as presented in the knapsack problem. The knapsack problem has an additional variable that doesn't exist in this situation. The problem of mixed rockets is solvable with linear algebra, where we only care about weight being below or equal to a set maximum. Value doesn't play into it, so the problem here is much, much simpler.
Please explain what additional variable that makes rocket capacity and things added to it with given weight values different from knapsack problem...
Wolfie Jan 7 @ 11:19am 
Sure, finding an optimal solution with minimal unused space is probably not feasible in the general case. But requiring me to send full rocket stacks of single items every time is *way way less optimal* in every case.

If I'm building a new space platform and it needs, for example, 3 gun turrets, 4 asteroid grabbers, 4 smelters, etc, those can often fit into a single rocket with space left over but instead the game insists on sending up 50 turrets, then 50 smelters, etc. Utterly ridiculous, when in even the greedy algorithm would be more efficient:

Sort the list of requested items by weight: Heavy items first. Add those requested items to the rocket until you've fulfilled the request or can't fit more. When done with that item, move to the next item and try to fit as many as requested into the space remaining in the rocket. Would it be optimal in every case? Probably not, though because of the divisible stack sizes etc such cases would be rare. Just like with coin changing. But it is always more efficient than sending up stuff *I don't need on the rocket*. If I want 4 smelters and no more, and the game sends 50, then in terms of value that's no different than if it had sent a rocket with 4 smelters and nothing else because those remaining 46 smelters have no value on the platform. So it might as well try to at least fill the space of the remaining 46 smelters with something else that's actually requested.
Last edited by Wolfie; Jan 7 @ 11:20am
Zaflis Jan 7 @ 11:59am 
Originally posted by Wolfie:
If I want 4 smelters and no more, and the game sends 50, then in terms of value that's no different than if it had sent a rocket with 4 smelters and nothing else because those remaining 46 smelters have no value on the platform. So it might as well try to at least fill the space of the remaining 46 smelters with something else that's actually requested.
That is what the "minimum request amount" is all about, it's meant to be used. Sure it will leave an empty gap of 46 smelters worth in the rocket when used in automation, but does that really matter when rocket launches are dirt cheap.
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Nov 3, 2024 @ 9:40am
Posts: 10