[Mod] Indestructible Bedrock Layer [2.0.0] [bedrock2]

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

[Mod] Indestructible Bedrock Layer [2.0.0] [bedrock2]

by Wuzzy » Post

This mod adds a simple indestructible bedrock layer at the bottom of the world:
bedrock2.jpeg
bedrock2.jpeg (54.41 KiB) Viewed 1153 times
Bedrock cannot be destroyed or moved in any way, neither in normal gameplay or in Creative Mode. The bottom at the world is at Y coordinate -30912 (this can be changed with a setting).
Spoiler
The intention of the mod is to close off the ugly open area you normally have when you reach the bottom of the world. It allowed you to walk on emptyness, dropping stuff into it, and other weird stuff.
The bedrock must never be able to be destroyed in normal gameplay, if you see any open holes in the bedrock, please report a bug. If you manage to destroy the bedrock, please report it, too, unless it is listed in “known problems”.
Map generation should be ultra-fast, since the mod only generates a flat layer of bedrock and uses Lua Voxel Manipulator.
This mod is a resurrection of this very old bedrock mod: viewtopic.php?f=11&t=1233
And it has been brushed up for Minetest 5.0.0 (and later).
  • Version: 2.0.0
  • Works with: Minetest 5.0.0 (and probably later versions as well)
  • License of everything: MIT License
  • Download: here
  • ContentDB page: here (also includes a download for a version 1.2.2, which is compatible with Minetest versions 0.4.13 to 0.4.17.1)
  • Mandatory dependencies: None!
  • Optional dependencies: mesecons_mvps (from Mesecons modpack)
  • Git project page: https://codeberg.org/Wuzzy/minetest_bedrock2/issues
Last edited by Wuzzy on Fri Mar 03, 2023 15:42, edited 18 times in total.

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Indestructible Bedrock Layer [0.1.0] [bedrock2]

by Hybrid Dog » Post

Spoiler
Image
this is a tool for moderators, which uses minetest.add_node and checks for protection

Image
The replacer tool is used for usual players. They can easily get bedrock by replacing it with a different node.

Image
The mining laser, mining drill and other tools are made for usual players, too.

Image
Image
With pistons, node breakers, etc. you can also make holes in the bedrock.

Image
Image
and there're some mods which e.g. don't respect the on_blast function.
To avoid this you could add things to the node definition (empty on_destruct and on_construct functions, a can_dig function returning false and a drop = ""),
add an abm which tests if there're holes in bedrock and automatically fills the holes and
override the minetest.get_node function to let it always tell that there's bedrock on the bottom and not somewhere else
Attachments
laser.png
laser.png (161.68 KiB) Viewed 3034 times
replacer.png
replacer.png (131.6 KiB) Viewed 3034 times
superpick.png
superpick.png (157.52 KiB) Viewed 3034 times

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Wuzzy » Post

Thank you, Hybrid Dog!

In version 0.2.0 (which I just released) I have added on_destruct, can_dig, diggable = false, drop = "" to the node definition. This eliminates the following problems:
  • Desert stone dungeons without bedrock
  • Mining drill destroying bedrock
  • Mining laser destroying bedrock
  • Replacer tool replacing bedrock
I have also used the Mesecons API to prevent bedrock nodes to be pushed or moved by movestones and pistons. This introduces an optional dependency on mesecons_mvps.

The following problems remain:
  • TNT mod from minetest_game (and probably similar mods) destroys bedrock no matter what, there is nothing I can do about it, so the TNT mod must be fixed instead. I checked the code, apparently it does not make any checks, it directly calls minetest.remove_node.
  • The moderator tool (1st screenshot from you) may still destroy bedrock, but I don't know. You didn't tell me the mod name, so I don't know how to check. :-(

I have not added on_construct to the node definion, because it kinda seems kinda strange. Why on_construct? I just want to prevent the destruction, not the creation of bedrock.
I also have not added an ABM to add bedrock back into that layer. Bedrock should normally not be removed in the first place, so its removal must be prevented, but this needs a minimum of cooperation from other mods (these do NOT have to depend on this mod for this, some generic measures are completely fine).

I certainly do not wish to overwrite minetest.get_node, this is way too hackish for me, also it is likely that this could break a lot of mods in the future.


I would appreciate further testing and comments very much! :-)

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Hybrid Dog » Post

Wuzzy wrote:The following problems remain:
  • TNT mod from minetest_game (and probably similar mods) destroys bedrock no matter what, there is nothing I can do about it, so the TNT mod must be fixed instead. I checked the code, apparently it does not make any checks, it directly calls minetest.remove_node.
