Page 1 of 1

[Mod] Pontoons for construction on liquid [0.5] [pontoons]

PostPosted: Sun Feb 12, 2017 20:27
by FaceDeer
Image

This mod adds some simple building blocks that can be placed on top of liquid, making it easier to construct things on a body of water without needing to first build a piling from the ground underneath. There are both wood pontoons and steel pontoons (for building your floating lava-castle on).

It also allows existing wood and tree blocks to have this property added to them. Since a wood block is equivalent to a wood pontoon, wood pontoons are disabled by default. See the mod's settings under "advanced settings" for enabling wood pontoons.

Links


Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Sun Feb 12, 2017 20:31
by octacian
Nice idea! Screenshot?

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Sun Feb 12, 2017 20:43
by FaceDeer
octacian wrote:Nice idea! Screenshot?


Slipped my mind, got one up now.

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Sun Feb 12, 2017 21:03
by Chibi ghost
interesting idea

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Mon Feb 13, 2017 10:06
by texmex
Hey FaceDeer, great to see this came into being!

I like how you didn't go with any leather dependancy and stuck to default blocks. Also great that you diversified it for lava use as well, didn't even think of that!

The mod should be considered for inclusion in mt_game when it's finished as it opens up richer gameplay at sea, in combination with the water bubble bug hopefully becoming solved.

Is the 1.0 milestone the same as the "enforce buoyancy" feature?

Kudos!

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Mon Feb 13, 2017 18:39
by azekill_DIABLO
it's a must for building a floting city

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Mon Feb 13, 2017 18:54
by FaceDeer
texmex wrote:Hey FaceDeer, great to see this came into being!


No problem. Initially I was kind of at a loss for how to make this work, but then I had a head-slap moment: buckets can be used on water blocks, I could just look at how those do it. Turns out it's really simple. :) The bulk of this mod's work is just overriding all the node definitions belonging to "wood" and "tree" groups to add "liquids_pointable = true" to them. The specialized pontoon blocks are almost superfluous after doing that (aside from the lava-proof one, of course)

Note that this mod should work for any other wood and tree group blocks as well, just add them to the dependencies.txt to ensure that they get loaded before this mod does (otherwise it won't have the opportunity to override them). I added [moretrees], but didn't go on an extensive search looking for other tree-related mods so if anyone knows of some they'd like this mod to support just let me know.

texmex wrote:Is the 1.0 milestone the same as the "enforce buoyancy" feature?


If you mean the thing we talked about in PM about pontoons rising to the surface and dragging the stuff built on them up with them, it's probably going to be a while before I get to it. Moving arrays of nodes around is hard work and for Minetest it'll be a bit of an edge case since water is normally pretty static (though I've done what I can to fix that :)). I mainly just called this version 0.5 because since it's the initial commit I'm sure there are plenty of unknown bugs and minor missing features that people are going to tell me about now that it's posted.

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Tue Feb 14, 2017 09:55
by texmex
FaceDeer wrote:No problem. Initially I was kind of at a loss for how to make this work, but then I had a head-slap moment: buckets can be used on water blocks, I could just look at how those do it. Turns out it's really simple. :) The bulk of this mod's work is just overriding all the node definitions belonging to "wood" and "tree" groups to add "liquids_pointable = true" to them. The specialized pontoon blocks are almost superfluous after doing that (aside from the lava-proof one, of course)

I feel bad for not pointing that out now, because I noticed the special treatment of buckets, boats and such in relation to liquids really early on. Sorry! :)

FaceDeer wrote:If you mean the thing we talked about in PM about pontoons rising to the surface and dragging the stuff built on them up with them, it's probably going to be a while before I get to it. Moving arrays of nodes around is hard work and for Minetest it'll be a bit of an edge case since water is normally pretty static (though I've done what I can to fix that :)). I mainly just called this version 0.5 because since it's the initial commit I'm sure there are plenty of unknown bugs and minor missing features that people are going to tell me about now that it's posted.

Actually I wouldn't dare to dream that big for Minetest. My aim was the first step really, that the buoyant block rises to the surface if placed underwater with nothing other than water above it.

If another solid block is placed above half way to the surface it and then removed the realistic thing for it to do would be to continue to rise, but I know for that to happen a whole other taxing piece of code needs to run so that part is not justified in my opinion.

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Wed Feb 15, 2017 00:09
by FaceDeer
texmex wrote:Actually I wouldn't dare to dream that big for Minetest. My aim was the first step really, that the buoyant block rises to the surface if placed underwater with nothing other than water above it.

If another solid block is placed above half way to the surface it and then removed the realistic thing for it to do would be to continue to rise, but I know for that to happen a whole other taxing piece of code needs to run so that part is not justified in my opinion.


Oh, that. :) Yeah, that part isn't hard. I'll look into setting that up tonight. I'll probably want that behaviour to be pontoon-specific rather than applying to wood or trees, though, in case people want to build pilings or ocean-bottom wooden structures.

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Wed Feb 15, 2017 00:40
by texmex
FaceDeer wrote:Oh, that. :) Yeah, that part isn't hard. I'll look into setting that up tonight. I'll probably want that behaviour to be pontoon-specific rather than applying to wood or trees, though, in case people want to build pilings or ocean-bottom wooden structures.

