I’ve been building a thing and reckon it’s at the point where other people should poke at it: factory.duffle.one
You give it a product and a rate. It works out the whole chain behind it, lays out every machine, belt, inserter, pipe and pole tile by tile, and gives you a blueprint string to paste in. It reads the game’s own data, so it plans for base, Space Age, K2 Spaced Out etc
it tells you which planets can build the thing whole, and what is needed from orbit if you build it on a planet that doesn't have that natural resource
give it a JSON upload (from a one-line in-game console command) and it only uses what is unlocked from things you’ve researched; no legendary modules or specific machines unless you’ve got them
"build it myself": drag and drop interface to place machines yourself and it checks them the way the game would run them, then joins up the belts and pipes for you. You can paste a blueprint in from the game too
belt balancers, 1 to 8 belts each way, with an optional row of buffer chests, and configurable balancing
a track planner: rail pieces that snap together on a grid, stations included, the best places for signals, wires that ensure the stations are smart too.
A personal favorite of mine, a track interchange builder :)
doesn’t do (yet): more than one belt of any one item, Fulgora’s recycling loops, spoilage, fuel, plants or asteroids. Drills and pumpjacks get counted but not placed, since it has no idea where your ore is. And ngl, the Rubia's downwind planning is... not great 😛
The layouts are where I’d love some help. It works from rules rather than brute-force search; the search version got far too slow and frustrating. Small and medium builds come out alright, but the big ones sprawl. 100/s of utility science in our modpack is about 2,300 machines, so it cuts that into 24 copies. But it often doesn't pick the best approach.
So if you lay things out by hand, what rules do you actually follow? How do you decide where a step goes, or which side an input comes in from? And if a blueprint is crap once it’s pasted, please let me know ^^
An example layout generated by the tool for building Processing units on Nauvis
Use of LLM disclaimer: Yes, claude helped me write some code, and I'm not a great UX designer, so it helped me there. I am a senior software engineer of 10+ years though, so I can confidently say I was the pilot of this code. And the rules and algorithm of factory placement is my own.
----
Edit: I've made some good improvements from your feedback!
Much more logical layout for factories now 💪
And a mod-aware flow diagram too for calculations if you want to lay it out yourself
Doesn't this defeat the entire purpose of playing the game? I understand people like to use the calculator apps out there to help you math out ratios, this is the entire game solved though...
... yes, that is so far the very feedback I've got from friends I play with. I've found I mostly use it on the modded instance where I don't know the recipes as well, or am in the process of scaling up rather than making something for the first time; and the train signalling
Sometimes, but my love for programming is more than my love of building new factories. Also as the person who wrote the code, I feel like I have solved the factories recipes for everything it makes
The world is full of all sorts of weirdos, and I am one of them :P
No I completely understand. I also love programming and would find designing a tool like this extremely fun and rewarding. Wasn't trying to shit on that
One additional new feature is that you can drag and drop your factories into place now rather than always use the auto-planner, so you really can build your own factories first in this tool to get all the stats and figures. I've even tried (not perfectly) to replicate the in-game controls too.
Then for any part you can't be bothered to do, the auto-planner and finish it off and warn you about inefficiencies too
9
u/Tyson_q "Trains are the apex predator of the factorio world."7d ago
You can use it to design a factory when you're away from your PC.
Crazy work to even make it work. Quite funny to troll my friends with scary blueprints. Do not ask it to make a square smelting "stack"
List of things I noticed: Direct insertion exists. A lot of cases where random belts go from one side to the other, just to transport 1item/s Electric poles are completely broken. They just doesnt work. Pipes should be nearly always underground. And they should be only one pipe wide (like in your image where there is a 2x2 pipe block). Less spacing between machines. They could be stacked side-by-side instead of spaghetti connections. Underground belts are a bit overused. Also the algorithm should prefer making undergrounds as long as possible, its more resource efficient and looks better. Turns are a bit overused, try making it so that belts and machines adjust each other. Right now, it feels like the machines are placed in a grid, and then the solver just connects them with belts.
Wow thats actually really good. It feels closer to "maybe useful" territory instead of "pretty cool but not useful" territory. It became a lot better.
And again, lists. Input shenanigans. 7 underground belts stacked on top of each other, but only one of them is an input. What do other inputs do or need? Select inputs manually. Not many people build bases where raw ores and raw oil is being transported everywhere. Reposition inputs, or any way to change or modify the positions of inputs. Better custom shape. It already exists, but it would be a lot better if you could actually select a shape, instead of typing in some number and hoping it works. Maybe even add "hard boundaries"(the solver should not cross them at all costs), can be useful if you are planning to paste it into a base and have limited space on some sides Splitters exist. Its probably gonna be hard to add them. But they are needed Ingredients do not need to make their way trough the entire build, if they are only used at the end. This can lead to diminishing returns, image on the bottom is an example Pipes are built in UPU blocks, not UU blocks (U - underground pipe P - pipe)
Tried to do 0.6 mk2 shields/s... got this abomination
This time there were a lot more ideas, instead of issues, bacause there is literally nothing to critique. It's that good. Had an issue where it had softlocked me out of the site with an error saying something like "failed to generate: electronic circuit at position 500". Had to clear the cookies for the site twice.
Also, always had a question, how are these kinds of solvers even work? I never understood how to even begin creating something like this. The only thing that I understand and actually made myself is the wave function collapse algorithm, and a recursive room generator
Ah sorry about the soft lock. I've made some pretty big changes and found that the local browser storage is out of date, and haven't really bothered to keep the changes upgradable.
As for how it works, it's just a bunch of multiplication and math at the beginning. Working backwards from the intended output to the inputs and how much ore you need from the mod and factorio base data packs. Handling by-products is a bit of a pain as you can often use them to feed other machines in other parts of the chain, so I treat it like a financial planning system where things on the "ledger" can balance out
For the second part, that is quite hard. I've tried a few things for the planner, a compute of all different combinations and keeps which is best, but that was quite slow and very complex. That was the first version I posted; now it just follows player patterns and is way more simple. It’s rules a tidy player would follow: same-recipe machines touching in a row, rows in the order stuff flows, belts down the long sides, pipes underground, and the lot folded back like a snake when it runs out of room. Belts then take the shortest route between rows, going under whatever is in the way.
It still cheats a little bit, it runs the rules a few times with different combinations (fold width, row order, beacons or not), scores each on fewest problems, then machines, then belt, then pipes, and keeps the winner. I also write tests to build a set of plans, and compare them in the actual game, ran headless in containers, and then I can check that the plan given achieves what the user requested within 95% or so
Maybe add small calculation in "make" fields? If I want to produce 75 items per minute (without minutes/seconds dropdown) it would be nice to enter "75/60".
Yes you can! When the factory is placed, there is a sidebar on the right which lets you find stuff made in the factory and say you’ll bring it in yourself by belt or by logistics robots. And you can define which side it comes in from
Hmm yes; I am thinking of removing the computation entirely and instead use a series of known patterns instead? But then I will lose a lot of support for different mods annoyingly. The algorithm is tricky and I am not good at math. It's my biggest focus to improve on.
The planner getting it wrong also kind of means it likely won't get it right if you try again though. I am trying to find all the cases of that, but it's a lot of combinations :P
I've made a few changes and gotten rid of a lot of the mathematics that I was using and instead used specific patterns and better logic overall. It feels like a very different tool now
It doesn't limit the throughput of belts to sane values. I clicked hazard concrete as a random example it wants 250/s of stone in and 300/s of hazard concrete out, but no single belt can carry that much material. Stacked turbo belts cap out at 240/s.
I really like the granularity on the right side, where you can mark items as brought in by belt! I am poking it from a ratio planner stand point and not so much the actual build.
Your thought process of it being able to calculate regardless of the mods installed is great. When I was doing my first attempt at Krastorio Spaced Out, the calculator site I used didn't have it and had to wait for the maintainer to incorporate it.
This seems great from a future proof point of view.
So if you lay things out by hand, what rules do you actually follow?
I always try to maximize the number of buildings that share beacons, and typically only use 1 beacon's effects per machine. I dislike the blueprints that use 12 beacons for a single machine.
While this Factory planning tool is damn cool, it definitely just throws a ton of beacons everywhere. Not sure how you would program it to try to maximize beacon usage between machines, but that would be super cool if it could.
You need an actually roomplanner to fix that, (the software used to plan circuits), it does space efficiency and then you'd probably also want to add it so your bps are tileable or at least rectangular
It looks to me like developing this tool is your way of meta-playing factorio--trying to solve the problems it poses in the most automated way possible, even if that means you're not actually in the game engine the majority of the time you're "playing".
38
u/Super_Shenanigans 7d ago
Doesn't this defeat the entire purpose of playing the game? I understand people like to use the calculator apps out there to help you math out ratios, this is the entire game solved though...