l thought only my bomb mods (https://github.com/HybridDog/nuke, https://github.com/HybridDog/tnt) don't use the on_blast functions.
[*]The moderator tool (1st screenshot from you) may still destroy bedrock, but I don't know. You didn't tell me the mod name, so I don't know how to check. :-([/list]
lt's only a tool made to dig everything fast.
https://github.com/HybridDog/superpick
I have not added on_construct to the node definion, because it kinda seems kinda strange. Why on_construct? I just want to prevent the destruction, not the creation of bedrock.
l thought that bedrock should only appear at the bottom.
I also have not added an ABM to add bedrock back into that layer. Bedrock should normally not be removed in the first place, so its removal must be prevented, but this needs a minimum of cooperation from other mods (these do NOT have to depend on this mod for this, some generic measures are completely fine).

I certainly do not wish to overwrite minetest.get_node, this is way too hackish for me, also it is likely that this could break a lot of mods in the future.
l don't think overriding minetest.get_node could cause big problems.
I would appreciate further testing and comments very much! :-)
l tested digging it with the super pickaxe.
sorry, l thought you could easily disallow removing a node by adding an empty con-/destruct functions, but you can disallow placing and digging it
http://dev.minetest.net/minetest.regist ... n_destruct
and you could add an after_destruct function, which sets the node after it became removed

and the desert dungeons still don't have bedrock
Image
Attachments
screenshot_2824702091.png
screenshot_2824702091.png (173.99 KiB) Viewed 3034 times

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Wuzzy » Post

Quote from Superpick mod:
I made a tool which can dig everything except objects very fast and show information about the punched node.
“everything except objects” includes bedrock. This is clearly a tool made for testing, not for regular gameplay, so I don't see any need to make the bedrock mod compatible. In fact, it would break the superpick mod if I give special treatment for the superpick mod, because it would not be able to break everything except objects anymore.

Oh, and yes, indeed on_destruct seems to be useless, because removing it from the node definition did not change anything, lol.

l thought that bedrock should only appear at the bottom.
Right, but I meant only for the map generation algorithm. If some mod wants to manually place bedrock somewhere else, I will not prevent it to do so. The mod maker probably knows what he/she/it is doing, although I think it might be a bit weird. If some player obtained bedrock by cheating/testing/debugging, there is no point to prevent placing it, either.
For normal gameplay, the bedrock should be completely unobtainable, however.
l don't think overriding minetest.get_node could cause big problems.
This function is far too important to be overwritten by some random mod. I may be able to do it right for Minetest 0.4.12, but since the Lua API is not stable, there is no guarantee that it will work for future versions, and I don't know for how long I will continue with mod development in Minetest.
Also, I think overwriting this function is completely unneccessary to reach my goal.

Oh, and could you try to reproduce the desert dungeon problem for 0.4.12, please?
(with mapgen, seed and coordinates, of course)

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Hybrid Dog » Post

l didn't find a desert dungeon but l found an usual one. l use mgv6 and for the desert dungeon screenshot l used a version of minetest fairly near to 0.4.12.
download/file.php?mode=view&id=2084
Attachments
dung.png
dung.png (122.15 KiB) Viewed 3034 times

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Wuzzy » Post

Here are coordinates and the seed for a desert stone dungeon:

X = 536
Y = -30909.5
Z = -100

seed = 7350173242655530646
mapgen: v6

Minetest version: 0.4.11

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Hybrid Dog » Post

Image

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Wuzzy » Post

Sorry, you post somehow got messed up. What did you want to say?

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

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Wuzzy » Post

Good news! Minetest Game has finally included on_blast in it's TNT mod, which means that bedrock won't be destroyed by Minetest Game's TNT anymore. But this change is currently only in the development version, and not in the stable version 0.4.12.
I hope that other TNT-like mods will follow.

I still have no clue what causes the problem with the desert dungeons. Sadly, I don't seem to find any desert dungons in the development version right now. So if someone is using the dev version, and finds a desert dungon at the bottom, please tell me whether it has bedrock. Please also tell me the coordinates and the commit ID (or whatever Minetest says in the upper left corner).

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Hybrid Dog » Post

l assume that caves and dungeons are generated after the minetest.registered_on_generateds are executed and l think paramat wrote that the caves are even generated 16 coords outside the minp maxp cube, which means that they become also generated in already generated map.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Sokomine » Post

