ClaudeMetz / FactoryPlanner

A mod for Factorio. Allows you to plan out your production in detail.
https://mods.factorio.com/mod/factoryplanner
MIT License
81 stars 40 forks source link

Easy to get locked up when selecting unrestricted items #222

Open alethiophile opened 6 months ago

alethiophile commented 6 months ago

Suggestion

The current interface for selecting unrestricted items has some land mines in it. Often when dealing with complex recipes it's not immediately clear which items should be unrestricted, and it requires some trial and error to see which ones make the result come out reasonable.

However, there are a few issues here. One is that the matrix solver may occasionally find a solution in which one or more of the provided recipes runs backward (negative coefficient). This is obviously just an error, and generally means you've suggested an unrestricted item that doesn't make sense; it would be good to detect this and disallow selections that lead to a negative number.

More seriously, if you get the "linearly dependent recipes" error, this removes your ability to select unrestricted items. Thus, the only way to fix it once you get that error is to remove one of the relevant recipes, add it back, and then make another selection. It also clears your existing selection, meaning that if you've got a working recipe and you get this error while modifying it, it can take some work and guessing even to get back to your working recipe.

You should be able to select unrestricted items like normal even after a "linearly dependent recipes" error, and making a new selection should rerun the solver again. This would allow trial and error in selecting items without fear of messing up your existing arrangement.

ClaudeMetz commented 6 months ago

Thanks, appreciate the well thought-out suggestion! Not showing things that lead to negative numbers is tricky, since it would require computing all the permutations to find that out, to my understanding. That is not really feasible, performance-wise unfortunately.

The other suggestions are great, I'll look into them when I get the chance :)

jgoldshlag commented 6 months ago

+1 for this one for me. Playing Nullius, I often choose the wrong unrestricted item, and having to delete a line and then re-add it to re-select the unrestricted items is a pain. I think the old UI used to let you re-choose the items, a simple button to clear unrestricted items and force me to re-select them again would be great