texmex wrote:I think find_node_near can be replaced with something faster since it’s fewer checks to do but maybe I’m wrong.
My intuition was that
find_node_near is a native function, so it had to be faster that Lua script (even with JIT).
But you were actually not incorrect. It is a matter of +15% CPU usage versus +20% CPU usage (near some lava lake) in favor of the
find_node_near version, but the "manual" version also randomizes a bit the movements of the smoke (
find_node_near always do the checks in the same order, so sometimes you see semi-trapped nodes oscillate between two positions, which is not really smok-y).
I strongly suspect the ABM to be the source of your performance woes. If so, a lite node def injection hackyness is worth it imo. Compare to the unlagginess of oilbois fire in his alpha game.
It's not really
woes, more like worries.
The source ABM is innocent, the CPU activity mainly varies with the number of smoke nodes (timers only).
Anyway, I plan to split the mod into two: an API that moves the smoke and depends on nothing but
default and a basic usage mod that will use ABMs for smoke sources. It will be up to whoever is interested in adding smoke sources (torches, for instance) to either add it to the basic mod's ABM (or this ABM could use a specific group) or to go the optimal route.
I’ve long thought about ”rising” nodes, opposed to the falling ones. My usecase was for making buoyant nodes, but it’d fit this one too.
Yes, I have noticed that smoke nodes did look like air bubbles in a way. Not surprising, Archimedes' force is at play in both cases. I think it is more or less a matter of changing "air" to "default:water_source", although there are six different liquid types in
default (maybe use "group:liquid", but it would a bit more problematic in the next version).
Maybe smoke can use such a mechanism of switching between being represented by a node and an entity?
Falling nodes stabilize into normal nodes relatively quickly, this is not the case for smoke nodes. A wildfire would create hundreds of entities; I think it could set the PC itself on fire.
Also, try the glasslike drawtype as ”Only external sides of textures are visible.” it can help with forming a more unified smoke cloud, and also look better when/if it get animated textures.
Yes, thanks for pointing that out; also I have noticed a glitch happens when the smoke is next to another liquid node (something to do with backface culling). You really see it only if you disable "waving water".