Lymkwi/python-minetest

nodes loaded into map are badly lit

Opened this issue · 8 comments

with the original version of the script I didn't have this lighting issue.

screenshot_20160330_104940

There is no way to fix this issue in the python library. Theoretically, by defaulting to using the bitmasks "LIGHTING_EXPIRED" and "GENERATED" when creating mapblocks, Minetest should recalculate and fix the lighting by itself; sadly it doesn't work. You can use mods like mapfix to fix that.
EDIT: The lighting issue appears randomly, but tends to be present within artificially created mapblocks. Your original version, by repeating the mapblock initialisation process probably made it so it was avoided somehow.

Link to mapfix: https://github.com/minetest-mods/mapfix (broken on Mg's post)

I installed this and it is not having an effect, my landscape is still dark and unlit.

map.zip
here is the map.sqlite file for people to mess with

use /mapfix in-game to light the landscape. It might not work if the air above is also set to dark.

that is a strange solution. it works for an area as per my minetest.conf settings but then if i use it again in an overlapping area it seems to undo it, making the changes temporary? anyway it is a moot point until speed is drastically improved.

all that mapfix is doing is creating a vm object and updating lighting and liquids. If the map as loaded by this script was to set GENERATED to false, a barebones mapgen mod could apply this vm update lighting process to all blocks. This approach seems to work. I have made a basic mod to do this, which could be included in the mod portion of python-minetest (the folder with the chat command stuff):
lightfix.zip

EDIT: nothing needed to be changed with respect to the GENERATED setting... it seems to just work.