Yes, only for poontoons, or people will have to build bottom-up :)

I've noticed that falling nodes falls smoothly and not in block-sized steps. It would be so cool if this could be reversed for floatables, but I'm going to guess that's a hardcoded engine feature specifically written for falling blocks. Anyway, a non-smooth movement is fine too of course.

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Wed Feb 15, 2017 00:43
by texmex
Just had another of those ideas… Wouldn't it add to the experience to include hollow-sounding punch sounds in the mod? One for wood, another one for metal?

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Wed Feb 15, 2017 00:52
by FaceDeer
texmex wrote:I've noticed that falling nodes falls smoothly and not in block-sized steps. It would be so cool if this could be reversed for floatables, but I'm going to guess that's a hardcoded engine feature specifically written for falling blocks. Anyway, a non-smooth movement is fine too of course.


Actually, it's not hard-coded. Falling blocks turn themselves into entities, which move smoothly and then turn back into nodes again once they hit ground. I've never done the coding for that myself but I remember looking over some of it and it seemed simple enough, at least for nodes that don't have fancy metadata or inventories to worry about.

Before you ask, redoing Digtron to use entities like that would be rather a lot more complicated. :) There are a few mods I've seen out there that allow groups of nodes to move by fusing them together into one big entity, but the resulting object isn't capable of complex operations. It's just a big inert monolithic thing that looks like it's made out of a bunch of nodes.

I'll look into something like that for pontoons, though. If it works like I think it should the pontoon block would not actually be *built* when you tried placing it underwater, it would just spawn an entity that would move upward until it hit surface or obstruction and turned into the node at that spot.

As for sounds, I just grabbed the wood and metal defaults as an expeditious way to get the mod rolled out. If you know of a good freely-licensed hollow thud sound I could swap that in.

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Wed Feb 15, 2017 01:07
by texmex
FaceDeer wrote:Actually, it's not hard-coded. Falling blocks turn themselves into entities, which move smoothly and then turn back into nodes again once they hit ground. I've never done the coding for that myself but I remember looking over some of it and it seemed simple enough, at least for nodes that don't have fancy metadata or inventories to worry about.

That is good news then! Sweet…

FaceDeer wrote:Before you ask, redoing Digtron to use entities like that would be rather a lot more complicated. :) There are a few mods I've seen out there that allow groups of nodes to move by fusing them together into one big entity, but the resulting object isn't capable of complex operations. It's just a big inert monolithic thing that looks like it's made out of a bunch of nodes.

Wouldn't dream of it :D Mainly because the nature of that masterpiece of a beast is and should be jerky. I've also tried the meshnode mod, it seems… hacky.

FaceDeer wrote:I'll look into something like that for pontoons, though. If it works like I think it should the pontoon block would not actually be *built* when you tried placing it underwater, it would just spawn an entity that would move upward until it hit surface or obstruction and turned into the node at that spot.

That will be 100% fulfilling of that particular idea for me.

FaceDeer wrote:As for sounds, I just grabbed the wood and metal defaults as an expeditious way to get the mod rolled out. If you know of a good freely-licensed hollow thud sound I could swap that in.

I can look for it, or experiment with those sounds and audio filters. Would be cool to build upon the default ones.

Enforcing buoyancy

PostPosted: Sun Mar 05, 2017 15:47
by texmex
Hey FaceDeer! I've tried the falling_extras mod and it could contain valuable code for forcing pontoons to float to the surface on placement.

I managed to create negative gravity with the mod simply by modifying this line as Wuzzy suggested was possible.

Here's how it behaved when gravity was negated.
+ Spoiler

Re: Enforcing buoyancy

PostPosted: Sun Mar 05, 2017 17:07
by TumeniNodes
texmex wrote:Hey FaceDeer! I've tried the falling_extras mod and it could contain valuable code for forcing pontoons to float to the surface on placement.

I managed to create negative gravity with the mod simply by modifying this line as Wuzzy suggested was possible.

Here's how it behaved when gravity was negated.
+ Spoiler


heh..., purty cool! Falling In Reverse :P

Re: [Mod] Pontoons for construction on liquid [0.5] [pontoon

PostPosted: Wed Mar 08, 2017 15:35
by azekill_DIABLO
so cool!