Page 1 of 1

[0.16.51][modding] subgroups are seperated for item and fluids

Posted: Tue Sep 11, 2018 9:08 pm
by lovely_santa

While debugging one of my mods, I (and Bilka) came accross this issue:

Recipes use the subgroup/order from the recipe prototype (for example the player crafting ui).
Item/Fluid UI's (for example selecting signals in a combinator) sort on the item/fluid subgroup/order.

For the recipes it takes the order of the item when no subgroup/order is given. I have this as order (like I want them to be). Note the fluid icons.
recipe.png (497.95 KiB) Viewed 1703 times

When I go to the combinator I get this:
item-fluid.png (1.37 MiB) Viewed 1703 times
Afther checking, the purified water fluid and barreling prototype share the same subgroup (top row), but for some reason they are displayed seperate.
For that same reason are the other fluid subgroups seperated from the other items (they are displayed below the items, where they should be inbetween according to the order string).

Taking this in mind, we think the issue is that the subgroups of items and fluids are seperated, with showing all the populated items on top, and the fluids underneath it, even if they share subgroups, they seem to be appearing twice.

Kind regards,

EDIT: added the mod that was used in the pictures. Or latest version can be downloaded on the mod portal.

Re: [0.16.51][modding] subgroups are seperated for item and fluids

Posted: Mon Jan 07, 2019 3:54 am
by Rseding91
Thanks for the report. I can fix the problem of things in the same subgroup being on different lines when they're different types but it's still going to order things in the same subgroup: items -> fluids -> virtual signals.

In your given example that means the barrel of blue liquid and then the sand will show up and then the liquid itself - all on the same line. The problem comes from the game having no system in place to know how it should sort different types of things mixed together. In the Recipe GUI everything listed is a recipe and when sub-sorting fails it just calls back to the name which is unique for all recipes. That doesn't work when you mix types together because you can have a fluid and an item with the exact same sub-sorting values and exact same name.

So, we decided that they get ordered: item -> fluid -> virtual-signal.