Furnaces are broken #821

Closed
opened 2020-08-20 19:49:48 +02:00 by Wuzzy · 26 comments
Member

Furnaces are broken. If you put in a fuel item and a cookable item, nothing happens.

Tested version: ce0b31123b
Furnaces used to work in 0.66.2.

@kay27

Furnaces are broken. If you put in a fuel item and a cookable item, nothing happens. Tested version: ce0b31123bde488936b0bc22c36e1cc0fb9a6496 Furnaces used to work in 0.66.2. @kay27
Wuzzy added the
bug
nodes
#P2: HIGH
labels 2020-08-20 19:49:48 +02:00
Contributor

I need more specific way to reproduce it.

With the latest master 723a306e1e the all items I try to cook are perfectly cooking.

With no any mods added to MCL2, with clean 5.3.0 platform under Windows 10, from your original repository, not forked.

For example, in creative mode I put a furnace, added a coal and uncooked salmon, then the chicken, then the cobble and here it is, then repeated it with wood instead of a coal...

The only case when it doesn't start for me - if the output slot occupied by something that wouldn't stack with the cooked product. It may slighty differs from furnaces's behaviour as it was before but I didn't remember 100%.

P. S. First I suspected the latest changes with flame particles but actually I didn't see a difference during my tests.

I need more specific way to reproduce it. With the latest master 723a306e1ec3138a5568ab3c05b02ce0cc047a59 the all items I try to cook are perfectly cooking. With no any mods added to MCL2, with clean 5.3.0 platform under Windows 10, from your original repository, not forked. For example, in creative mode I put a furnace, added a coal and uncooked salmon, then the chicken, then the cobble and here it is, then repeated it with wood instead of a coal... The only case when it doesn't start for me - if the output slot occupied by something that wouldn't stack with the cooked product. It may slighty differs from furnaces's behaviour as it was before but I didn't remember 100%. P. S. First I suspected the latest changes with flame particles but actually I didn't see a difference during my tests.
Contributor

When I worked with furnaces in my fork, there were some moments when I couldn't get the time properly and might write a wrong value to meta, for example extremely big, which would broke the timing and the furnace. If by chance you used some my forked (kay27/MineClone2) interim version to build the furnace and it is kept for now - you maybe have to dig it and put back to reset the meta...

When I worked with furnaces in my fork, there were some moments when I couldn't get the time properly and might write a wrong value to meta, for example extremely big, which would broke the timing and the furnace. If by chance you used some my forked (kay27/MineClone2) interim version to build the furnace and it is kept for now - you maybe have to dig it and put back to reset the meta...
Contributor

But if there's no timing meta data at all it counts as zero so I almost sure you have to do nothing, existing furnaces in the world will automatically successfully transit from 0.66.2 to current version. I tested it on my server as well, they all work. Mainly I melted cobbles and gold to craft protector blocks, it's a long process so I used several furnaces and I didn't re-create them. I also tested the special recipe and the way of producing the coal from tree + tree. And I have no any reports about the furnaces so it's very unclear for me, I am very sorry for that.

But if there's no timing meta data at all it counts as zero so I almost sure you have to do nothing, existing furnaces in the world will automatically successfully transit from 0.66.2 to current version. I tested it on my server as well, they all work. Mainly I melted cobbles and gold to craft protector blocks, it's a long process so I used several furnaces and I didn't re-create them. I also tested the special recipe and the way of producing the coal from tree + tree. And I have no any reports about the furnaces so it's very unclear for me, I am very sorry for that.
Author
Member

Tested on Minetest 5.3.0. Both in Creative Mode and in non-Creative Mode.

What I did:

  • Create a brand new world (no mods)
  • Place Furnace
  • Put in coal lump
  • Put in cobblestone
  • Wait

So yeah, very critical bug.

When I revert to version 0.66.2, everything works again. So definitely something broke after 0.66.2.

Very strange you don't experience the bug …

EDIT:

OK, I now know the bug was introduced in c424b036b2.

