Page 1 of 1

Recipe: show_products_on_tooltip

Posted: Wed Oct 05, 2016 3:59 pm
by Mooncat
Request: a Boolean property in recipe prototype to enforce display of products on tooltip, even if there is only one product.

Currently, recipe products are shown on tooltip only if the recipe has more than one products. For recipes that have only one product, it is not shown, mainly because their recipe icons can already describe the products, as discussed here with klonan: viewtopic.php?f=66&t=33732

By setting main_product to empty string, we can enforce display of products. But it is a hack and it brings another issue: it requires recipe name, icon, subgroup and order to be set explicitly because the recipe can no longer determine based on its product.
So, by adding another Boolean specialized for enforcing display of products, the problem will be solved. And we can even make a mod to let people choose whether products for ALL recipes should always be shown on tooltip. :P

Edit: uploaded the mod so you can see the result: https://mods.factorio.com/mods/Mooncat/ ... e-products :D

Edit 2: simplified the title

Re: Property to enforce showing recipe products on tooltip

Posted: Fri Oct 07, 2016 6:48 am
by hoho
Mooncat wrote:Request: a Boolean property in recipe prototype to enforce display of products on tooltip, even if there is only one product.
I'd say this should be a toggle in the menu under game options, not just something mods toggle on/off as they wish. That way, players who want to see them can turn it on for everything, not just hope that modders add it.

Also, I'd like if products also had not just picture but also the name of whatever the recipe gives similarly to how we see names and icons of ingredients. With some mods, the icons between different things are relatively similar (Angel's petrochem) and it's not exactly easy to distinguish them.

Re: Property to enforce showing recipe products on tooltip

Posted: Fri Oct 07, 2016 2:33 pm
by aubergine18
Rather than having names shown next to icons, it would be better if there was just a well formed tooltip on hover.

That way the icons can be shown as a quick reference while taking up little screen space, and if I want more information I just hover the icon to see more elaborate details about it.

Re: Property to enforce showing recipe products on tooltip

Posted: Fri Oct 07, 2016 6:10 pm
by Mooncat
hoho wrote:I'd say this should be a toggle in the menu under game options, not just something mods toggle on/off as they wish. That way, players who want to see them can turn it on for everything, not just hope that modders add it.
I have suggested that for the base game: viewtopic.php?f=66&t=33732
I agree with Klonan. product icons on tooltip is only needed for mod players, because the vanilla recipes can already show their products on icons clearly.

aubergine18 wrote:Rather than having names shown next to icons, it would be better if there was just a well formed tooltip on hover.
That way the icons can be shown as a quick reference while taking up little screen space, and if I want more information I just hover the icon to see more elaborate details about it.
Tooltip on tooltip. hm....
Maybe something like the code hinting tooltip in Eclipse: when it shows up, you can press the hotkey (F2) to focus it, so it won't close when your cursor leaves its area, and hence you can open another tooltip on it. :)
But I think this will be beyond our power and will require the devs to implement it.

Re: Property to enforce showing recipe products on tooltip

Posted: Sat Oct 08, 2016 9:20 am
by hoho
Mooncat wrote:
hoho wrote:I'd say this should be a toggle in the menu under game options, not just something mods toggle on/off as they wish. That way, players who want to see them can turn it on for everything, not just hope that modders add it.
I have suggested that for the base game: viewtopic.php?f=66&t=33732
I agree with Klonan. product icons on tooltip is only needed for mod players, because the vanilla recipes can already show their products on icons clearly.
"Problem" is, I wanted both icons and names of the products be visible in the tooltip. Having it behave consistently would also be nice.

Re: Property to enforce showing recipe products on tooltip

Posted: Tue Oct 11, 2016 3:34 am
by Mooncat
hoho wrote:
Mooncat wrote:
hoho wrote:I'd say this should be a toggle in the menu under game options, not just something mods toggle on/off as they wish. That way, players who want to see them can turn it on for everything, not just hope that modders add it.
I have suggested that for the base game: viewtopic.php?f=66&t=33732
I agree with Klonan. product icons on tooltip is only needed for mod players, because the vanilla recipes can already show their products on icons clearly.
"Problem" is, I wanted both icons and names of the products be visible in the tooltip. Having it behave consistently would also be nice.
For recipes that have only one product, it would be ok. But for those that have multiple products, I wonder this will make the tooltip being too large, as each product will occupy a new line. :?

Re: Property to enforce showing recipe products on tooltip

Posted: Tue Oct 11, 2016 6:29 am
by hoho
Mooncat wrote:But for those that have multiple products, I wonder this will make the tooltip being too large, as each product will occupy a new line. :?
Most result items I've seen so far has been 4 in some mod. Having that many new lines is not too large in my opinion.

Re: Recipe: show_products_on_tooltip

Posted: Tue Oct 11, 2016 2:39 pm
by aubergine18
One solution would be to have 2 column tooltip, with recipe etc shown on left side, and results etc shown on right side. Name and description could be shown above columns. Layout would be something like:

. . . . . . . . . name + description
recipeImageresults

Re: Recipe: show_products_on_tooltip

Posted: Wed Oct 12, 2016 4:43 pm
by Mooncat
Don't forget the total raw. It can really take up space.
totalRaw.png
totalRaw.png (340.93 KiB) Viewed 7813 times
and it is causing lag. :?

