[Mod] Hallelujah Mountains [cloudlands]

User avatar
DrFrankenstone
Member
 
Posts: 115
Joined: Tue May 24, 2016 05:36
Location: Melbourne, Australia
GitHub: treer

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Fri Nov 29, 2019 23:09

FreeGamers wrote:How come when I use mods like planet_moon or planet_mars, which create land way up above my server, around 5000 nodes up, does it not create shadows like Hallelujah Mountains?

Is there a cutoff point for the light calculations?


If you can't see a moon or island from the ground - or haven't looked up - then nothing is sent to the engine for rendering that could add extra shadow when the ground lighting is first calculated, so the draw distance of the first player to explore/emerge the land creates a cutoff.

If the moon/island is within draw distance, and you look at it before the land beneath has been drawn (i.e. before the land's lighting was calculated), then it gets more complicated. I think shadows are calculated to the bottom of each chunk (80 blocks high), and then whether they are propagated to the chunk below depends on whether any of the other mods you have loaded are calling calc_lighting() in the on_generated event with propagate_shadow defaulted to true.

If there's at least one empty chunk between the land and the moon/island then the shadows might not propagate - depending on what other mods are doing, so somewhere between 80 and 240 blocks apart it might cut out.

If the ground and moon/island are in the same chunk together then shadow will always be cast.
 

User avatar
FreeGamers
Member
 
Posts: 334
Joined: Sat May 25, 2019 00:15
Location: United States
GitHub: is proprietary I use NotABug

Re: [Mod] Hallelujah Mountains [cloudlands]

by FreeGamers » Sat Nov 30, 2019 02:10

OK. Maybe I should look into how Pandorabox emerges blocks automatically and periodically to make sure I don't come into situations like this, for now I'm going to add cloudlands back and just deal with the bug until I find a workaround.
 

User avatar
DrFrankenstone
Member
 
Posts: 115
Joined: Tue May 24, 2016 05:36
Location: Melbourne, Australia
GitHub: treer
 

User avatar
paramat
Developer
 
Posts: 3471
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: [Mod] Hallelujah Mountains [cloudlands]

by paramat » Sat Nov 30, 2019 19:18

Have not tried this mod, but it looks beautiful, good mapgen work.
DrFrankenstone wrote:Yeah, when Cloudlands calls calc_lighting() it sets propagate_shadow to false, which sometimes helps but not fully (I think the land renderer will have the value set true). The workaround I know of is to emerge the land chunks before emerging the cloudlands.

You may know this but ... 'propagate shadow' for a mapchunk controls whether shadow from the mapchunk above continues down into it.
So to prevent shadows you need to run the LVM with 'propagate shadow = false' in all cloudland mapchunks but also in the layer of mapchunks below the lowest possible cloudland. In this lower mapchunk layer you are only using the LVM to calculate lighting for that mapchunk, without actually generating anything.
Last edited by paramat on Sat Nov 30, 2019 19:44, edited 1 time in total.
 

User avatar
paramat
Developer
 
Posts: 3471
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: [Mod] Hallelujah Mountains [cloudlands]

by paramat » Sat Nov 30, 2019 19:38

DrFrankenstone wrote:If you can't see a moon or island from the ground - or haven't looked up - then nothing is sent to the engine for rendering that could add extra shadow when the ground lighting is first calculated, so the draw distance of the first player to explore/emerge the land creates a cutoff.

If the moon/island is within draw distance, and you look at it before the land beneath has been drawn (i.e. before the land's lighting was calculated), then it gets more complicated.

Not really. It is all about generation, not rendering for a player. Initial lighting is created at mapchunk generation time.

FreeGamers, there is no cutoff for lighting.
Here's how it works:
(A mapchunk is a 80x80x80 node cube, and is the volume of world generated in one operation by mapgen).

When each mapchunk is generated, it checks whether there is a generated mapchunk above it.
If so, it looks at the lowest layer of nodes in the mapchunk above and propagates down any shadows present in that layer into itself. Otherwise, full sunlight is assumed above.
So, shadows can only pass into the lower mapchunk if the upper mapchunk is generated first.

Therefore, the only way for nodes in a high mapchunk to cause shadows on the world surface is:
The high mapchunk is generated first.
The mapchunks below this initial mapchunk are generated in sequence from top to bottom.
The world surface mapchunk is generated last.
(Remember that generation is caused by the presence of a player.)
This of course rarely happens.
 

User avatar
FreeGamers
Member
 
Posts: 334
Joined: Sat May 25, 2019 00:15
Location: United States
GitHub: is proprietary I use NotABug

Re: [Mod] Hallelujah Mountains [cloudlands]

by FreeGamers » Sun Dec 01, 2019 04:30

That is a very detailed and informative response paramat. Thank you! This will help me going forward as I plan to do more creation of planetary worlds. I'll try to keep in mind that a buffer helps this a lot. :)
 

User avatar
DrFrankenstone
Member
 
Posts: 115
Joined: Tue May 24, 2016 05:36
Location: Melbourne, Australia
GitHub: treer

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Tue Dec 03, 2019 21:05

I'll look into custom-recalculating the lighting under islands, though it may fail if there's another mod hooked into on_generated that runs calc_lighting() on the chunk after Hallelujah Mountains has finished.

paramat wrote: It is all about generation, not rendering for a player. Initial lighting is created at mapchunk generation time...
Remember that generation is caused by the presence of a player.

"sent to the engine for rendering" is poorly phrased but I mean the order that chunks are generated/fetched is not caused just by presence of a player, but also where they are looking and the distance they are seeing - you can use binoculars to cause mapchunk generation to happen further in the distance, and you can reduce the distance from you that chunks are being generated by not looking in that direction.

e.g. you can prevent shadows by running over new land while not looking up, or cause shadows by scouting islands with binoculars without having visited the land below.
 

User avatar
paramat
Developer
 
Posts: 3471
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat
 

User avatar
DrFrankenstone
Member
 
Posts: 115
Joined: Tue May 24, 2016 05:36
Location: Melbourne, Australia
GitHub: treer

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Wed Dec 04, 2019 22:03

Wuzzy wrote:The mod is currently broken if combined with MCL2 (version 0.53.4). Lots of the floating islands will have all the tree species at once, which looks awkward.

Might be one for paramat's expertise...

MCL2 registers its trees as biome-specific decorations, and Hallelujah Mountains invokes minetest.generate_decorations() after generating the land.

Should be a match made in heaven that places trees appropriately, but it looks like the biomemap for the chunk is empty - full of BIOME_NONE, I think because the mapgen only calculates the biomemap where there's stone, and the chunk was empty when the mapgen assessed it.

Minetest Game was never affected by this issue because its tree types are determined by soil type rather than biomemap, and Hallelujah Mountains places the correct soil for the biome.

I haven't looked into why BIOME_NONE can result in any decoration - perhaps an obscure logic error hidden in minetest's code because registered decorations on land with no biomemap isn't something normal testing would encounter.

I don't think I can set the biomemap from lua, but Paramat might have some ideas on how to cause it to recalculate, or it might have to wait until/be combined with lua being able to generatebiomes, or a check for whether biomemap needs calculation added to minetest.generate_decorations().
 

Previous

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 10 guests