[0.16.34] Single-result probability recipe tooltips

Post Reply
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

[0.16.34] Single-result probability recipe tooltips

Post by Deadlock989 »

Hi, this is one of those that straddles the bug/annoyance dividing line.

Recipes with just one item result in the results table produce very confusing tooltips when probabilities are involved.

This is what I consider correct behaviour, when there are 2 or more results - the recipe is labelled correctly, the products and their average chance of being produced are all shown, the ingredient is shown, the localised description is shown:

Image

This is what you get when there's only one result:

Image

Three issues:

1. This recipe actually produces between 0 and 5 stone. It's not "2.5 x furnace disassembly", it's only 1x the recipe, but it produces on average 2.5 stone.
2. But the stone isn't actually shown anywhere. The "Products:" display is missing. You have no idea what item the recipe is likely to produce.
3. The recipe description is missing.
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.16.34] Single-result probability recipe tooltips

Post by Deadlock989 »

I think this is happening because of an assumption that if a recipe only has one result, then the icon, description etc. will be of that item. For example, transport belts - it's a recipe to craft transport belts so the icon is a transport belt and the tooltip header says "2 x Transport belt" etc. Makes total sense. The recipe doesn't even define its own icon or description, it all just defaults to the product.

But it breaks when the recipe has an explicitly specified name, icon, description etc.

Example mod attached, compare the transport belt disassembly recipe (two results, correct) to the wooden chest disassembly (one result, confusing).
Image

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.16.34] Single-result probability recipe tooltips

Post by eradicator »

The numbers are also a bit weird. I have a recipe that only produces one item, but it's shown as 100 ingame:

Code: Select all

products =   { --also why is it products and not results in the api :P
    amount_max = 1,
    amount_min = 1,
    name = "er-waypoints:waypoint",
    probability = 100,
    type = "item"
  }
onehundret.jpg
onehundret.jpg (5.4 KiB) Viewed 1720 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.34] Single-result probability recipe tooltips

Post by Rseding91 »

Thanks for the report however I have no idea what you're actually asking to have fixed.

If you have only a single product the game won't show "products" because it's assumed the name shows what it produces. If you override the name to not show the products then it's not going to show the products. You can use the "always_show_made_in" to force it to always show what it makes.

The probability system will show the average result for anything that produces between a range - that part is working correctly.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.16.34] Single-result probability recipe tooltips

Post by Deadlock989 »

Rseding91 wrote:If you have only a single product the game won't show "products" because it's assumed the name shows what it produces. If you override the name to not show the products then it's not going to show the products. You can use the "always_show_made_in" to force it to always show what it makes.

The probability system will show the average result for anything that produces between a range - that part is working correctly.
And it's that assumption that's causing the issue, because it's invalid in these use cases. This isn't a generic "make item X" recipe. It's a situation-specific lossy way of getting something and it comes with a risk. It needs to be differentiated from "make a brick" or "build a machine". There are plenty of precedents for this in the vanilla game - e.g. Kovarex process, oil processing - it's just that none of them have a single result.

I'm not "overriding the name". I'm giving the recipe a name. All recipes have names, it's just that they default to the result name in most cases where there is only one result. The fact that 2+ result recipes are already treated completely differently indicates that there is some ambiguity here. Even if I renamed the recipe "Turn a furnace back into stone", it still wouldn't show the stone and it would still say "2.5 x Turn a furnace back into stone". If I just called the recipe "Stone" and gave it the icon for stone then it would be much less clear what this recipe does and it would not look any different from any other way of making stone, which is why I gave it a specific name, icon and description in the first place. The basic issue is that for one result and only one result, things I specify in the recipe are being ignored. If I didn't want them then I wouldn't have specified them.

always_show_made_in doesn't work for this purpose, it's actually enabled in the screenshots above. It shows the machines it can be made in at the bottom, and that's it.

To clarify what I'm asking to have fixed:

1. If recipes only have one result and also have a specific localised name specified, then the tooltip should not prefix the name with the number of results (averaged or otherwise). If you want the number of results shown in a localised string, a mechanism to have it inserted into the localised name already exists.
2. If recipes only have one result and also have a specific icon or icons specified, then the tooltip should not hide the Products: line.
3. If recipes only have one result and also have a specific localised description specified, then the tooltip should not ignore the description entirely.
Image

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.16.34] Single-result probability recipe tooltips

Post by eradicator »

Rseding91 wrote:The probability system will show the average result for anything that produces between a range - that part is working correctly.
For my example it clearly does not. A 100% chance to produce exactly 1 item does not produce 100 items on average.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.16.34] Single-result probability recipe tooltips

Post by Deadlock989 »

0.16.35:

Image

Perfect. Thank you very much Rseding.
Image

Post Reply

Return to “Implemented mod requests”