Poikilos / EnlivenMinetest

Minetest engine server management tools and ENLIVEN game installer/updater

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

worldedit doesn't update shadows

Poikilos opened this issue · comments

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:

  • Set the time to day (such as via /time 8000 for 8 am).
  • Create (via building or worldedit--doesn't matter) a 1-meter-thick default:stone (or any other light-blocking material) square about 10x10 or any other size about 10m from the ground.
  • Ensure the shadow appears under it as expected.
  • Delete the stones using worldedit (set nodes to air).

Expected result:

  • The shadows should disappear or mapfix should deal with them.

Actual result:

  • The shadows stay and mapfix doesn't readily remove them. According to @slopsbucket (on EnlivenMinetest issue 499), "Fly above the build area until you can see the shadow affect your hand, then use mapfix, that should fix the issue."

Tasks:

  • Document slopsbucket's workaround in a worldedit page on wiki.minetest.org.
  • Is there any way to make this automatic rather than requiring the workaround? Should worldedit run mapfix or some similar code on the next (opaque) nodes under each node that was removed or became transparent (such as replace default:stone with air; the node def can be checked for whether it is opaque; to do this right, the I think the code would have to start searching at, for each x,z location in the worldedit selection, the lowest node on the y axis that is opaque)?

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)

^ I gave that info to search_social via IRC.

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.

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

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

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.

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.