-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better barrelling and stacking detection #134
Better barrelling and stacking detection #134
Conversation
Since I have no opinion on the matter yet, I'll share the general vision.
|
What worries me here, is that this change alone is needed. The cost calculation alone should be enough to figure out that wasting resources (buildings, power, recipes) on stacking and then unstacking is pointless. Can you better explain how this marking of packing recipes affects YaFC? Does it affect cost calculation or solving? Does it affect the UI experience? (The latter would absolutely be nice) |
I have no knowledge to answer that. Eventually we, as a community, need to make a document on the system-design of YaFC, but it's yet to be done. Essentially, someone needs to read through nearly the whole codebase to understand it, and then to write down the class structure and answers to the questions like the one you asked. We can start from something simple and do it bit by bit, but it needs to be done. Not that I obligate you to do it, just mentioning. |
This only affects the UI as far as I'm aware. For the first two, the only normal versus special matters, and only for recipes; for the third and fourth, the type of special matter.
|
Ah i see. For the UI it indeed makes sense that these types are marked separately, for sorting and grouping etc. In code it could make more sense to group them, but if all non-normal FactorioObjectSpecialType are treated the same, we already got an easy grouping with the check I also see the problem here, when mods add an stacked recipes as input or output somewhere, in that case it indeed makes sense to only mark the second half of the circular recipe that's not used in any real production. I do wonder if you really need to split the pack and unpack recipes, are you planning to use this separation elsewhere? |
I don't have any ideas for new places where the distinction between types of special objects would matter. I could just rename "barreling" to "packing", or, with the caveat that sorting and "Special: " displays will lose some granularity, it could even be reduced to just "Normal" and "Special". |
Just to be clear: I think the distinction between barreling and stacking and pressure is ok, but I wasn't sure on the distinction between the 3 (item, packing and unpacking) options. I'm not against the later if there's a usecase to distinct them. |
Ah. Historical reasons? The only reason I see to distinguish between Verbing vs Verbed vs Unverbing is the sorting, and often only one of the three types will be shown anyway. |
586ac9a
to
34994e0
Compare
…n of stacking and pressurization recipies.
This handles deadlock_stacked_recipes better and combines the Barreling/Barreled/Unbarreling status into a single special type.
34994e0
to
070714b
Compare
Rebased on fresh master |
Since this is a large change, I will definitely need a changelog entry from you, so I don't misinterpret the feature. |
I added a changelog entry; I don't like 5-line entries, but I wasn't sure how to make it shorter and still explain what changed. I could remove the "As before, ..." line, but that seems like it could be important for answering "Why do I care?"; I don't know how well-known the sorting and ctrl-click behaviors are. |
Motivation
I decided I wanted "Iron plate (unstack)" and similar recipes to be treated as special sources of Iron plate, rather than being normal (ctrl+click candidate) sources. I also wanted Nullius's "Iron ore unboxing" and "Physics research boxing" to be flagged as special recipes, without flagging the reverse recipes or the boxed items. (There are recipe chains that use boxed iron ore, but if you're planning to unbox the iron ore, you were probably better off not boxing it in the first place. Conversely, the only source of physics research is unboxing, so you shouldn't ever re-box it.)
Changes
I basically reimplemented
IsBarrelingRecipe
from first principles to make this all work. As expected, there are changes. Some specific examples from Pyanodon:Here's a diff between the old special objects and the new ones for IR3, Nullius, Pyanodon, and SE. I also tested Angel-Bob-MadClown, but that one changed everything except the Voiding recipes so ... (Update: DSB confuses the original code pretty badly.)
changes.patch
Questions
A few questions before I work too much harder on this: