[outdated] Some (maybe) useful tools for factory design
[outdated] Some (maybe) useful tools for factory design
I find it a lot of fun to optimize factories, so here is some tools to help with that.
1. factorio.py is a script to convert recipes into flowchart using graphviz. Recipes are entered into a table like factorio.csv, where 1st column is the product, 2nd column is the efficiency modifier (blue assembler has 0.75, furnace has 2, etc.), and the 3rd column is the time cost for 1 product. All the things you want as output belong to the first row. temp.dot is an example from my version of factorio.csv, and temp.svg is the factual flowchart, where the number on the arrows show volume and the number on the nodes show the number of factories your need. I know there is a nice lua script that read directly from the game files, but I cannot make it to run.
Update: I got the recipe directly from the game data so it should be accurate now (except for mining and the oil processing shit). Also raw materials are no at the top and output are now at the bottom, separated. The real improvement is that now you only need to modify the demand.csv file to create your own graph for a specific factory and the script will hide anything that's irrelevant.
Here is an example of a bootstrapping factory to beeline logistic bots. 2. playground.zip is a just an empty scenario with all the essentials (mines and electricity) so you can design your factory in map editor without doing the essentials yourself.
1. factorio.py is a script to convert recipes into flowchart using graphviz. Recipes are entered into a table like factorio.csv, where 1st column is the product, 2nd column is the efficiency modifier (blue assembler has 0.75, furnace has 2, etc.), and the 3rd column is the time cost for 1 product. All the things you want as output belong to the first row. temp.dot is an example from my version of factorio.csv, and temp.svg is the factual flowchart, where the number on the arrows show volume and the number on the nodes show the number of factories your need. I know there is a nice lua script that read directly from the game files, but I cannot make it to run.
Update: I got the recipe directly from the game data so it should be accurate now (except for mining and the oil processing shit). Also raw materials are no at the top and output are now at the bottom, separated. The real improvement is that now you only need to modify the demand.csv file to create your own graph for a specific factory and the script will hide anything that's irrelevant.
Here is an example of a bootstrapping factory to beeline logistic bots. 2. playground.zip is a just an empty scenario with all the essentials (mines and electricity) so you can design your factory in map editor without doing the essentials yourself.
- Attachments
-
- planner.zip
- A new version with separate output bubbles. Contains the script and the recipe, and demand list, they must be in the same folder.
- (4.48 KiB) Downloaded 617 times
-
- playground.zip
- A map with everything
- (473.9 KiB) Downloaded 564 times
Last edited by Palpatine on Fri May 23, 2014 7:25 pm, edited 2 times in total.
Re: Some (maybe) useful tools for factory design
What is the attached graph actually about?
You chose a pack of things to be made in a fixed ratio?
It would IMO really improve the appearance if you could get rid of that big output node
and get outputs separated.
Also - why the... fractions? Percentages? Why does 0.00<unit> go to the output from the right side?
Also - some lines fork (mmmkay) and some merge (confusing) + there are odd gaps in the lines in there.
Nevertheless, I agree that such tool might indeed be useful for those that want all factories at 100% capacity.
(I don't happen to be one of those, if everything is at 100% capacity, then everything is a bottlenect )
You chose a pack of things to be made in a fixed ratio?
It would IMO really improve the appearance if you could get rid of that big output node
and get outputs separated.
Also - why the... fractions? Percentages? Why does 0.00<unit> go to the output from the right side?
Also - some lines fork (mmmkay) and some merge (confusing) + there are odd gaps in the lines in there.
Nevertheless, I agree that such tool might indeed be useful for those that want all factories at 100% capacity.
(I don't happen to be one of those, if everything is at 100% capacity, then everything is a bottlenect )
Re: Some (maybe) useful tools for factory design
MF- wrote: if everything is at 100% capacity, then everything is a bottlenect )
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Some (maybe) useful tools for factory design
The set quantity for output is supposed to be unit per second. I didn't round the factory numbers because sometimes fractions helps in case you have speed modules nearby.MF- wrote:What is the attached graph actually about?
You chose a pack of things to be made in a fixed ratio?
It would IMO really improve the appearance if you could get rid of that big output node
and get outputs separated.
Also - why the... fractions? Percentages? Why does 0.00<unit> go to the output from the right side?
Also - some lines fork (mmmkay) and some merge (confusing) + there are odd gaps in the lines in there.
Nevertheless, I agree that such tool might indeed be useful for those that want all factories at 100% capacity.
(I don't happen to be one of those, if everything is at 100% capacity, then everything is a bottlenect )
I agree having output separated should help with the appearance. I need sometime to modify the script. The 0.00 on the right side just appeared because I set the speed module production at 0.001 per second.
The merge and fork thing is a simple graphviz option, just set the concentration=false at the beginning of the file and it should get fixed. I had the merge on because it sometimes helps with planning belt sharing.
Here is an example of with the merge/fork thing turned off (though I have changed some requirement for my new factory).
Re: Some (maybe) useful tools for factory design
Thank you - this shall be used mercilessly when I will upgrade my manufacturing base.
Re: Some (maybe) useful tools for factory design
this script would be perfect for the tight spot challenge. I did that with a pen and paper to get my factories balanced, which is actually the point of these missions, rather than using few space.
It would be great to have it read directly from the game files though.
It would be great to have it read directly from the game files though.
Re: Some (maybe) useful tools for factory design
Ha, much better.
Is it possible to keep "fork" while turning off "merge"?
I don't have anything against forks.
PS: I noticed that Coal input node is rather hidden.
It sure makes the graph more compact, but on the other hand it allows such input to be missed.
I wonder if it would still be compact enough if inputs were forced to the top layer. Or different node border style?
(just a thought, with only a handful of raw materials available it's not that hard to spot something is missing)
one more number question: so.. the number IN the node bubble says how many assembling machines are necessary?
Is it possible to keep "fork" while turning off "merge"?
I don't have anything against forks.
PS: I noticed that Coal input node is rather hidden.
It sure makes the graph more compact, but on the other hand it allows such input to be missed.
I wonder if it would still be compact enough if inputs were forced to the top layer. Or different node border style?
(just a thought, with only a handful of raw materials available it's not that hard to spot something is missing)
one more number question: so.. the number IN the node bubble says how many assembling machines are necessary?
Re: Some (maybe) useful tools for factory design
Cheers! I got a new version working. I have updated the original post. And yes the number in the bubble means the number of assemblers necessary. It is accurate for furnace and chemical plant but not accurate for oil processing and mining.MF- wrote:Ha, much better.
Is it possible to keep "fork" while turning off "merge"?
I don't have anything against forks.
PS: I noticed that Coal input node is rather hidden.
It sure makes the graph more compact, but on the other hand it allows such input to be missed.
I wonder if it would still be compact enough if inputs were forced to the top layer. Or different node border style?
(just a thought, with only a handful of raw materials available it's not that hard to spot something is missing)
one more number question: so.. the number IN the node bubble says how many assembling machines are necessary?
Re: Some (maybe) useful tools for factory design
Cheers!
Does it get weird when you request an intermediate product (as in the picture currently in the OP for the advanced circuits)?
I guess having the output node had some benefits for the graph structure.
I wonder what it would look like if there were dedicated output nodes for each output item.
Would it improve the overall structure and readability of the already great tool?
Currently its not really obvious how many items get produced, which could be nicely improved by labeling those dedicated output nodes like "82x advanced_circuit"
final number question: What does the number on "Water" say? "8.42" seems too much for the offshore pump count
Does it get weird when you request an intermediate product (as in the picture currently in the OP for the advanced circuits)?
I guess having the output node had some benefits for the graph structure.
I wonder what it would look like if there were dedicated output nodes for each output item.
Would it improve the overall structure and readability of the already great tool?
Currently its not really obvious how many items get produced, which could be nicely improved by labeling those dedicated output nodes like "82x advanced_circuit"
final number question: What does the number on "Water" say? "8.42" seems too much for the offshore pump count
Re: Some (maybe) useful tools for factory design
Nice tool, thank you for that.
I modified dot_print(items) to show the required assembling machines/ furnaces on the arrows/edges (after items per second) when the item is used in different recipes, makes it easier to create "subfactories"
Here's the code if anyone is interested:
I'd try and do it myself, but I don't know Python
I modified dot_print(items) to show the required assembling machines/ furnaces on the arrows/edges (after items per second) when the item is used in different recipes, makes it easier to create "subfactories"
Here's the code if anyone is interested:
Code
And the graph for a factory that produces 1.5 solar panels per second:
What I'd like to see is a way to tell the script that i want to run x assemblers at 100% capacity, so demand.csv could look like: Code: Select all
solar_panel,1,basic_accumulator,1,speed_module_3,2
mode=0 <- 0 means assemblers, 1 means items per second
Re: Some (maybe) useful tools for factory design
I don't understand graphviz although I'd like to mathematically optimize my factories
Re: Some (maybe) useful tools for factory design
I'm not really sure what you don't understand, so here's a quick todo list:nepp95 wrote:I don't understand graphviz although I'd like to mathematically optimize my factories
0. download, unzip the archive from OP
1. install python and graphviz
2. edit demand.csv to your liking
3. run factorio.py
4. open the Downloads/temp.dot created by factorio.py with Graphviz
5. profit
Hope this helps, else let us know what's not working/clear.
As a follow-up to my previous post:
Code: Select all
rocket_defense, 1.5
Graph
Challenge accepted, anyone? Re: Some (maybe) useful tools for factory design
I'd imagine getting 150 alien artifacts per second would eventually become the biggest problem. Even several largest chests of AAs will get dry very fast (probably even before you can "debug" your layout).
Although ~150K of iron plates per second seems scary, I'm pretty sure it can be parallelized enough.
Although ~150K of iron plates per second seems scary, I'm pretty sure it can be parallelized enough.
Re: Some (maybe) useful tools for factory design
@Choumiko,
Ofcourse I forgot to download python And I even considered myself a programmer...
I think I get it now
-Edit-
The number you put in demand.csv, what should this be if you, for example, want one assembler 2, to produce at max capacity?
Ofcourse I forgot to download python And I even considered myself a programmer...
I think I get it now
-Edit-
The number you put in demand.csv, what should this be if you, for example, want one assembler 2, to produce at max capacity?
Re: Some (maybe) useful tools for factory design
normaly the numbers is desired items per second, so for 1 assembler lvl 2 it should be x = 1 / crafttime * 0.75
e.g. for SciencePack 1 with craftingtime = 5: 1/5*0.75 = 0.15
put in 0.15 in demand.csv and your good to go
e.g. for SciencePack 1 with craftingtime = 5: 1/5*0.75 = 0.15
put in 0.15 in demand.csv and your good to go
Sure it can, what i menat with impossible is: can Factorio handle the amount of assemblers? (e.g. 6k for speed module 3 assemblers alone ) I imagine the engine is going to reach it's limits rather quickly.just_dont wrote:Although ~150K of iron plates per second seems scary, I'm pretty sure it can be parallelized enough.
Re: Some (maybe) useful tools for factory design
And to think I was doing this all by hand... Though this does confuse me a little. For example, why do you need to mine more iron than iron plates? Shouldn't those be the same or am I just missing something super obvious?
Re: Some (maybe) useful tools for factory design
The numbers inside nodes do not describe the number of items you need per second, but the number of furnaces / miners / assembly machines required to produce the required amount of items (the numbers are apparently wrong for oil / chem plants). For the number of "items per second", check the edges. The sum of inputs / outputs add up correctly for the cases where I checked this.
Re: Some (maybe) useful tools for factory design
Oh okay, so it was something stupid obvious. So you would need 100 something miners for that... Wow. Still this will beat doing to all by hand. Thank you!