[Mod] Tunnelmaker [2.0] [tunnelmaker]

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

[Mod] Tunnelmaker [2.0] [tunnelmaker]

by kestral » Post

A Minetest Mod to easily create arbitrarily curved tunnels, pathways, and bridges.

With the official release of Minetest 5.0, Tunnelmaker 2.0 is being released, with many new and improved features.

However, note that this version of tunnelmaker only supports Minetest 5.0+. For old versions of Minetest, use the 'legacy' branch on github, or the following zip file: https://github.com/kestral246/tunnelmak ... legacy.zip

Screenshot:
Image

Features
  • Create tunnels, paths, and bridges in all sixteen possible advtrains track directions with one click.
  • Also digs up or down in the eight possible advtrains slope track directions.
  • Improved support for advtrains mod with gravel embankment, arched and optionally lined tunnels, and two widths of bridges.
  • New support for bike mod with two widths of cobblestone pathways and bridges, along with unlined tunnels.
  • New support for general excavation with unlined and lined tunnels.
  • New User Options menu to change modes and other options.
  • Reference nodes added to help digging and laying advtrains track—now easily removed when done.
  • Glass enclosure added when in water to create water tunnels.
  • Requires "tunneling" privilege, and checks protections before digging.
  • No longer has a crafting recipe, so needs to be given to player.
  • Works in both creative and survival modes, but tunneling does not place any nodes into user's inventory.
  • Minetest.conf support for several global options. See settingtypes.txt for details.
  • New support for client-side translation files. Currently only have Russian and my attempt at a French translation. Other languages will be gratefully accepted. Reference template file is available in locale directory.
New bike path mode, using optional angledstairs mod for improved diagonal slopes:
Image

Controls (Reverted back to classic controls.)
  • Left-click: Super dig one node. One click digs any node (non-repeating) and places it in player's inventory. However, it can't be used to pick up dropped items.
  • Shift-left-click: Bring up new User Options menu (see below).
  • Right-click: Dig tunnel in direction player pointed. Note that this won't place any of the dug nodes in player's inventory.
  • Shift-right-click: Cycle through vertical digging modes, up, down, and horizontal.
Image

User Options menu
  • Digging mode Select one of the three digging modes: General purpose, Advanced trains, or Bike paths.
  • Wide paths / lined tunnels Select between narrow and wide paths, and whether tunnels are lined with stone or not.
  • Continuous up/down digging Don't reset up/down after each dig.
  • Clear tree cover Remove all plant material above dig up to 30 nodes above ground. CPU intensive, so shuts off after two minutes.
  • Remove reference nodes Easily remove reference nodes by walking over them. Also shuts off after two minutes.
  • Lock desert mode to: either "Desert" or "Non-desert" Option only available when "add_desert_material = true" has been added to minetest.conf. Overrides use of desert materials in desert biomes. Useful for transition regions.
All possible inventory icons:
Image

License: CC0
Dependencies: default
Code and documentation: https://github.com/kestral246/tunnelmaker
Download: https://github.com/kestral246/tunnelmak ... master.zip

I would also like to thank Mikola, who provided many of the ideas (along with code) that helped to make this release possible.
Last edited by kestral on Sat Mar 09, 2019 16:25, edited 6 times in total.

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: Tunnelmaker

by orwell » Post

Hey, that looks cool!
May I link this in my mod's topic?
I haven't tried it yet, but looking at the screenshot, I see a problem. You just dig away nodes, but do not stabilize the tunnel walls and ceiling, so gravel might fall down on the tracks.
However, this definitely has potential!
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Post

Yes, please link in your mod topic. Thanks.

I also thought about the problem you brought up, which gave me some ideas to improve my code. Now I check the ceiling for blocks that can fall, before I dig, and convert them to cobblestone. Also while debugging this, it pointed out another issue I had with tunneling through blocks that can fall, which I also fixed.

Thanks for the comments. I've had a lot of fun with the advtrains mod.

Cage
Member
Posts: 81
Joined: Mon Oct 24, 2016 21:07
Location: Phoenix, Arizona

Re: Tunnelmaker

by Cage » Post

I really like this mod. Been wanting a mod that would do this although I was using DigAll to do the same thing. Now with this mod it makes it easy to dig tunnels. Only problem I found is that it doesn't play nice with DigAll. Seems to be a conflict between the two. So I just disable one or the other depending on my needs.

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Post

Glad you liked it. I updated the mod so it now works with digall. I changed the digging function from dig_node to node_dig, based on checking which function matyilona200 used for the tunneltest mod. Thanks matyilona200! However, make sure that digall is disactivated before tunneling, or you'll create quite a mess.

