Skip to content

LBMs are not performed reliably for generated but never activated blocks #15902

@ryvnf

Description

@ryvnf

Luanti version

Luanti 5.12.0-dev-4b85062ca (Linux)
Using LuaJIT 2.1.0-beta3
Built by GCC 12.2
Running on Linux/6.1.0 x86_64
BUILD_TYPE=Release
RUN_IN_PLACE=0
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
STATIC_SHAREDIR="/usr/local/share/luanti"
STATIC_LOCALEDIR="/usr/local/share/locale"

Operating system and version

Debian

CPU model

No response

GPU model

No response

Active renderer

No response

Summary

LBMs are not being triggered reliably.

In Mineclonia I have made a branch that changes paramtype2 of grass to color4dir with random rotation to make the terrain look more natural (no repeated "grid" patterns). In order to convert old mapblocks I made an LBM to migrate the palette index from color (used for grass previously) to color4dir along with adding a random rotations.

I did however notice that the LBM is not reliably triggered for all mapblocks. Some mapblocks are clearly not updated, which becomes noticeable due to them having a different color and no random rotation.

I am pretty sure this is a Luanti bug considering the LBM is pretty simple:

-- Rotate old biomecolor4dir nodes
minetest.register_lbm({
	label = "Rotate old biomecolor4dir nodes",
	name = "mcl_core:rotate_old_biomecolor4dir",
	nodenames = {"group:biomecolor4dir"},
	action = function(pos, node)
		node.param2 = mcl_util.get_pos_biomecolor4dir(pos)
		minetest.swap_node(pos, node)
	end,
})

Steps to reproduce

  1. Clone the Mineclonia repo to the games directory in Luanti
    • git clone https://codeberg.org/mineclonia/mineclonia/ ~/.minetest/games/mineclonia-test
  2. Create a world with mapgen "flat" and world seed test
  3. Join the world on the main branch, let it generate some terrain
  4. Exit world, do git checkout biomecolor4dir
  5. Join world again
  6. Notice that the LBM converts mapblocks but leaves some mapblocks completely unaffected (see screenshot)
    Image

I can reproduce this both when using action and bulk_action for the LBM.

Note that the biomecolor4dir branch is destructive to Mineclonia worlds, so you probably want to delete the cloned repo or switch back to main to avoid accidentally triggering the LBM on a non-testing world.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions