[Mod] Indestructible Bedrock Layer [1.2.2] [bedrock2]

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

[Mod] Indestructible Bedrock Layer [1.2.2] [bedrock2]

by Wuzzy » Fri Feb 20, 2015 05:34

This mod adds a simple indestructible bedrock layer at the bottom of the world:

Image

+ Technical notes


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 0.4.12 (and later).

Known problems (well, not really):
  • Most old TNT and similar mods destroy bedrock without mercy. Luckily, Minetest Game 0.4.13 respects the bedrock and it is not possible to destroy it in the vanilla game (+bedrock). The old mods may ignore on_blast, which is properly defined by the bedrock node. I shall write another forum topic about this to complain.
It is not in my power to fix these issues in this mod, because this mod does not cause these issues. But if you found another way to destroy my bedrock, please report it here and I will check.

Version: 1.2.2
Works with: Minetest 0.4.14 (and probably later versions as well)
License of everything: WTFPL
Download: See attachment:
Mandatory dependencies: None!
Optional dependencies: mesecons_mvps (from Mesecons modpack), intllib
Git project page: http://repo.or.cz/w/minetest_bedrock2.git
Attachments
bedrock2_1.2.2.zip
(74.46 KiB) Downloaded 759 times
bedrock2_0.1.0.jpg
(30.11 KiB) Not downloaded yet
Last edited by Wuzzy on Tue Nov 22, 2016 01:02, edited 13 times in total.
 

User avatar
Hybrid Dog
Member
 
Posts: 2522
Joined: Thu Nov 01, 2012 12:46

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

by Hybrid Dog » Fri Feb 20, 2015 14:06

+ "There're several ways to remove this bedrock:"

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
(161.68 KiB) Not downloaded yet
replacer.png
(131.6 KiB) Not downloaded yet
superpick.png
(157.52 KiB) Not downloaded yet
 

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

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

by Wuzzy » Fri Feb 20, 2015 16:41

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: 2522
Joined: Thu Nov 01, 2012 12:46

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

by Hybrid Dog » Fri Feb 20, 2015 18:57

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

  • 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
    (173.99 KiB) Not downloaded yet
     

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

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

    by Wuzzy » Fri Feb 20, 2015 19:59

    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: 2522
    Joined: Thu Nov 01, 2012 12:46

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

    by Hybrid Dog » Sat Feb 21, 2015 14:00

    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
    (122.15 KiB) Not downloaded yet
     

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

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

    by Wuzzy » Sat Feb 21, 2015 16:29

    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: 2522
    Joined: Thu Nov 01, 2012 12:46
     

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

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

    by Wuzzy » Sun Feb 22, 2015 17:13

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

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

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

    by Wuzzy » Wed May 20, 2015 13:11

    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: 2522
    Joined: Thu Nov 01, 2012 12:46

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

    by Hybrid Dog » Wed May 20, 2015 15:39

    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: 3334
    Joined: Sun Sep 09, 2012 17:31

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

    by Sokomine » Thu May 21, 2015 15:34

    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: 2522
    Joined: Thu Nov 01, 2012 12:46

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

    by Hybrid Dog » Thu May 21, 2015 16:00

    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: 3334
    Joined: Sun Sep 09, 2012 17:31

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

    by Sokomine » Thu May 21, 2015 19:09

    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: 2765
    Joined: Mon Sep 24, 2012 15:01
    GitHub: Wuzzy2
    IRC: Wuzzy
    In-game: Wuzzy

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

    by Wuzzy » Fri May 22, 2015 01:42

    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: 2522
    Joined: Thu Nov 01, 2012 12:46
     

    Sokomine
    Member
     
    Posts: 3334
    Joined: Sun Sep 09, 2012 17:31

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

    by Sokomine » Fri May 22, 2015 15:08

    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
    Member
     
    Posts: 705
    Joined: Wed Dec 18, 2013 09:03
    Location: France
    GitHub: kilbith

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

    by jp » Fri May 22, 2015 18:16

    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>
    [Maps] New York CityMinecraft Imported Maps
    [Mods] Crafting GuideSpectator ModeX-Decor[+]
    [Textures] PixelBOX Reloaded

    Like my stuff? Consider donating.
     

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

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

    by Wuzzy » Fri May 22, 2015 18:47

    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: 632
    Joined: Thu Feb 21, 2013 23:54

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

    by prestidigitator » Fri May 22, 2015 20:48

    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: 3334
    Joined: Sun Sep 09, 2012 17:31

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

    by Sokomine » Sat May 23, 2015 03:47

    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: 2765
    Joined: Mon Sep 24, 2012 15:01
    GitHub: Wuzzy2
    IRC: Wuzzy
    In-game: Wuzzy

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

    by Wuzzy » Sun Jun 28, 2015 10:59

    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: 2765
    Joined: Mon Sep 24, 2012 15:01
    GitHub: Wuzzy2
    IRC: Wuzzy
    In-game: Wuzzy

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

    by Wuzzy » Wed Jul 01, 2015 18:31

    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 » Wed Jul 01, 2015 18:41

    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.
     

    Fixerol
    Member
     
    Posts: 744
    Joined: Sun Jul 31, 2011 11:23
    Location: Ukraine
    IRC: Fixer
    In-game: Fixer

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

    by Fixerol » Mon May 30, 2016 19:50

    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?
     

    Next

    Return to Mod Releases



    Who is online

    Users browsing this forum: Bing [Bot] and 6 guests