Besides working with digall, this change also means that when tunneling, this mod will now pull in one copy of each type of block dug into the inventory, but only if it's not already there. It still digs if the inventory is full, but no blocks are collected. It also works the same for 0.4.16 and 0.5.0-dev—no more raining blocks in 0.5.0-dev.

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: Tunnelmaker

by orwell » Post

How does it behave with protection?
minetest.is_protected()
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Post

Yes, I test for minetest.is_protected before executing node_dig and set_node functions, but to be honest, I haven't tested these protection features for a while.

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Post

I've added a new feature to tunnelmaker. I started updating the code to deal with the possibility of accidentally tunneling into water. Some of the digging patterns ended up being different, but when there is no water, the tunnel will end up almost exactly the same as before. (There are a couple of one-block fixes for slight imperfections in my older design.)

When there is water near the tunnel, I put a glass wall around the tunnel anywhere it's boundary is touching the water. I also replace any water within the tunnel with air, and put a temporary glass endcap at the end of the tunnel to keep water out during the tunneling process.

What this means is that it is now possible to effectively dig tunnels through water. Now you can easily run trains to your underwater sea bases.

Image

Cage
Member
Posts: 81
Joined: Mon Oct 24, 2016 21:07
Location: Phoenix, Arizona

Re: Tunnelmaker

by Cage » Post

kestral I am really liking this mod. By the way I found that is plays nice with DigAll and haven't had to disable DigAll. Just have to be careful not to use the sneak key when using Tunnelmaker. I have found many uses for this mod other then just digging tunnels. Thank you for all your hard work on this mod.

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Post

I've added a couple of new features to tunnelmaker. Since the original purpose of this mod was to make it easier to lay advtrains track, I thought that it would be good if it played more nicely with already placed advtrains track.
  • It will no longer dig dtrack nodes. (Previously all dtrack nodes within the digging window were removed.)
  • If a dtrack node is selected, a y-offset of -1 is applied before calling the dig function. This will keep the digging at ground level. (Previously it would dig 1 node above the ground, and place fill around the track.)
This should hopefully make it more useful for laying advtrains track, but shouldn't have any impact on non-train related usages.

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: Tunnelmaker

by orwell » Post

You should probably check for the group 'advtrains_track' instead of hardcoding nodes
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: Tunnelmaker

by kestral » Post

I updated the code to test for: 'minetest.registered_nodes[name].groups.advtrains_track == 1'.

While testing I discovered one exception: one can't use tunnelmaker directly on ATC track. That particular track overrides tunnelmaker's right click. It's still recognized as advtrains_track though, so it won't be deleted when tunnelmaker digs over it.

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: Tunnelmaker

by hajo » Post

kestral wrote:new feature .. tunneling into water.
Does that feature handle other liquids too, such as lava and acid ?

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: Tunnelmaker

by orwell » Post

kestral wrote:I updated the code to test for: 'minetest.registered_nodes[name].groups.advtrains_track == 1'.

While testing I discovered one exception: one can't use tunnelmaker directly on ATC track. That particular track overrides tunnelmaker's right click. It's still recognized as advtrains_track though, so it won't be deleted when tunnelmaker digs over it.
Try holding the Sneak key while clicking, it should work then
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Post

I updated first post to reflect the capabilities of the latest version of Tunnelmaker.
  • Added ability to dig up and dig down to support advtrains slope tracks.
  • Removed ability to dig tunnels through water.
This also makes it much easier to build simple stone bridges with the default fill feature. Before to make a bridge go down, one had to fly below the bridge to place an appropriate reference node. Now one just has to use the sneak key while right-clicking to set the digging mode to Down.

For these changes, I had to learn about using global variables in mods, and detecting keyboard input.

Hopefully my use of the sneak key won't interfere with too many other uses. Right now what I see is:
  • Can't set digging mode while flying — I don't see this as a problem.
  • Overrides digall use of sneak key when digging tunnels — This is probably for the better.
  • Can't use sneak key to override advanced trains ATC track's use of sneak key — It should be very rare to want to dig tunnel on one of these tracks.

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Post

I would like to thank Richard Jeffries for his video review of tunnelmaker. It's located at: https://www.youtube.com/watch?v=txE-WszHPaU.

I've watched several other of his minetest videos and they're very good. I've got many more on my list of ones I want to watch. Check them out.