Tested on Minetest 5.3.0. Both in Creative Mode and in non-Creative Mode. What I did: - Create a brand new world (no mods) - Place Furnace - Put in coal lump - Put in cobblestone - Wait So yeah, very critical bug. When I revert to version 0.66.2, everything works again. So definitely something broke after 0.66.2. Very strange you don't experience the bug … EDIT: OK, I now know the bug was introduced in c424b036b2876769e6f48be4f5af5668d1161ec4.
Contributor

Thanks for writing the steps.

It's strange for me too.

The commit you mentioned isn't too complex:

  1. The first (actually the last but I better start from it) thing is line 420 where I add the handler of on_metadata_inventory_take for inactive furnace because there might be a case when it stopped because of no output space and we free it so it must start immediately too. It can't break its work...

  2. Next, the idea of the fix was to consider in-game time to make furnaces 'work' when the timer doesn't - when you disconnect for some time; or skip the night; go far away from the furnace; etc. To do this we don't consider a second between calls of furnace_node_timer() anymore but request more correct number of seconds by calling furnace_get_delta_time(). Probably the problem is inside it. To revert the logic to the old style we may just replace the whole content of furnace_get_delta_time() to return minetest.get_meta(pos), 1 where 1 means always only a second, as it was before. I tested this and it works for me too but you know what I mean - we may reopen the issue 533...

@Wuzzy Could you please check it? If it fix it - I wonder didn't you change the time_speed and do minetest.get_day_count() and minetest.get_timeofday() return the values which increment?

I revise it right now, hope to find the something but as it works for me I actually can't be sure. The counters are not very smooth that's why when they give zero the function must still return 1 second and it must be counted in next calls - this way I got smoothness back.

  1. I simplified the main timer loop, e.g. added active variable, removed several update = true - there were some minor problems which gone with it. I like it more than it was before, it became more clear and simple. Also there was considered https://github.com/minetest/minetest_game/pull/1988 mentioned in Wuzzy/MineClone2#533 but I don't think it is related.

  2. Finally I found that we need to reset delta time on manual manipulation because time accumulates and may cause immediate cooking on loading a something, furnace_reset_delta_time() does it.

Thanks for writing the steps. It's strange for me too. The commit you mentioned isn't too complex: 1. The first (actually the last but I better start from it) thing is line 420 where I add the handler of ```on_metadata_inventory_take``` for inactive furnace because there might be a case when it stopped because of no output space and we free it so it must start immediately too. It can't break its work... 2. Next, the idea of the fix was to consider in-game time to make furnaces 'work' when the timer doesn't - when you disconnect for some time; or skip the night; go far away from the furnace; etc. To do this we don't consider a second between calls of ```furnace_node_timer()``` anymore but request more correct number of seconds by calling ```furnace_get_delta_time()```. Probably the problem is inside it. To revert the logic to the old style we may just replace the whole content of ```furnace_get_delta_time()``` to ```return minetest.get_meta(pos), 1``` where ```1``` means always only a second, as it was before. I tested this and it works for me too but you know what I mean - we may reopen the issue 533... @Wuzzy Could you please check it? If it fix it - I wonder didn't you change the ```time_speed``` and do ```minetest.get_day_count()``` and ```minetest.get_timeofday()``` return the values which increment? I revise it right now, hope to find the something but as it works for me I actually can't be sure. The counters are not very smooth that's why when they give zero the function must still return 1 second and it must be counted in next calls - this way I got smoothness back. 3. I simplified the main timer loop, e.g. added ```active``` variable, removed several ```update = true``` - there were some minor problems which gone with it. I like it more than it was before, it became more clear and simple. Also there was considered https://github.com/minetest/minetest_game/pull/1988 mentioned in https://git.minetest.land/Wuzzy/MineClone2/issues/533 but I don't think it is related. 4. Finally I found that we need to reset delta time on manual manipulation because time accumulates and may cause immediate cooking on loading a something, ```furnace_reset_delta_time()``` does it.
Contributor

By the way, I made one more test with cooking the cobble and then trying to place sand into source slot and wait whether the furnace will earn the fuel and it correctly stopped without getting one but then I saw the particles kept when the texture changed. There are no particles with newly placed furnace
изображение
Also there are no particles with the furnace turned on:
изображение
Can't realize when they appeared

By the way, I made one more test with cooking the cobble and then trying to place sand into source slot and wait whether the furnace will earn the fuel and it correctly stopped without getting one but then I saw the particles kept when the texture changed. There are no particles with newly placed furnace ![изображение](/attachments/bcfa2c1e-613f-455a-a3e6-5e34058b5ca2) Also there are no particles with the furnace turned on: ![изображение](/attachments/f96759b7-1ced-41a6-a6a5-59778d0a3061) Can't realize when they appeared
Contributor

I could reproduce it once when loaded coal lumps, exited, connected back and then put cobble stones. May be it's because of delta reset, then this would fix it: 9c8098c203 (avoid dropping the activity flag for zero delta time).

I could reproduce it once when loaded coal lumps, exited, connected back and then put cobble stones. May be it's because of delta reset, then this would fix it: https://git.minetest.land/Wuzzy/MineClone2/commit/9c8098c2037cb65b1e67f2b8cf6bbba63994052c (avoid dropping the activity flag for zero delta time).
Contributor

Added two additional fixes: 1) never met it but revising the code I can't realize why there can't be division by zero on zero delta time 6efed85866 ; 2) previous fix of activity flag made unwanted result: flashes of furnaces on every load, I fix it by returning delta 0.1 seconds instead of 0: a728974d8a . Hope it might be closed now, but particles...

Added two additional fixes: 1) never met it but revising the code I can't realize why there can't be division by zero on zero delta time https://git.minetest.land/Wuzzy/MineClone2/commit/6efed858668c1fd9b91c4d7432835f18a6a0b3cb ; 2) previous fix of activity flag made unwanted result: flashes of furnaces on every load, I fix it by returning delta 0.1 seconds instead of 0: https://git.minetest.land/Wuzzy/MineClone2/commit/a728974d8a82431fa0c037f2de8fd442a37fc0d2 . Hope it might be closed now, but particles...
Contributor

Oh, by the way, I don't know if this is an engine or MC2 bug, but if you get away from your furnace, it will stop working. And by this I mean the existing version, not the latest build/branch. It's probably an engine limitation, because crops also don't grow while you're away exploring, and nothing generally seems to happen outside your range after a certain amount of time. But this is especially annoying with cooking/smelting and crops.

Oh, by the way, I don't know if this is an engine or MC2 bug, but if you get away from your furnace, it will stop working. And by this I mean the existing version, not the latest build/branch. It's probably an engine limitation, because crops also don't grow while you're away exploring, and nothing generally seems to happen outside your range after a certain amount of time. But this is especially annoying with cooking/smelting and crops.
Contributor

@kneekoo it's because of the timer which has no way to work in unloaded areas, I hope it is fixed now. And, hope I can fix the crops the same way but first of all I'd like to get some confirmation from Wuzzy that furnaces now work for him too

@kneekoo it's because of the timer which has no way to work in unloaded areas, I hope it is fixed now. And, hope I can fix the crops the same way but first of all I'd like to get some confirmation from Wuzzy that furnaces now work for him too
Contributor

@kneekoo This function definition: https://git.minetest.land/Wuzzy/MineClone2/src/branch/master/mods/ITEMS/mcl_farming/shared_functions.lua#L12

If I understand correctly, when the area is unloaded this function wouldn't called and the growth progress would stopped.

Why I'm writing this instead of just fixing - there's an important condition of the light, https://git.minetest.land/Wuzzy/MineClone2/src/branch/master/mods/ITEMS/mcl_farming/shared_functions.lua#L35 : the node must be illuminated at least by light of level 10. I have no idea how to consider all weather conditions (which affect the light) when the area is inactive. Only use some random values. Don't you have better ideas?

