[Mod] Hallelujah Mountains [cloudlands]

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Post

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: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Hallelujah Mountains [cloudlands]

by FreeGamers » Post

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.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft


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

Re: [Mod] Hallelujah Mountains [cloudlands]

by paramat » Post

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: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] Hallelujah Mountains [cloudlands]

by paramat » Post

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: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Hallelujah Mountains [cloudlands]

by FreeGamers » Post

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. :)
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Post

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: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] Hallelujah Mountains [cloudlands]

by paramat » Post

I see, yes that is correct.

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Post

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().

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Post

There's a new version up on github which is faster and fixes the shadows problem, but I haven't uploaded it to content DB yet:
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.

The mod also crashes if you use it in mapgen v6, or when no biomes are registered.
The no biomes crash is now fixed, and thanks for pointing it out.

Unfortunately, until Minetest provides a way to update the biomemap (see previous post) the islands will have to remain a magical realm where all MineClone2 trees can be found growing together in harmony.

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by paramat » Post

DrFrankenstone wrote:the mapgen only calculates the biomemap where there's stone
Yes this is correct, see commit https://github.com/minetest/minetest/co ... bac9b30c02

FaceDeer
Member
Posts: 477
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod] Hallelujah Mountains [cloudlands]

by FaceDeer » Post

This looks like a beautiful mod, but I just ran into that obfuscated code that was discussed in the first page of this forum thread and it looks like nothing's been resolved since it was brought up. Obfuscated code is bad for a number of different reasons.
  • It may not be technically a violation of the GPL's licensing terms when an original author releases code in obfuscated form, but it's very close to it and violates the license's spirit. It likely is illegal to take something non-obfuscated that's under GPL and then obfuscate it in your own release. Some discussion of the matter is here, and the GNU project claims specifically that obfuscated code is not really source code in their view. So if I were to need to fix a bug in the obfuscated stuff, or otherwise extend it, I'd de-obfuscate it to work on it (or use the code from the de-obfuscated branch) and then I would not be able to re-obfuscate it when submitting the change. The original author, likewise, would not be able to re-obfuscate the submitted code afterward because it contains my own work under the GPL. So the obfuscation can only legally last until the first time someone else contributes to that stuff.
  • Speaking of fixing bugs, not exactly the easiest thing to do here! I ran the code through a prettifier and I can sort of follow the results, but lacking meaningful variable names makes it very difficult. Yes, there's a branch of the repo that has the non-obfuscated code in it, but that's actually not where I got the copy of the mod that I was working with - another user had included it in the repository of a game they're working on and I first found it there.
  • Also speaking of bugs, did you know that there's been a change to the code in the non-obfuscated branch that appear to be a bugfix that hasn't been ported back to the obfuscated version in the main branch? Or maybe the bugfix is in the obfuscated version and wasn't ported to the public copy of the non-obfuscated version, I can't tell. Comparing the obfuscated and non-obfuscated versions of the code is a huge pain. And evidently nobody does that because this difference between branches appears to have been here for at least full year.
  • There's a typo in one of the rot-7-encoded strings. If I were to see that typo in the game I'd try searching for that string in the codebase, and of course not find it. In fact, a related issue is what set me on the path of finding this in the first place - I noticed that there was a suspiciously-named node definition registered in my game and searching for the node's name in my local codebase didn't find anything, raising suspicion even further.
  • Still on strings, how will these be translated? Pretty sure Minetest's localization system would need the strings in non-obfuscated form to work on.
  • There is of course a deep reflexive (and very justified!) mistrust of obfuscated code. I wouldn't run this on my server. Even knowing that there's a non-obfuscated branch available to read isn't good enough, because as I've found the obfuscated code does not match the non-obfuscated code. Verifying that it does match is a big hassle and renders the whole exercise moot anyway, I might as well use the non-obfuscated branch directly.
