User:Numzero/NodeEntity

From Minetest Wiki
Jump to navigation Jump to search
This is a personal opinion

This is my imagination of how things should work™.

Node should be just an entry in a node array, containing as little information as possible.

Metadata would be obsolete.

Node entity is the key concept. It should be as lightweight as possible, but only as possible retaining all the necessary customization options. It would represent any non-plain object that is currently represented by a node, or a set of different nodes replacing each other all the time (like active and inactive furnace).

Node entity has no velocity, position or other physical properties: it is strictly bound to the parent node. It should behave more like node than entity. But it should support some flexibility of the entity: custom mesh, custom textures that may be changed at any time (remember signs and their SAOs). It would also keep all the extended state now known as metadata, node timers, etc.

Being an entity, node entity may be present in any node; most likely in air but possibly in water, lava or even something solid. When anything happens to the node, it should inform the entity (similar to the current callback mechanism) that should be able to cancel most actions. Actually this may make callbacks on the node itself no more necessary. Ideally, there should be a possibility of controlling more than one node but that seems a bit too complicated. On the other hand, that’s what e.g. doors and beds could use.

Problem: fences in water (or in sand)... NodeEntity seems to be a bit of overkill for a mere fence... (more than for a plant as plants can grow or spread at least)