rautars / weather_pack

Weather mod for Minetest
https://forum.minetest.net/viewtopic.php?f=9&p=215869
MIT License
4 stars 2 forks source link

Extinquished fire leaves ghost lighting #6

Closed Fixer-007 closed 7 years ago

Fixer-007 commented 8 years ago

This is prime example - fire died down nearly in front of me and this popped up: https://i.imgur.com/0eBpgBR.png I'm so tired of this minetest lighting bugs... Can be fixed by putting a torch though. But feels bad.

Very same issue was posted in lightning mod, but sofar says he didn't seen that issue at all on lightning mod alone, and that this problem can be related to fire removal via your weather_pack mod, can you look at it? This is likely since it appears right after ABM activation.

This function can be at fault but I'm not sure, sofar does the same, but no bug iirc... http://pastebin.com/raw/uxQueYLr

rautars commented 8 years ago

Does this reproduces all the time or time to time? I tried modified thunder to perform thunder strikes more often but I can not reliable to reproduce it.

Please note that weather_pack ABM effects only fire:basic_flame node other fires such as lightning:dying_flame which during thunder occurs much more often should be not effected.

During my test I did found some lighting traces but they occurred quite randomly. Both lightning mod and weather_pack ABM uses same minetest api for removing nodes minetest.remove_node(pos). It's engine responsibility to correctly remove node without leaving lighting traces. I guess best way to dealt with this bug is to found simple reproducible scenario and address it to Minetest core team.

Fixer-007 commented 8 years ago

It is hard to reproduce it for sure, but it happens unfortunately. Is there any workarounds?

rautars commented 8 years ago

AFAIK mods does not have control over dynamic lighting. It may place/remove torch for you but not much else.

I did more tests on this issue and learn that issue more likely occurs on world chunk edges especially when those edges are not viewed by player at time when lighting source disappears.

You can use my test mod script lighting traces test (ltt) by yourself: https://gist.github.com/xeranas/9f0ca5ee1aae0c0624a2db56a98fce3c

For such issue there no viable workarounds for mods or at least I can not think any at the moment.

Fixer-007 commented 8 years ago

Nice. I will try it out. This can be very handy for developers to track and fix updatelight issue.

paramat commented 8 years ago

Chunk edges or mapblock edges? Mapchunks have no meaning outside of mapgen. Lighting updates work on mapblocks (16^3).

rautars commented 8 years ago

@paramat I'm not very familiar with MT map terminology so I just guessed that its effected some sort of map part. According size on screenshot (http://imgur.com/47fBT4a) it probably mapblock edges.

Fixer-007 commented 8 years ago

@paramat I've tried this mod, and reproduced light glitches in mapblock corners (16 blocks wide) - https://i.imgur.com/rzWf6d2.png

Fixer-007 commented 7 years ago

Should be fixed by "Bulk lighting update" commit in engine