@kneekoo This function definition: https://git.minetest.land/Wuzzy/MineClone2/src/branch/master/mods/ITEMS/mcl_farming/shared_functions.lua#L12 If I understand correctly, when the area is unloaded this function wouldn't called and the growth progress would stopped. Why I'm writing this instead of just fixing - there's an important condition of the light, https://git.minetest.land/Wuzzy/MineClone2/src/branch/master/mods/ITEMS/mcl_farming/shared_functions.lua#L35 : the node must be illuminated at least by light of level 10. I have no idea how to consider all weather conditions (which affect the light) when the area is inactive. Only use some random values. Don't you have better ideas?
Member

Can you store the last known light level for the various conditions. I think that would be 3 light levels. And if unknown then use random values? And also periodically check to update the values like every 3 min or something if loaded.

Can you store the last known light level for the various conditions. I think that would be 3 light levels. And if unknown then use random values? And also periodically check to update the values like every 3 min or something if loaded.
Contributor

I have no idea how Minecraft does it, but obviously they have some special cases for player-generated blocks, like farms and furnaces, planted tree saplings, sugar cane or bamboo (I haven't encountered it in MC2 yet, though).

Ideally, the game would keep the user-generated nodes in a separate thread(?), and the game would be able to check lighting level and weather conditions around those nodes. Now considering no mob in the game would affect those nodes normally, (can endermen pick up saplings, sugar cane farmed blocks? I know they can't pick up furnaces), lighting level could be derived from the time of day, which is the same everywhere in the world, and weather - but I don't know if this can be queried based on a chunk basis.

What I don't know at all, is how the game is supposed to behave with red stone automation. I haven't done any of it in neither Minecraft or MineClone2, but from the YouTube videos I watched about AFK farms, the player is supposed to be around. I don't know if this is strictly about mobs or also the automation itself, because one might also make automated cookers/smelters (with furnaces) while being far away or even in another dimension.

Should the game actually keep track of crops and cooking/smelting in the Overworld while the player is in the Nether? Wow, there's a lot I don't know about both games. :P

I have no idea how Minecraft does it, but obviously they have some special cases for player-generated blocks, like farms and furnaces, planted tree saplings, sugar cane or bamboo (I haven't encountered it in MC2 yet, though). Ideally, the game would keep the user-generated nodes in a separate thread(?), and the game would be able to check lighting level and weather conditions around those nodes. Now considering no mob in the game would affect those nodes normally, (can endermen pick up saplings, sugar cane farmed blocks? I know they can't pick up furnaces), lighting level could be derived from the time of day, which is the same everywhere in the world, and weather - but I don't know if this can be queried based on a chunk basis. What I don't know at all, is how the game is supposed to behave with red stone automation. I haven't done any of it in neither Minecraft or MineClone2, but from the YouTube videos I watched about AFK farms, the player is supposed to be around. I don't know if this is strictly about mobs or also the automation itself, because one might also make automated cookers/smelters (with furnaces) while being far away or even in another dimension. Should the game actually keep track of crops and cooking/smelting in the Overworld while the player is in the Nether? Wow, there's a lot I don't know about both games. :P
Author
Member

Nope, it wasn't fixed, sadly.

When I open a furnace, put a cobble inside, then put the coal inside, the furnace starts burning, but the item isn't cooking. The flame doesn't shrink either and it stays on forever.

Actually, the furnace starts burning as soon I only "touch" the fuel, i.e. select it with the mouse, before actually placing it.

Nope, it wasn't fixed, sadly. When I open a furnace, put a cobble inside, then put the coal inside, the furnace starts burning, but the item isn't cooking. The flame doesn't shrink either and it stays on forever. Actually, the furnace starts burning as soon I only "touch" the fuel, i.e. select it with the mouse, before actually placing it.
Contributor

Wow :((( So, I started to have a strange desire to confirm somehow that I'm not kidding you when I say that I can't reproduce it, here's the video: https://youtu.be/XALMT1pmGww

@Wuzzy

Of course I'll revise the code many many times again but could you please check the paragraph 2 of my message above? I crossed it when I thought I fixed it but now I edited it and removed the crossing...

Wow :((( So, I started to have a strange desire to confirm somehow that I'm not kidding you when I say that I can't reproduce it, here's the video: https://youtu.be/XALMT1pmGww @Wuzzy Of course I'll revise the code many many times again but could you please check the paragraph 2 of my [message above](https://git.minetest.land/Wuzzy/MineClone2/issues/821#issuecomment-11171)? I crossed it when I thought I fixed it but now I edited it and removed the crossing...
Contributor

I decided to capture what I do in the case if it will reproduce somehow... And I want to show you the second video where you may see the problem with flame particles which started to fly so nice after the game restarted (0:40, they didn't appear before restarting regardless if the furnace was active or not). And they never destroyed even when I destroyed the everything around (3:45).

https://youtu.be/K-A8fjgPdqU

I decided to capture what I do in the case if it will reproduce somehow... And I want to show you the second video where you may see the problem with flame particles which started to fly so nice after the game restarted (0:40, they didn't appear before restarting regardless if the furnace was active or not). And they never destroyed even when I destroyed the everything around (3:45). https://youtu.be/K-A8fjgPdqU
Contributor

Is there a chance that you control them some different way? Game controller, etc... Or maybe some local repository synchronization problem? Or 5.3.0 platform problem if you don't use Windows? But I used some -dev version pre 5.3.0 to test and there was no problem... @Rootyjr @kneekoo Aren't you experiencing the problem?

Would you mind telling me your operating system name? If it's possible to run it in a hypervizor I'll get a chance to fix it. But m_time_of_day doesn't seem to be OS-dependent

I built 30 furnaces and crying because they work like a charm (I changed the PC).

Actually, the furnace starts burning as soon I only "touch" the fuel, i.e. select it with the mouse, before actually placing it.

Could you please explain what do you mean by "touching" the fuel? I tried to touch (mouse over and click) the fuel itself in my inventory and to touch empty fuel slot but only when I use mouse wheel the fuel loaded and the furnace started (if it has cookable item inside)... I also tried /set time_speed 10, 86400 and 8640 - world goes crazy but furnaces continue to work like a charm.

image

Is there a chance that you control them some different way? Game controller, etc... Or maybe some local repository synchronization problem? Or 5.3.0 platform problem if you don't use Windows? But I used some -dev version pre 5.3.0 to test and there was no problem... @Rootyjr @kneekoo Aren't you experiencing the problem? Would you mind telling me your operating system name? If it's possible to run it in a hypervizor I'll get a chance to fix it. But ```m_time_of_day``` [doesn't seem to be OS-dependent](https://github.com/minetest/minetest/blob/649211bf272df2dc7057347992c2653cf1c3a6fb/src/environment.cpp#L298) I built 30 furnaces and crying because they work like a charm (I changed the PC). > Actually, the furnace starts burning as soon I only "touch" the fuel, i.e. select it with the mouse, before actually placing it. Could you please explain what do you mean by "touching" the fuel? I tried to touch (mouse over and click) the fuel itself in my inventory and to touch empty fuel slot but only when I use mouse wheel the fuel loaded and the furnace started (if it has cookable item inside)... I also tried ```/set time_speed``` 10, 86400 and 8640 - world goes crazy but furnaces continue to work like a charm. ![image](/attachments/485c85e7-9566-406f-8166-3f52220ebbbe)
114 KiB
Contributor

Revised my code twice.

Having nothing to do decided to fix flame particles...

Hope I didn't interfere your work but if I did please just revert this commit: 81cf500611

Flame particles turning on/off is now the part of swap_node() function which toggles the furnace when it changes its state. Looks gorgeous.

Revised my code twice. Having nothing to do decided to fix flame particles... Hope I didn't interfere your work but if I did please just revert this commit: https://git.minetest.land/Wuzzy/MineClone2/commit/81cf500611fcd97f30b0cc2c0024bc76f3d9cecd Flame particles turning on/off is now the part of ```swap_node()``` function which toggles the furnace when it changes its state. Looks gorgeous.
Contributor

I don't have that issue with the furnace, but I use the stable MC2 release, so that's surely the reason.

My OS is Linux Mint 20 Cinnamon, which is based on Ubuntu 20.04 64-bit.

I don't have that issue with the furnace, but I use the stable MC2 release, so that's surely the reason. My OS is Linux Mint 20 Cinnamon, which is based on Ubuntu 20.04 64-bit.
Contributor

I use the stable MC2 release, so that's surely the reason.

If you'd like to test latest changes you may connect to my servers, actually I'd appreciate it a lot because I feel myself like in a deadlock and you have different operating system which is great.

There are all latest changes from master included. There are included some additional things like texture packs and Nether portal improvements but it doesn't affect furnaces.

> I use the stable MC2 release, so that's surely the reason. If you'd like to test latest changes you may connect to [my servers](https://forum.minetest.net/viewtopic.php?f=10&t=24888), actually I'd appreciate it a lot because I feel myself like in a deadlock and you have different operating system which is great. There are all latest changes from ```master``` [included](https://git.minetest.land/kay27/MineClone2/commits/branch/master). There are included some additional things like texture packs and Nether portal improvements but it doesn't affect furnaces.
Author
Member

Today I tested again and it started to work like normal again. Lol?
I have no idea why it happened before. Maybe some hiccup in Minetest, I don't know. Anyway, I close this now as we have way too little information on it. If anybody discovers furnace problems again, this can be re-opened.

I DID reset the minetest.conf tho, too bad I did not remember what settings it contained …

Today I tested again and it started to work like normal again. Lol? I have no idea why it happened before. Maybe some hiccup in Minetest, I don't know. Anyway, I close this now as we have way too little information on it. If anybody discovers furnace problems again, this can be re-opened. I DID reset the `minetest.conf` tho, too bad I did not remember what settings it contained …
Wuzzy closed this issue 2020-08-22 11:20:25 +02:00
Contributor

I DID reset the minetest.conf tho, too bad I did not remember what settings it contained …

Looks most probable for me. Don't you remember you changed client-side or server-side settings? I'm interested to reproduce it still so any additional information is very welcome.

> I DID reset the `minetest.conf` tho, too bad I did not remember what settings it contained … Looks most probable for me. Don't you remember you changed client-side or server-side settings? I'm interested to reproduce it still so any additional information is very welcome.
Contributor

By the way seems I was wrong when added the node check into rotation handler, I have to remove it, it seems to be redundand, but I'm still afraid to interfere your work so I will better do it a bit later... it's not critical, just redundand.

By the way seems I was wrong when added the node check into rotation handler, I have to remove it, it seems to be redundand, but I'm still afraid to interfere your work so I will better do it a bit later... it's not critical, just redundand.
Author
Member

Nope, I don't remember any of the settings I used. I feel bad now. XD

Nope, I don't remember any of the settings I used. I feel bad now. XD
Contributor

I feel bad now. XD

It's okay, please feel good and stay well :)

Actually delayed full iterations aren't so good for the furnaces, it would be more optimal to just calculate the result instead of running the whole job in a moment which might load CPU... Timer loop isn't too complex to feel it but seems I have to optimize it...

> I feel bad now. XD It's okay, please feel good and stay well :) Actually delayed full iterations aren't so good for the furnaces, it would be more optimal to just calculate the result instead of running the whole job in a moment which might load CPU... Timer loop isn't too complex to feel it but seems I have to optimize it...
Contributor

Can you store the last known light level for the various conditions. I think that would be 3 light levels. And if unknown then use random values? And also periodically check to update the values like every 3 min or something if loaded.

Thanks for the idea :) Would be great if you'd check it from the line number 33: 46a5223bfe Not sure it's exact what you meant but it works more or less. I'd like to test it for 1-2 days before adding to master, https://forum.minetest.net/viewtopic.php?p=380256#p380256

> Can you store the last known light level for the various conditions. I think that would be 3 light levels. And if unknown then use random values? And also periodically check to update the values like every 3 min or something if loaded. Thanks for the idea :) Would be great if you'd check it from the line number 33: https://git.minetest.land/kay27/MineClone2/commit/46a5223bfe76cee3ed4a306c820ba1f7a0955403 Not sure it's exact what you meant but it works more or less. I'd like to test it for 1-2 days before adding to master, https://forum.minetest.net/viewtopic.php?p=380256#p380256
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#821
No description provided.