DanielKote / Foreman2

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

add a "factory block" as in the mod Factorissimo2 #11

Open flameSla opened 2 years ago

flameSla commented 2 years ago

in Factorissimo 2, you can collapse a large production chain into small compact buildings example https://disk.yandex.ru/i/nd5zefXjRg7Kew this will make it much more convenient to work with large schemes

DanielKote commented 2 years ago

Not sure about the actual implementation, but the idea of factory blocks similar to the ones in the Helmod factorio mod was always in the list of features I planned to add to foreman. Due to the complexity of this it is more of a long term project though... There are currently a few options:

  1. (most likely) a sort of border you can place around existing nodes that denotes them as a 'factory block', meaning you can set the number of assemblers inside the block, as well as the # of blocks (or leave either as automatic) and the solver will calculate accordingly. This has the benefit of keeping everything on a single graph (without multiple layers/surfaces), but comes with its own issues. As with all options, it isnt simple to add.

  2. Add options to input/output nodes to not just have them as general beginning/ending nodes, but also to 'connect' similar to train stations to opposite nodes of the same (user-given) name. So you can have multiple disconnected 'factories' that output iron for example, and other disconnected 'factories' that require iron as an input, and as long as you set those i/o nodes to have an 'iron 1' name the solver will just add links between them in the background, without you having to worry about it. As a bonus it is possible to add multiple layers/surfaces relatively easily, though it is a 'worse' option in my opinion

  3. Something similar to your example where 'custom' nodes can be added into the main graph each representing a custom layer/surface with its own input/output. This is by far the most complicated approach, but I do like the graphical representation of it. I will give it some thought. The giant issue (besides the complexity) is how to work with multiple 'factory' nodes? Imagine someone creates a factory node for producing iron. Then he copies it such that there are now 2 factory nodes creating iron. Are they different factories? should changes in one impact the other? If they are both representations of the same subfactory, they are quite likely to have different throughputs - one could have 10 iron/sec out, the other 100. How do you display that? do you give an option to select which factory you wish to look at? or give a drop-down option to choose? But how do you know which of them you are currently viewing? There are just so many questions about the UI implementation for this...

Keep in mind - this is all long term, and in all cases involves extensive changes to the current graph design. Depending on my free time I might not get to it for a while.

flameSla commented 2 years ago

The giant issue (besides the complexity) is how to work with multiple 'factory' nodes? Imagine someone creates a factory node for producing iron. Then he copies it such that there are now 2 factory nodes creating iron. Are they different factories? should changes in one impact the other?

it is possible to distinguish by the names of factories if the names of the factories are the same, then this is a reference to one object if the names are different, then these are two different objects