Page 1 of 1
Multiple nodes at the same position

Posted:
Wed Jul 10, 2013 10:34
by MirceaKitsune
I know the answer is probably no since this would require big engine changes. But would it be possible to someday allow multiple nodes at the same position for special types of nodes? This would be useful to place objects made out of multiple pieces in the same spot for instance (eg: flower pots and flowers but both as separate nodes), or naturally hide objects in dirt blocks which you'd have to dig to see first (possibly small nodebox items). This would also fix the "water hole over slabs / stairs" issue since you could have slabs and stairs in the same place as a water node.
This would however require huge changes which I doubt people will make. First of all the world database might need updating, to allow multiple node definitions at one location. Then many Lua functions like minetest.get_node(pos) would need to know which node they return for at that location. Rendering, digging, collisions and selection boxes would also need to account the proper node, so you can see / mine any you are looking at.
Is the idea possible to any extent? Would anyone else find it useful also?

Posted:
Wed Jul 10, 2013 12:29
by webdesigner97
Well, I think it's not possible without nodeboxes bigger than 1 node. But this would be useful for water flowing through fences and open doors.... But I don't think we should implement that...

Posted:
Wed Jul 10, 2013 13:13
by Mossmanikin
I've no idea how to do it. But I think it would be possible if the selectionboxes of the two nodes have a different size and/or they can only be selected by different tools.
I definitely would find it useful for
webdesigner97 wrote:water flowing through fences

Posted:
Wed Jul 10, 2013 14:28
by MirceaKitsune
webdesigner97 wrote:Well, I think it's not possible without nodeboxes bigger than 1 node. But this would be useful for water flowing through fences and open doors.... But I don't think we should implement that...
It would solve a lot of water issues yes. Water could flow through fences and gates, while fences could be placed underwater without causing holes.
Mossmanikin wrote:I've no idea how to do it. But I think it would be possible if the selectionboxes of the two nodes have a different size and/or they can only be selected by different tools.
That's the idea I had in mind yes. If two different nodebox objects are in the same spot, the one who's nodeboxes you're looking at is highlighted and selected by view. If you mine then that's the one you will be mining.

Posted:
Wed Jul 10, 2013 15:21
by sfan5
IMO this would be too much work and solve too little issues

Posted:
Mon Jul 15, 2013 10:37
by MirceaKitsune
I found other reasons why this feature would be very useful to add:
One is allowing snow to cover flowers and dirt. You know how when it snows in cold biomes, snow slabs also appear at the surface (or at least that's an obvious intended feature). In Minecraft, snow cannot cover grass and flowers, so they leave a gap. This feature would prevent that, and we wouldn't have to either leave snow gaps where flowers exist or remove flowers to place snow blocks.
Speaking of flowers, this would also allow having flowers and grass in the same spot. Oh... and why not have apples spawn INSIDE leaf nodes? What about being able to place items inside glass blocks... for instance to expose an apple inside a glass case?
Another use is allowing materials with an 'absorption' property to not remove liquids when placed and dug out. So for example: If you'd place dirt in water then dig the dirt out, the water block would still be there intact... but if you'd place stone it would replace the water block. Of course this can easily be done with a script, but this would be a more accurate way.
Anyway, I agree that this would be much work, but not that it would solve too little issues.

Posted:
Mon Jul 15, 2013 12:29
by Zeg9
I have an idea which could solve most of the issues: a special meta string, which would contain the name of a secondary node.
This way nothing much important would be changed in the engine (at least, in the map database), and it would allow having 2 nodes in the same place.

Posted:
Mon Jul 15, 2013 13:54
by Calinou
MirceaKitsune wrote:Oh... and why not have apples spawn INSIDE leaf nodes? What about being able to place items inside glass blocks... for instance to expose an apple inside a glass case?
It would be easy to make a default:leaves_with_apple node that drops an apple and a leaf block when dug.