Hybrid Dog wrote: l assume that caves and dungeons are generated after the minetest.registered_on_generateds are executed and l think paramat wrote that the caves are even generated 16 coords outside the minp maxp cube, which means that they become also generated in already generated map.
When a new mapchunk (those 80x80x80 nodes things; size may vary depending on setting) is created, it does overlap by 16 blocks with its neighbours and is in fact 111x111x111 nodes in size (+16 on each side). This is so that dungeons created in this new mapchunk may extend into neighbouring mapchunks instead of beeing cut at the edges. If the neighbour hasn't been created yet, only the dungeon part for it will be generated. The neighbour then contains mostly ignore nodes, with only the dungeon walls and air inside beeing set in the overlapping region.
A list of my mods can be found here.

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Hybrid Dog » Post

Sokomine wrote:
Hybrid Dog wrote: l assume that caves and dungeons are generated after the minetest.registered_on_generateds are executed and l think paramat wrote that the caves are even generated 16 coords outside the minp maxp cube, which means that they become also generated in already generated map.
When a new mapchunk (those 80x80x80 nodes things; size may vary depending on setting) is created, it does overlap by 16 blocks with its neighbours and is in fact 111x111x111 nodes in size (+16 on each side). This is so that dungeons created in this new mapchunk may extend into neighbouring mapchunks instead of beeing cut at the edges. If the neighbour hasn't been created yet, only the dungeon part for it will be generated. The neighbour then contains mostly ignore nodes, with only the dungeon walls and air inside beeing set in the overlapping region.
So adding bedrock into the overlapped area would fix the problem, wouldn't it?
And the core mapgen only adds nodes in the fairly empty mapchunk if they are "ignore", doesn't it?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Sokomine » Post

Hybrid Dog wrote: So adding bedrock into the overlapped area would fix the problem, wouldn't it?
And the core mapgen only adds nodes in the fairly empty mapchunk if they are "ignore", doesn't it?
Yes, that ought to fix the problem. That's how I'm doing it with mg_villages. Stops the hungry cavegen from eating poor houses made out of nodes which cannot be changed regarding ground_content. That is...for bedrock, setting

Code: Select all

is_ground_content = false
in the definition of the bedrock node will already be sufficient. Cavegen does not eat these nodes. mg_villages can't rely on that as some houses are made out of material that may indeed be ground_content (i.e. stone) in other places.
A list of my mods can be found here.

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

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Wuzzy » Post

Berock already has is_ground_content set to false, so this is not going to help.

But I don't even know where to find desert dungeons in latest dev version, so if anyone could please give me coordinates and commit ID I would be glad.

But if I understood correctly, this problem seems to come from the engine, right? In that case, there is probably nothing I can do against it (as a modder).

I don't really understand that “overlapped area” stuff.

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Hybrid Dog » Post

Maybe only dungeons ignore the "is_ground_content".

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Sokomine » Post

Wuzzy wrote: Berock already has is_ground_content set to false, so this is not going to help.
That ought to be enough. I did see cavegen griefing in mg_villages before I covered the 16 node wide shell. Nodes that had is_ground_content set to false did survive those cavegen griefings - others did not.
Wuzzy wrote: I don't really understand that “overlapped area” stuff.
Hmm. Since all three participants of this discussion speak German, it might help if I switch to my native language?

Also...wenn ein Gebiet der Map noch nicht oder nicht vollstaendig existiert, wird es neu generiert. Intern gibt es die Mapbloecke - das sind immer genau 16x16x16 Nodes/Bloecke (Stein, Holz, wasauchimmer - das, woraus die Welt besteht), die als untrennbare Einheit direkt in der Datenbank gespeichert werden. Ein Mapblock - ein Datensatz. Der Mapgenerator arbeitet allerdings nicht auf diesen einzelnen Mapbloecken, sondern fasst normalerweise 5 in jede Richtung zu einem Mapchunk zusammen - sodass dann effektiv ein Gebiet von 80x80x80 Nodes/Bloecken pro Mapgen-Aufruf bearbeitet wird. Diese werden neu erzeugt und sind das Kerngebiet. Allerdings gibt es noch eine aeussere Huelle von 16 Nodes/Bloecken in jede Richtung darum herum - also je ein weiterer Mapblock - der mit den Nachbar-Mapchunks ueberlappt. So koennen groessere Hoehlen besser erzeugt werden und in Nachbarchunks hineinreichen. Wenn nun eine Hoehle erzeugt wird und der Nachbarchunk dort schon etwas hatte, "frisst" der Cavegen sich munter durch den Nachbarchunk. Wenn der Nachbarchunk noch gar nicht existiert, wird er erzeugt und bekommt genau das gespeichert, was gerade erzeugt wurde - normalerweise ist das die Luft in der Hoehle. Der Rest des Nachbar-Mapchunks wird auf ignore gesetzt, damit er spaeter normal gefuellt werden kann.
Hybrid Dog wrote: Maybe only dungeons ignore the "is_ground_content".
That is very likely. In that case, it'd be a bug in the engine, and asking for "do not replace nodes that have is_ground_content set to false with nodes from dungeons/temples" ought to be a valid issue for the engine. Jp just posted a picture of a floating desert dungeon (internally called temple?) in the screenshots thread. Maybe that'll help locating one for test purposes.
A list of my mods can be found here.

