New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add drawtype sunken and covered #14103
base: master
Are you sure you want to change the base?
Conversation
I don't think those new drawtypes are particularly bad, but it would be good to have a discussion first, how useful they are and some use cases. |
I know about planlike_rooted, but how it can be used to do sunken two-node height doors on shipwrecks for example? Doors typically included the main node and the invisible node above. And what about the sunken trap door? Or can be special_tiles used to show, particularly covered nodes? I have to add more examples. :) |
@cx384 So I have added a new screenshot to show how it works with testnodes:nodebox_fixed node. |
I'm still not very convinced. Or add the possibility for node boxes to use special_tiles instead of the For liquids your PR may be able to fix #3074. |
@cx384 It can be an interesting update for nodebox nodes. Some solution like it comes to my mind too. But I think this solution is more flexible. I only include "link" to another node a draw two nodes in one position. I think you can't do this with nodebox at all: (it is all "testnodes:covered_mesth_node") So, you can use it with mesh, plant, nodebox, torchlike, etc nodes. And probably whatever type of node that will be added in the future. |
just popping in to say |
A use case I can think of is a sapling covered in snow. |
unless im misunderstanding something here, to do this currently you would have to make #levels meshes/nodes (cutting into the 32k limit) currently since the covered type means the height updates with param2 |
This is extremely useful, if it solves the problem it claims to - doors and other items creating air pockets in Mesecraft is very annoying and also buggy- its possible to breathe underwater for as long as you like by placing some node that creates an airpocket (like a slab). A conceptual issue is, will this allow sunken nodes to be mesh or nodebox drawtypes? |
If I understand correctly, you could superimpose any node? You could just have two superimposed water nodes for example? Do you have to register a different node for it to be sunken in different other nodes? door in water, door in river water, door in lava And I assume lava would have to check for water and the sunken drawtype to work again, right? If the node is sunken in lava, I'm assuming the lava ABM would not be used, right? Which means every node that could be sunken in lava would need an ABM that checks if it is currently sunken in lava (or any other liquid with an ABM), and trigger that ABM if so. |
@wsor4035 Yes, I think you get it. |
@MisterE123 Yes, it is a target for sunken drawtype. |
Yes, this solution can be applied to any other registered node.
You can apply it to another liquid node as well, but you have to keep in mind, that it is only a rendering feature. So any special logic for mixed liquid nodes will have to be scripted. For the server only properties of the parent node are relevant.
Yes, you have to register a node for every possible combination of sunken node and liquid. I am working with two solutions in my mind.
I think this is solved by lava ABM looking for nodes in
It depends on ABM's definition. If ABM works only for node default:lava_soruce for example, it will not work. If ABM is defined to work for all nodes in group |
Commit e73b190 fix liquid source replacing iwth alternative liquid source. This is also related to problem mentioned here minetest-mods/wielded_light#4 by @bell07. So if this will be merged, wielded_light mod liquid sources can be updated to be better integrated. This also allows sunken node to generate flowing liquid of the wanted type. This can be also used in wielded_light. |
could this be used for waterlogged nodes ? , if so is it possible to have a filter for where to cover a node (so we could waterlog only 1 side of glass pane for instance) |
Liquid nodes are rendered as solid nodes by the engine. So, it means that you can use different texture for each side and the node should be rotable with param2. It will be a good idea to set |
So, this PR is related to a "Supported by core dev" issue, but
For the aforementioned reasons, I'll leave the choice about what to do with this PR to core devs in the next meeting => https://dev.minetest.net/Meetings#2024-01-21 |
It's quite hard to judge if I support this if there's no detailed description of what this actually does. Doc draft needed. |
@Desour I added some info to If you have any additional questions, feel free to ask. |
Ah, I see now. So for sunken nodes, you need to register a new node for each liquid x inner node pair. And this doesn't work if the inner node needs param2, I suppose? It's obviously an imperfect solution. Idk if it is better than nothing. The covered drawtype with level looks interesting to me for dust covered plants (like the snow sapling mentioned before). => I'm unsure and will wait for more opinions first. |
In the actual implementation of the covered draw type I use Because param1 is needed for light, the only different way how to implement it is probably to use metadata. However, using metadata for rendering maps does not sound like a great idea because of its performance. On the opposite side, with metadata, If it is requested, I will make the same changes to do it in the preferred way. |
New ideas in my mind about using param2 and field inner_node: It can be determined by And it will not be probably complicated to implement some loaded metadata cache based on |
Discussed in the meeting: https://irc.minetest.net/minetest-dev/2024-01-21#i_6147292
If there are any questions, please reach out. |
…xed nodebox variant as example.
…cations in content_mapblock.cpp.
8c2a377
to
6e05c81
Compare
…or covered/sunken nodes.
The new version removed the need for node pair registration for visual purposes. Inner nodes are now defined by metadata fields Would be nice if someone checked if this solution looks acceptable. @SmallJoker I am not sure about |
@SmallJoker reminder |
@sfence Getting a decent underwater appearance would then be pretty trivial for mods to enable. One nodedef field. |
@SmallJoker |
What version of devtest is this? |
This is an unmerged branch without the core developer's support. But at the moment, it looks like it will not be supported and merged. |
IMHO, this whole thing should be a part of a more generic multipart-like API |
Maybe, something like #13811 can be used for your idea, after some extension. |
Add new drawtypes sunken and covered.
To do
This PR is a Work in Progress.
How to test
Run game devtest and place added test nodes testnodes: testnodes:sunken_torchlike, testnodes:sunken_nodebox, testnodes:sunken_mesh, testnodes:covered_torchlike_node, testnodes:covered_nodebox_node and/or testnodes:covered_meshnode.
You can change param2 of testnodes:covered_torchlike to simulate the uncovering process.