Furnaces are broken #821
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#821
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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.
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...
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.
Tested on Minetest 5.3.0. Both in Creative Mode and in non-Creative Mode.
What I did:
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
.Thanks for writing the steps.
It's strange for me too.
The commit you mentioned isn't too complex:
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...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 callingfurnace_get_delta_time()
. Probably the problem is inside it. To revert the logic to the old style we may just replace the whole content offurnace_get_delta_time()
toreturn minetest.get_meta(pos), 1
where1
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 dominetest.get_day_count()
andminetest.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.
I simplified the main timer loop, e.g. added
active
variable, removed severalupdate = 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.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.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
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).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...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.
@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 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?
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.
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
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.
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...
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
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-dependentI built 30 furnaces and crying because they work like a charm (I changed the PC).
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.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.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.
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.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 …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.
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.
Nope, I don't remember any of the settings I used. 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...
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