And finally, there's a bit of obfuscated text that's apparently meant as a comment for coders and is never seen in-game in non-obfuscated form. It reads in part "Feel free to involve the <spoiler> in other mods." That seems rather ironic given how even that comment was disguised against being seen by other coders. How would this be integrated into lorebooks or doc, for example?

I really hate to be harping on this rather than exploring the mod's amazing-looking landscape, but I guess I've still got a bit of annoyed adrenaline in my system after discovering this obfuscation and spending a bunch of time making sure it wasn't a danger. Sorry to be so negative.

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Post

It contained secrets for players to find, secrets for coders to find, and an unobfuscated version for those in the "ain't nobody got time for that" camp.

But yes, the unobfuscated code recently fell behind master, support for Minetest's new translation features would be desirable, and obfuscated versions shouldn't be in wider mod-packs.

addDetail_secrets__shhh_dont_tell_people() was obfuscated onto a single line so the discovery of secret content would be a revelation and unmistakable. That worked a bit too "well" and with the cat out of the bag and causing problems, I think can be retired. I'll update the unobfuscated branch and shift it into master.

FWIW, it's not ironic that text which players will never see was "disguised against being seen by coders", as you'll notice you all still managed to read it. The section was structured to be figured out, and presents a near identical activity to discovering secrets in Minecraft via obfuscated Java disassemblies - that is what the hidden text is talking about. Perhaps I was the only one here who reversed bits of Minecraft to learn forbidden gameworld knowledge and found that the journey was rewarding in of itself - a second way to play.

Obfuscation wasn't to hide secrets, it provided another way of discovering them.

User avatar
Linuxdirk
Member
Posts: 2674
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Hallelujah Mountains [cloudlands]

by Linuxdirk » Post

DrFrankenstone wrote:Obfuscation wasn't to hide secrets, it provided another way of discovering them.
Please for fucks sake drop this utterly annoying and stupid obfuscation bullshit completely and without replacement once and for all.

Less hassle, less issues, less discussion, less problems, less. fucking. everything.

People who want to get spoiled will look at the unobfuscated code anyways, everyone else doesn’t.

You attitude against not using obfuscation makes me reluctant to integrate the mod in my everyday play worlds. Not a big deal for you of course, but I really want to do more with that nice mod except running it for testing and experimenting purposes in a dedicated world that get’s reset every time I leave it.

Also:
FaceDeer wrote:Sorry to be so negative.

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Post

Linuxdirk wrote:less discussion, less problems, less. fucking. everything.
Clearly not - me having agreed to remove it apparently causes you to keep posting more discussion.

User avatar
Linuxdirk
Member
Posts: 2674
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Hallelujah Mountains [cloudlands]

by Linuxdirk » Post

Okay, then I interpret your statement “I'll update the unobfuscated branch” differently, sorry.

I’ll wait for a commit along the words “removed all obfuscated content and obfuscation functions” in the mod’s master branch then. Thank you :)

FaceDeer
Member
Posts: 477
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod] Hallelujah Mountains [cloudlands]

by FaceDeer » Post

DrFrankenstone wrote:The section was structured to be figured out, and presents a near identical activity to discovering secrets in Minecraft via obfuscated Java disassemblies - that is what the hidden text is talking about. Perhaps I was the only one here who reversed bits of Minecraft to learn forbidden gameworld knowledge and found that the journey was rewarding in of itself - a second way to play.
Sorry again for the negativity, but that was not at all how it went for me. I went from an initial puzzled "huh?" at the "secret:" node registration to an alarmed "holy crap what is this getting up to?" to an annoyed "this is unmaintainable and useless" over the course of an hour, which wasn't exactly a fun journey of discovery. I've never played Minecraft, let alone modded it - I much prefer something that's fully open and designed with modding in mind.