User avatar
jp
Banned
Posts: 947
Joined: Wed Dec 18, 2013 09:03
GitHub: kilbith
Location: France

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by jp » Post

Sokomine wrote: Hmm. Since all three participants of this discussion speak German, it might help if I switch to my native language?
<offtopic> No, this doesn't helps the quiet readers who doesn't understand german at all. Speak your native language in the appropriate subforum else if everyone do that, the main forum would end up in an ununderstandable mess. </offtopic>

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

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Wuzzy » Post

It's okay, it was me who asked this question. But please don't repeat that.
I wonder if this bug is already known and reported on GitHub.

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by prestidigitator » Post

Overriding minetest.get_node() will just make mods THINK there is bedrock when there may not be. If you really, really want to make something indestructable, you'll probably have to override minetest.add_node(), minetest.remove_node(), minetest.set_node(), minetest.swap_node(), and minetest.get_voxel_manip() (maybe a few others if the damage mechanism can't be fully covered by protection and/or node properties/groups/callbacks). A bit of work, but it can be done.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Sokomine » Post

jp wrote:
Sokomine wrote: Hmm. Since all three participants of this discussion speak German, it might help if I switch to my native language?
<offtopic> No, this doesn't helps the quiet readers who doesn't understand german at all. Speak your native language in the appropriate subforum else if everyone do that, the main forum would end up in an ununderstandable mess. </offtopic>
The way mapchunks are larger than what one would expect is not immediately obvious. It took a lot of talking between hmmmm, paramat and me to get so far as to be able to eliminate cavegen (and mudflow) griefing in the villages. I assume I understood it well enough by now because it works. But my explanation may be lacking, thus I tried to eliminate at least the language barrier. The question is: Did it work and increase the amount of people who understood now how it works? Or are there other silent readers out there who wish for another attempt to explain it? And yes, you're right. We ought to stick to English here.
A list of my mods can be found here.

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

Re: [Mod] Indestructible Bedrock Layer [0.2.0] [bedrock2]

by Wuzzy » Post

Okay, after a bit of testing it seems that desert dungeon no longer destroy bedrock at the bottom, at least in the development version of Minetest.

If you want to verify what I'm saying, here are the coordinates and the seed of a desert dungeon at the bottom:

X=-244
Y=-30909.5
Z=-1086
seed = 4927723057828559353

You must set these variables in minetest.conf (make sure to delete other mapgen-related variables before creating your world):
mg_name = v6
mgv6_spflags = nosnowbiomes
mgv6_freq_desert = -0.5

Tested with this Minetest version: Development version as of b160f8dfe7e3bf8176e3f9f64dc2d9a9868d7fce (feel free to test it with latest dev, alternatively).


Also, does anyone know here other ways in which the bedrock may be destroyed? Also post if you didn't find any way (after some testing, of course). Feel free to use mods to attempt to destroy my bedrock.
The only kind of mods which don't count are mods for testing and debugging (so not for “real” gameplay).
You also don't need to report TNT, this is also known.

If there are no more serious reports in the near future, I will call this release 1.0.0 and request to move this mod to Mod Releases, since this mod is obviously already pretty stable and the remaining problems are not in my power to solve (and NO, I won't overwrite any functions, this is too crazy for me. XD).

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

Re: [Mod] Indestructible Bedrock Layer [1.0.0] [bedrock2]

by Wuzzy » Post

Okay, I'll just call this version 1.0.0 now and seek to get this thread to Mod Releases.
There is now also a Git repository (see first post).

golthem
Member
Posts: 43
Joined: Tue Jan 21, 2014 20:22
In-game: Golthem

Re: [Mod] Indestructible Bedrock Layer [1.0.0] [bedrock2]

by golthem » Post

Glad to see this coming out Wuzzy! It seems like this should be useful for "capping off" the world and keep the end of world bugs contained.

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Mod] Indestructible Bedrock Layer [1.0.0] [bedrock2]

by Fixer » Post

Important! Before running the mod make sure it is in bedrock folder, otherwise it gives error :}
Wuzzy, want to add this warning into first post and readme or fix it?

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests