Helfima / helmod

Factorio Mod
149 stars 64 forks source link

Deeper Layers (blocks within blocks) Feature #474

Closed Krydax closed 3 months ago

Krydax commented 11 months ago

Writing this here because KiwiHawk asked me to!

So this is a big one. I know FP can do this, YAFC can do this. Hell, Microsoft Word can do this. Jokes aside, we need to indent more!

I'll start with a primary case where you run into this, and you can imagine many more. Pyanodons science. I haven't played Factorio in months since I got burnt out a bit, so apologies if I remember something wrong, but my overall point stands regardless :)

I'll use my circuits in py as an example. Below you can see the full production line, with 3 blocks in it. image

Going into the "circuits" block, you can see the issue. There are SO many components. I would WANT to separate some of these into a sub-block!. image

For example, I would want to make the Printed Circuit Substrate section its own block. image

A sub block would perform to a block the same way a block performs to a line. Linking sub blocks to other sub blocks would work exactly like linking blocks works within a line. All of the exact same logic, just one layer deeper. This would allow for much larger builds to be "feasible" in helmod. Currently the lack of sub-blocks (or even sub-sub-blocks) is preventing us from really planning out entire builds in helmod. Rather, we are forced to make many separate lines that technically are all part of the same overall "thing". But you can't combine lines in helmod. So the solution is that we need to be able to go deeper within a line!

Here's an idea for a "plus button" that could expand all sub-blocks within a block. Maybe too much feature creep. Even just showing sub blocks directly below the block (and not being able to expand/collapse) would be fine! image

EDIT: Currently it looks like a line can ONLY have blocks, and blocks can only have recipes. To stick with that theme, we could make it so that if a block is to have sub-blocks, it cannot have any normal recipes (basically making it a sub-line).

For example you could have:

Production line 1 ->Block 1 -->Recipe 1 -->Recipe 2 -->Recipe 3 ->Block 2/Sub-Line 2 (we designate this block to be a sub-line, rather than a block. This means it can only contain sub-blocks, and those sub-blocks will contain the recipes themselves.) -->Sub-Block 1 --->Recipe 4 --->Recipe 5 -->Sub-Block 2 --->Recipe 6 --->Recipe 7.

This way you're never mixing regular recipes and also the bigger "blocks" which contain recipes.

EDIT2: I do think in the IDEAL world, you can mix recipes and sub-blocks. So you could have like a 4 ingredient thing, 3 of the ingredients you plug in normally (maybe your factory already has them), and the fourth requires a whole build for it, so you make that one a sub block, right alongside the 3 regular recipes. This would be the best functionality, but could be much more difficult to program/make it work right, not sure.

Helfima commented 4 months ago

I work on this options image I've wanted to do it for a long time, it requires reworking a lot of code so you'll have to be patient

Helfima commented 3 months ago

implemented in v1.0.x