As to tunnelmaker, I've added a few configuration variables to allow the user to enable or disable various features. Some of these might be useful for people who use tunnelmaker without advtrains. Using the default values shouldn't give any significant changes from before.

The biggest option is that tunneling through water can now be enabled again. I added back and improved the code to put in the glass enclosure around the tunnel.

The others give the ability to disable the placement of the cobblestone reference nodes; disable placing torches, or adjust their spacing; and enable the ability to dig up or down continuously without having the mode reset each time.

These configuration variables can be changed by editing tunnelmaker's init.lua, near the top of the file.

Mikola
Member
Posts: 16
Joined: Fri Nov 24, 2017 18:01
GitHub: Mikola314
In-game: mikola

Re: [Mod] Tunnelmaker [tunnelmaker]

by Mikola » Post

Hello.
Do you plan in the near future to make changes in fashion?
Do you have a desire to consider Pull Requests if it appears?

User avatar
Theone10
Member
Posts: 14
Joined: Mon Nov 12, 2018 18:02
GitHub: Theone10
IRC: Theone10
In-game: Theone10

Re: [Mod] Tunnelmaker [tunnelmaker]

by Theone10 » Post

i thank i can have some fun with this

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Post

Mikola, I'm not sure what you mean by changes in fashion.

I cannot change the width of the tunnels without starting the code over again, but I realized that I could change the height, and make the "arches" optional. The code now has new config variables to set both of these, which I have checked in.

I will consider other changes, but my first priority is to support laying advtrains track, while keeping the operation of this mod as simple as possible. There are plenty of other tunneling mods that have more features, but are much more complex to use.

Mikola
Member
Posts: 16
Joined: Fri Nov 24, 2017 18:01
GitHub: Mikola314
In-game: mikola

Re: [Mod] Tunnelmaker [tunnelmaker]

by Mikola » Post

kestral, I redid this mod for myself and added some useful features.
https://github.com/Mikola314/tunnelmake ... ster-1.X.X
You can read and express your opinion: whether you want to deal with it or not.

At the moment, the README.md and LICENSE.txt has not been corrected.
There is a problem with licenses.
I used part of the code from the mod Xray viewtopic.php?id=3191. This mod uses a GPLv3 license and when using this mod, the final project must also use a GPLv3 license.
Last edited by Mikola on Thu Feb 07, 2019 12:04, edited 1 time in total.

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Post

Mikola, I've downloaded your version and have started to look at it, but wow, you've really done a lot.

I'm definitely going to take a close look at all your changes, but it's going to take some time.

Mikola
Member
Posts: 16
Joined: Fri Nov 24, 2017 18:01
GitHub: Mikola314
In-game: mikola

Re: [Mod] Tunnelmaker [tunnelmaker]

by Mikola » Post

I believe that the next step is to learn how to store the values of variables individually for each user in players.sqlite. This will allow you to quickly change the modes of operation of the mod and will remove the need to restart the server when changing the values of variables. Perhaps this should be done after the release minetest 5.0.

I hope that in the future it will be possible to make game trains from this mod, capable of creating embankments and bridges, creating tunnels and laying the railway.

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Post

Mikola, I've incorporated your version with changes in the experimental branch of my github repo. Take a look and see what you think, but note that it's still a work in progress.

For others, know that tunnelmaker 2.0 is in the works, with many new features on the way. Stay tuned for more news.

kestral
Member
Posts: 95
Joined: Mon Mar 27, 2017 21:56
GitHub: kestral246

Re: [Mod] Tunnelmaker [tunnelmaker]

by kestral » Post

Tunnelmaker 2.0 Beta, has now been merged into master branch.

Details moved to first post.
Last edited by kestral on Thu Mar 07, 2019 23:26, edited 2 times in total.

Mikola
Member
Posts: 16
Joined: Fri Nov 24, 2017 18:01
GitHub: Mikola314
In-game: mikola

Re: [Mod] Tunnelmaker [tunnelmaker]

by Mikola » Post

kestral, I am glad that my work and ideas were useful to you.
I am also glad that you managed to realize saving the tunnelmaker settings separately for each player using the invocation of the settings menu. This will greatly facilitate teamwork.

Are you planning major changes in the branch "beta" in the near future?

Is planned to be used Version 2.0 only with minetest 5.0 and higher?
What do you think about adding localization for players from different countries? I added the ability to translate and translate into Russian for Version 2.0-beta-7 - 2019-01-26 with the new function minetest.get_translator(), but it will only work with minetest 5.0 and higher.
If you are interested in it, I will add a Pull request.

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests