Poikilos / EnlivenMinetest

Minetest engine server management tools and ENLIVEN game installer/updater
Other
3 stars 0 forks source link

worldedit doesn't update shadows #499

Open Poikilos opened 3 years ago

Poikilos commented 3 years ago

search_social via irc.oldcoder.org minetest-general 2021-11-12

<search_social> noah has a problem
<search_social> he didn't use WE but there's a big shadow over where he's building
<search_social> no one else has used WE anywhere near his build
<search_social> he tried fixlight but that made it worse and he tried another fixlight command which said it was fixed - the shadow is still there so we need you
<search_social> i've never been able to fix that so i'm asking here

:edit 2022-01-18:

Common issue. Many things can cause the shadows.

@slopsbucket The main reason @OldCoder hasn't pursued the issue is that there aren't specific steps to reproduce it. I've experienced it before but don't recall how for sure.

This didn't reproduce the issue:

Expected result:

Actual result:

Tasks:

Poikilos commented 3 years ago

1st, odd shadows are a known and weird aspect of the MT lighting system. They don't necessarily have anything to do with WorldEdit.

2nd, I don't know what "/fixlight" is. Has he tried the "/mapfix" command in Bucket Game? That usually does the trick.

3rd, if "/mapfix" doesn't work, he can give me a copy of the world to review. I'll need all of the mods but he can omit the player and xban2 data.

-@OldCoder (IRC 2011-11-14)

Poikilos commented 3 years ago

^ I gave that info to search_social via IRC.

slopsbucket commented 2 years ago

Common issue. Many things can cause the shadows. The shadow in question might be higher up in the sky, default mapfix settings only allow it to reset lighting in a radius of 40 nodes.

Fly above the build area until you can see the shadow affect your hand, then use mapfix, that should fix the issue.

Related issue, using mapfix over snow covered areas or oceans will leave a faint square shadow on the snow or water. To avoid this fly to a height 45 nodes above the ground level or water level and use mapfix from that height.

Slopsbucket.

Poikilos commented 2 years ago

@slopsbucket @OldCoder I've updated the description to reflect that information, thanks.

Poikilos commented 2 years ago

@slopsbucket Do you have specific steps to reproduce the issue? I tried (see updated issue description) but couldn't.

slopsbucket commented 2 years ago

Hi Jake,

The shadow is caused by an area where something in the map has been changed, and during that database update a 1 node thick layer of the map database gets no data entered. The in game effect is that in that 1 node thick layer there is no air. This affects the light passing through that area.

I pointed out what was going on with these shadows all the way back in Minetest 0.4.14. They went through a series of bugs that caused WorldEdit to behave very strangely on large schems. In one of these bugs, your schematic would be correctly placed in a radius of 40 nodes from you, but the entire rest of the schematic would be raised 1 node higher on the y axis.

I suspect that somewhere very early on in the programming a disparity has been created between using y=0 or y=1 as a base level for the calculation of chunks and their positions. Should be y=0.

Shadows appear on specific levels, multiples of 16, minus 1. Eg: y=-17, y=-1, y=15, y=31, etc. So the shadow could be forming 15 nodes above what caused the issue, and this is often the case.

Try the simple experiment of standing in the shadowed area and then flying straight up, slowly. Watch your hand as you ascend, when you reach the single node layer where the shadow is being created your hand will also become shadowed.

OldCoder created scripts in WorldEdit to help with this issue. The scripts make setting nodes as "air" a special case. Set positions 1 and 2 to completely surround your entire build area with a good margin to spare, above as well as on the sides. Worldedit doesn't create the same memory and cpu load issues that Mapfix does, so you can do an area 500 x 500 x 100 nodes without any trouble. In that area use Worldedit's Replace Nodes feature to replace "air" with "air".

That script was specifically created to deal with the shadows issue and it works really well. With 16 gig of Ram under linux you can clear an area of almost 200 million nodes in one hit.

Hope that helps clarify and not create further confusion.

Cheers,

Andrew.

slopsbucket commented 2 years ago

I forgot to mention - how to create those shadows deliberately:

Simply use Worldedit to generate a flat layer of anything, stone will do. Make it about 20 nodes to a side but only 1 node deep. - BUT - Be standing more than 80 nodes (5 chunks) away from that area when you do it.