DanielKote / Foreman2

Visual planning tool for Factorio
Other
162 stars 16 forks source link

Feedback about planning mega-bases #5

Closed OmarTawfik closed 2 years ago

OmarTawfik commented 2 years ago

First, I'd like to thank you for this amazing tool. I started a new mega-base a couple of weeks ago, and rather than factoriolab/helmod/other calculators that simply solve the matrix by providing the recipe results/counts, I wanted something that I can do spatial planning with (arranging nodes in a map layout), the same as I'd plan my actual mega-base, in order to better visualize the dependencies, and avoid congestions. After quite some time of planning/searching, I almost gave up and started implementing my own graph algorithm, until I found Foreman, which proved amazing for this exact purpose!

I had a few suggestions/questions about this tool, and wanted to get your thoughts on whether you are considering adding this, or if it is feasible for a first-time contributor to add it without large architectural changes. I've arranged them according to priority (relative to my own use-case), and would leave the prioritization up to you of course.


Rotation of the edges along the nodes (Hi Pri)

Because this tool is really useful for planning a map layout, I think we should be able to "rotate" the nodes, so that we have inputs/outputs coming from up/right/left sides. This enables having a central "lab" node that receives science packs from all directions, and be able to plan where the rest of the factories should be around it, instead of forcing the top/down approach where the item flow always go upwards.

Warnings on disconnected inputs and outputs (Hi Pri)

It is common to delete edges/nodes in order to refactor a factory. In a large graph, it is really easy to forget to reconnect inputs/outputs after you are done. Having a visual aid to point them out would be great, and would prevent us from having surprises later when we discover that we forgot a mini-factory. Perhaps some visual indicator that tells us how many connections are missing (or better yet, where they are).

Default Settings for beacons (Mid Pri)

We can already set the default module settings for assemblers. Is there a way to set the default settings for beacons as well? For example, it is common to have a 12-beacon layout (full of speed 3 modules) around each assembler. Having to copy/paste this setting on all nodes is time consuming.

Space Science Packs (Low Pri)

Is it possible to add a recipe for the space (white) science packs? It is officially documented, and can be useful in planning SPM style mega-bases.

Lab Recipe (Low Pri)

For planning mega-bases, it is common to start with a SPM goal. Like for example, having a mega-base that can produce 1k science packs per minute (of each kind). Adding a lab recipe that accepts all science packs as input would be great for this kind of planning.

Belt/Wagon Counts (Lowest Pri)

Edges currently represent how many items are needed, and it is great how its thickness is relative to the amount of items. It would be helpful to map these numbers to number of belts (or wagons) as well. Perhaps as text on the edge itself.


Again, thanks for the amazing tool! I know it has already saved me quite some time in my planning.

DanielKote commented 2 years ago

Glad you liked it, and glad its helping you out! Now, in terms of your suggestions:

  1. Rotation of input/output directions: I am honestly not sure about this one - while an option to choose a direction (left to right or bottom up) was something I thought about, but even that requires quite a bit of work restructuring the entire graphical node representation, to say nothing of making each node be individually rotatable. Plus, a single direction is I think a necessity so as to know what is going on in the graph and be able to read the overall flow - you know inputs come from one side and outputs leave in the other. So as of this point in time, I think the node orientation will stay as is, sorry.

  2. Warnings on disconnected I/O: This is something I also thought about, and in fact I added the red border around the disconnected inputs/outputs for this exact reason (though currently they are marked as such if they have a non-zero value, something I will probably change). Just as with error/warning arrows I can also add in an option to point towards any such instances off-screen, so hopefully that helps things out.

  3. Default beacon settings: Sure, seems like something I can include. I didnt really think it was necessary seeing as how you can just set up your preferred beacons, copy the node, select your entire graph, paste beacon settings; but its not too difficult to add so why not.

  4. Space science packs (and I guess fish as well): I dont want to include any 'hard-coded' recipes that dont come from the actual game, That being said, space science packs and fish are both things that can be read from the factorio data as 'launch product', so I guess I can implement them by granting them a specific recipe of 100 rocket parts, 1 original item (stack), to resultant item (stack). I will need to test things out to see how it would work out, but this seems doable. Certainly not as difficult as implementing fuel was.

  5. Lab Recipes: I will need to look into this, but at this point its a bit of a low priority. If you really want to design for a specific SPM (and I know where you are coming from - this entire project started as a way for me to plan out my seablock base for endgame science research), you can always just start with the 6-8 science packs as your 'outputs' with the given throughput set and plan from there. Not exactly ideal as you have to set the flow for each, but I think thats fine for the moment.

  6. Belt/wagon counts: honestly, not sure how I would handle that. Besides the extra text that needs to be written in such a way so as not to clutter the screen / overwrite itself in tight spots, there is also the issue in terms of which exact belt to use, what wagons/time unit would be considered ideal, what length of pipe to consider as standard (for fluids), etc. I know helmod offers this option, but for a table layout its much easier to include this than for a graph layout.

OmarTawfik commented 2 years ago

So as of this point in time, I think the node orientation will stay as is, sorry

Totally understand this decision. Maybe an option to turn the edges into straight lines then? will be significantly better even in the existing layout.

Just as with error/warning arrows I can also add in an option to point towards any such instances off-screen, so hopefully that helps things out.

That would be great. Even a simple warning that "some" nodes are missing connections might be enough, so that users can inspect the graph visually. Even better, if the warning actually points to the missing nodes.

select your entire graph, paste beacon settings; but its not too difficult to add so why not.

Sounds easy enough. I understood that different "assembler" types need different copy/paste. But if I can just do that globally, I think that workaround would do for now.

That being said, space science packs and fish are both things that can be read from the factorio data as 'launch product

Yeah. I wonder if we can automatically read "recipes" involved in buildings like the rocket silo. Certainly the UX displays it as such. Maybe the internal representation is different.

but for a table layout its much easier to include this than for a graph layout.

Makes sense, this is why I included this last.

DanielKote commented 2 years ago

Well, I added a few of the features to the recent V7 release;

OmarTawfik commented 2 years ago

Thank you! I also implemented node flipping (top down only, no right left) in #8. It works "well enough" for my specific use case, so probably missing some edge cases, but wanted to share the code in case you find it interesting/useful.

DanielKote commented 2 years ago

Ok, I took a look at your code and while it was rough around the edges (literally in the case of link lines - i guess you never tried it with dynamic link widths), and it wasnt as complicated as I thought it would be - mostly because the flipping of up/down is simpler to handle than any situation of going left/right. I did find some use for it in my own graph making (mostly for combining flows for circulating back), so there are possibly some others that would find it useful as well. Feature was added (and will be published in the next release, but for now you can access the code and build it yourself if you wish to play around with it).

OmarTawfik commented 2 years ago

Of course you already added it, because you rock!

I used the latest from Main, and it works great! One last thing to note:

If you drag a new connection from a "flipped" node to create a new node/recipe attached to it, the created node doesn't have the same direction, and you would need to right-click and "flip" it again. This would have to be repeated for every new node created.

I handled it in #8 in ProductionGraphViewer.cs (here) by copying the direction of the original node when creating a new one. This makes it easier to branch out from flipped nodes. You might have other opinions on the UX though.

DanielKote commented 2 years ago

Eh, alright - why not. I can add that change. In fact - already did so. Wont push for a release with this, but it will be there in the next release (Dev9 - its out now)

OmarTawfik commented 2 years ago

You rock! I'll close this for now. Thanks again for the great tool.