Re: Recipe: show_products_on_tooltip

Posted: Wed Oct 12, 2016 5:07 pm
by Rseding91
Mooncat wrote:Don't forget the total raw. It can really take up space.
...
and it is causing lag. :?
Could you upload that mod set somewhere? I'd be interested in seeing what might cause that to be "slow".

Also don't forget you're in cheat mode which makes "total raw" show far more than normal due to it thinking the player can craft any recipe so it degrades each item to the base materials.

Re: Recipe: show_products_on_tooltip

Posted: Thu Oct 13, 2016 2:31 am
by Mooncat
Rseding91 wrote:
Mooncat wrote:Don't forget the total raw. It can really take up space.
...
and it is causing lag. :?
Could you upload that mod set somewhere? I'd be interested in seeing what might cause that to be "slow".

Also don't forget you're in cheat mode which makes "total raw" show far more than normal due to it thinking the player can craft any recipe so it degrades each item to the base materials.
Sure. I will upload it when I get home. I think Yuoki Industries, Angel's mods and Bob's mods are the main cause for that because they bring many new raw materials.

Good catch for cheat mode. I even didn't realize I had turned on it, because it is already part of the daily routine for me. (still updating Creative Mode) :lol:

Re: Recipe: show_products_on_tooltip

Posted: Thu Oct 13, 2016 4:43 pm
by Mooncat
Here you are: https://drive.google.com/open?id=0B9Y5P ... 1lZSm9BVzg

But it lags only when cheat mode is on. :?

1) Start a game
2) game.player.force.research_all_technologies()
3) game.player.cheat_mode = true
4) open the crafting menu -> Combat
5) hover a MK6 equipments. e.g. Vehicle Fusion Reactor MK6. FPS is dropped slightly.
6) leave the equipment. It hangs for awhile.

Need bug report? :)

Re: Recipe: show_products_on_tooltip

Posted: Thu Oct 13, 2016 4:58 pm
by Rseding91
Mooncat wrote:Here you are: https://drive.google.com/open?id=0B9Y5P ... 1lZSm9BVzg

But it lags only when cheat mode is on. :?

1) Start a game
2) game.player.force.research_all_technologies()
3) game.player.cheat_mode = true
4) open the crafting menu -> Combat
5) hover a MK6 equipments. e.g. Vehicle Fusion Reactor MK6. FPS is dropped slightly.
6) leave the equipment. It hangs for awhile.

Need bug report? :)
Nah, there's no bug. Cheat mode makes the recipe system "can craft count" work far harder than normal since it has to decompose every item to base materials instead of the normal furnace/machine recipes.

Re: Recipe: show_products_on_tooltip

Posted: Thu Oct 13, 2016 5:19 pm
by Mooncat
Rseding91 wrote:
Mooncat wrote:Here you are: https://drive.google.com/open?id=0B9Y5P ... 1lZSm9BVzg

But it lags only when cheat mode is on. :?

1) Start a game
2) game.player.force.research_all_technologies()
3) game.player.cheat_mode = true
4) open the crafting menu -> Combat
5) hover a MK6 equipments. e.g. Vehicle Fusion Reactor MK6. FPS is dropped slightly.
6) leave the equipment. It hangs for awhile.

Need bug report? :)
Nah, there's no bug. Cheat mode makes the recipe system "can craft count" work far harder than normal since it has to decompose every item to base materials instead of the normal furnace/machine recipes.
But it feels a little bit weird that the lag occurs not when I hover the recipe, but when I leave it. :? Like it is struggling on recycling the resources used for displaying the tooltip.

Re: Recipe: show_products_on_tooltip

Posted: Thu Oct 13, 2016 6:11 pm
by Rseding91
Mooncat wrote:But it feels a little bit weird that the lag occurs not when I hover the recipe, but when I leave it. :? Like it is struggling on recycling the resources used for displaying the tooltip.
Well I like optimizing things so I looked into it anyway. It was a 2 part thing: when you hover you don't move the mouse so it updates the tooltip once every tick (60 times per second). When you move the mouse every time the mouse moves it triggers a refresh of the tooltip to move it and so "moving off" actually causes it to do more work than just hovering as you pass over other recipes.

I also cached the decomposed recipe results in the tooltip so it knows if it needs to find the full decomposed recipe results and skips doing that most of the time.

So, for 0.14.14 it will be much quicker (instant in my testing).

Re: Recipe: show_products_on_tooltip

Posted: Thu Oct 13, 2016 6:46 pm
by Mooncat
Rseding91 wrote:
Mooncat wrote:But it feels a little bit weird that the lag occurs not when I hover the recipe, but when I leave it. :? Like it is struggling on recycling the resources used for displaying the tooltip.
Well I like optimizing things so I looked into it anyway. It was a 2 part thing: when you hover you don't move the mouse so it updates the tooltip once every tick (60 times per second). When you move the mouse every time the mouse moves it triggers a refresh of the tooltip to move it and so "moving off" actually causes it to do more work than just hovering as you pass over other recipes.

I also cached the decomposed recipe results in the tooltip so it knows if it needs to find the full decomposed recipe results and skips doing that most of the time.

So, for 0.14.14 it will be much quicker (instant in my testing).
Not quite understand about the "moving off" part, but it is good that you fixed the lag. Helpful for testing things in cheat mode. Thanks. :D