Thank you for reversing course on the obfuscation. As I tried to keep clear despite the complaint, this is an amazing looking mod and I'm definitely looking forward to playing around with it more. I've been slipping tidbits of lore and implied worldbuilding into my own mods for players to discover so I'll see how compatible this stuff is and see if I can cross-reference it somehow.

User avatar
Johnny Joy
Member
Posts: 55
Joined: Fri Sep 05, 2014 20:26
GitHub: johnnyjoy
In-game: jjb

Re: [Mod] Hallelujah Mountains [cloudlands]

by Johnny Joy » Post

Does this mod make islands at a single height or does it scatter them all the way up like skylands?

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Post

Johnny Joy wrote:Does this mod make islands at a single height or does it scatter them all the way up like skylands?
It's a single height, but the height varies. You can find or set the height in SettingsAll Settings

Image
Attachments
cloudlands options.png
(39.3 KiB) Not downloaded yet

User avatar
Wuzzy
Member
Posts: 4089
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Hallelujah Mountains [cloudlands]

by Wuzzy » Post

The undocumented (!) function file_exists has been removed in 5.2.0, as a result, cloudlands broke.

Please do not depend on undocumented features, Minetest reserves the right to change or remove them at any time without warning.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Post

Thanks, I didn't realise that one was undocumented.

cloudlands has been updated for 5.2.0

Meaty
New member
Posts: 4
Joined: Wed May 15, 2019 03:37

Re: [Mod] Hallelujah Mountains [cloudlands]

by Meaty » Post

Great mod, thank you DrFrankenstone.

I have my singleplayer game with 2x2 km map already explored. I want to introduce cloudlands to my game. Will islands be generated outside this explored 2x2 km region above not yet discovered lands?
I am not very familiar with the way maps generated, so if someone explain me I will greatly appreciate.

Thanks!

User avatar
texmex
Member
Posts: 1752
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Hallelujah Mountains [cloudlands]

by texmex » Post

Meaty wrote:Great mod, thank you DrFrankenstone.

I have my singleplayer game with 2x2 km map already explored. I want to introduce cloudlands to my game. Will islands be generated outside this explored 2x2 km region above not yet discovered lands?
I am not very familiar with the way maps generated, so if someone explain me I will greatly appreciate.

Thanks!
Outside explored region: yes. Above explored region: Yes, if you haven't explored near the height of the cloudlands.

The map is divided up in mapblocks, which are 16x16x16 nodes large.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

Meaty
New member
Posts: 4
Joined: Wed May 15, 2019 03:37

Re: [Mod] Hallelujah Mountains [cloudlands]

by Meaty » Post

texmex wrote:
Outside explored region: yes. Above explored region: Yes, if you haven't explored near the height of the cloudlands.

The map is divided up in mapblocks, which are 16x16x16 nodes large.
I see, thanks. For some reason I thought that mapblocks are 16x16xinf and they are more like pillars then cubes.

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

Re: [Mod] Hallelujah Mountains [cloudlands]

by DrFrankenstone » Post

Cloudlands islands get generated in big chunks of 5×5×5 mapblocks, i.e. 80×80×80.

If you found some big chunks missing from the cloudlands - likely in places where they get close to the land, you could force the missing chunk(s) to be regenerated using /deleteblocks command.

Another option is to raise the cloudlands so high they are effectively a separate aether realm ("Altitude of islands" in the cloudlands settings), as I wouldn't expect any chunks to have been emerged at say 600 high. But the higher they are the more you'd want extra mods like balloons, teleporters or portals to make the trip possible (cloudlands portals exist, but need the latest version of the nether mod).

You could take a copy of your world and just try it on the copy. You can get a map of the cloudlands from Amidst-for-Minetest. I imaging it wouldn't take too long to fly along every "eddyfield" line of islands inside that 2km square and see if anything needs /deleteblocks.
For some reason I thought that mapblocks are 16x16xinf and they are more like pillars then cubes.
Minecraft did it that way. It made falling simpler, but its worlds are only 256 high.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests