Lymkwi / python-minetest

A python library to manipulate minetest's files
6 stars 4 forks source link

nodes loaded into map are badly lit #5

Closed ghost closed 8 years ago

ghost commented 8 years ago

is there a way to fix this:

screenshot_20160331_165857

is this constant relevant: https://github.com/LeMagnesium/python-minetest/blob/master/libminetest/map.py#L28

ghost commented 8 years ago

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

screenshot_20160330_104940

Lymkwi commented 8 years ago

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.

gaelysam commented 8 years ago

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

ghost commented 8 years ago

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

ghost commented 8 years ago

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

gaelysam commented 8 years ago

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

ghost commented 8 years ago

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.

ghost commented 8 years ago

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.