Cut off desert temple #993

Closed
opened 2021-01-20 15:52:09 +01:00 by LizzyFleckenstein03 · 19 comments
LizzyFleckenstein03 added the
bug
label 2021-01-20 16:13:26 +01:00
Member

bug confirmed, pyramid spawning isn't good. I once had 3 pyramids that "grew" into each other. In addition, the light level in the cut pyramids remains like a closed one

bug confirmed, pyramid spawning isn't good. I once had 3 pyramids that "grew" into each other. In addition, the light level in the cut pyramids remains like a closed one
LizzyFleckenstein03 added the
mapgen
label 2021-01-20 16:49:26 +01:00
Contributor

Wow, I didn't know there were structures in MC2. I explored quite a bit, but I found no temples, huts, or anything else. Are they supposed to be so rare? In Minecraft it's not unusual to find desert temples.

Wow, I didn't know there were structures in MC2. I explored quite a bit, but I found no temples, huts, or anything else. Are they supposed to be so rare? In Minecraft it's not unusual to find desert temples.
Member

I often test and play mineclone2 in survival and I actually always find at least 2 desert temples per desert. Besides, I've already found igloos in survival. They are not uncommon. I just found a strange desert temple that stood on a 10-block high platform. Is that normal?

I often test and play mineclone2 in survival and I actually always find at least 2 desert temples per desert. Besides, I've already found igloos in survival. They are not uncommon. I just found a strange desert temple that stood on a 10-block high platform. Is that normal?
Contributor

I can (hopefully) fix this by the way I already fixed strongholds:
4c2e28836c
But I have no idea what's wrong with mapgen!

I can (hopefully) fix this by the way I already fixed strongholds: https://git.minetest.land/Wuzzy/MineClone2/commit/4c2e28836cd94cd2f56544bec7fc7d8dce3df01d But I have no idea what's wrong with mapgen!
kay27 closed this issue 2021-01-22 15:35:44 +01:00
Contributor

A few days ago I managed to find two temples in the same desert, and this is one of them:

Desert temple severely cut

A few days ago I managed to find two temples in the same desert, and this is one of them: ![Desert temple severely cut](https://i.imgur.com/N6ZwbDL.jpg)
Author
Member

It happened to me again as well

It happened to me again as well
Contributor

A few days ago I managed to find two temples in the same desert, and this is one of them:

Why do you think it's a desert temple?

@EliasFleckenstein03 wrong biome?! :) wouldn't you please share seed number and coordinates?

> A few days ago I managed to find two temples in the same desert, and this is one of them: Why do you think it's a desert temple? @EliasFleckenstein03 wrong biome?! :) wouldn't you please share seed number and coordinates?
Contributor

A few days ago I managed to find two temples in the same desert, and this is one of them:

Why do you think it's a desert temple?

I didn't mean that to sound like it was a bug to find two temples in the same desert. In over a year of playing MC2 I never found one and I assumed they weren't implemented. :) And now that I finally found a temple, go figure - I found another one in the same desert. :))

> > A few days ago I managed to find two temples in the same desert, and this is one of them: > > Why do you think it's a desert temple? I didn't mean that to sound like it was a bug to find two temples in the same desert. In over a year of playing MC2 I never found one and I assumed they weren't implemented. :) And now that I finally found a temple, go figure - I found another one in the same desert. :))
Contributor

Yep, I couldn't push that commit, that's why it still happen to you and doesn't happen to me.
If a someone has egough privileges please cherry-pick and push it: 4c2e28836c
I've halfly rewritten it locally but this work still needs testing, while the commit mentioned above tested really well, has minor performance issues but all structures exist where they supposed to be

Yep, I couldn't push that commit, that's why it still happen to you and doesn't happen to me. If a someone has egough privileges please cherry-pick and push it: https://git.minetest.land/Wuzzy/MineClone2/commit/4c2e28836cd94cd2f56544bec7fc7d8dce3df01d I've halfly rewritten it locally but this work still needs testing, while the commit mentioned above tested really well, has minor performance issues but all structures exist where they supposed to be
Contributor

I've done and learnt many things about on_generated but actually not sure what to do.
Firstly all went fine, I thought I had found a way to get_far_node(pos), it was terrible but worked for me and I even tested it with villages but then found error in the code, LOL

local get_node_emerge_queue = {}
local function ecb_get_far_node(blockpos, action, calls_remaining, param)
	if calls_remaining <= 0 and param then
		get_node_emerge_queue[param] = nil
	end
end

function mcl_util.get_far_node(pos, force)
	local node = minetest.get_node(pos)
	if node.name ~= "ignore" then
		return node
	end

	minetest.get_voxel_manip():read_from_map(pos, pos)
	node = minetest.get_node(pos)
	if node.name ~= "ignore" or not force then
		return node
	end

	local blockpos = vector.multiply(vector.floor(vector.divide(pos, mcl_vars.MAP_BLOCKSIZE)), mcl_vars.MAP_BLOCKSIZE)
	local key = minetest.pos_to_string(blockpos)

	for i=1,2 do -- give engine 2 chances to emerge the data
		if not get_node_emerge_queue[key] then
			get_node_emerge_queue[key] = minetest.get_us_time()
			minetest.emerge_area(blockpos, vector.add(blockpos, mcl_vars.MAP_BLOCKSIZE-1), ecb_get_far_node, key)
		end

		while minetest.get_us_time() - (get_node_emerge_queue[key] or 0) < 2000 do end
		
		node = minetest.get_node(pos)
		if node.name ~= "ignore" then
			return node
		end

		minetest.get_voxel_manip():read_from_map(pos, pos)
		node = minetest.get_node(pos)
		if node.name ~= "ignore" or not force then
			return node
		end
	end

	node.name = "air" -- engine continuously returns "ignore" - probably it is a bug
	minetest.swap_node(pos, node) -- engine continuously returns "ignore" - probably it is a bug
	return node -- engine continuously returns "ignore" - probably it is a bug
end

I think it's a garbage now, though it is really the first function which can force engine to stop returning annoying "ignore" nodes even if we read voxels, emerge, wait, etc... but villages mod uses really lot of read operations, so we would wait several game years without any success...

But before I found the error I posted this function as an update to minetest issue https://github.com/minetest/minetest/issues/8232 , then explored the subject and created several tests like that:

minetest.register_on_generated(function(minp, maxp, blockseed)
	local nodes = minetest.find_nodes_in_area(minp, maxp, "ignore")
	if #nodes > 0 then
		minetest.chat_send_all("block "..minetest.pos_to_string(minp).."-"..minetest.pos_to_string(maxp).." : ignore - "..tostring(#nodes) .. "node(s)")
	end
end)

which continuously prints something like that:
image
and according the docs it's probably wrong, but I still can't be 100% sure the problem isn't in MineClone 2 itself.

There were too many on_generated callbacks registered. So I've organized them in a queue. And still no success.

When we try to manipulate voxels in these callbacks to build dungeons and strongholds, they often just overwrite by stones. When we set nodes - seems it's fine. But voxels supposed to be processed faster. So at least if I can fix the schematics - it will cause slowing down generation speed....

OMG, so many text so little value... I need more information, probably I will push generation queue but before doing that I'm planning to think twice.

Thanks for reading

I've done and learnt many things about on_generated but actually not sure what to do. Firstly all went fine, I thought I had found a way to ```get_far_node(pos)```, it was terrible but worked for me and I even tested it with villages but then found error in the code, LOL ```lua local get_node_emerge_queue = {} local function ecb_get_far_node(blockpos, action, calls_remaining, param) if calls_remaining <= 0 and param then get_node_emerge_queue[param] = nil end end function mcl_util.get_far_node(pos, force) local node = minetest.get_node(pos) if node.name ~= "ignore" then return node end minetest.get_voxel_manip():read_from_map(pos, pos) node = minetest.get_node(pos) if node.name ~= "ignore" or not force then return node end local blockpos = vector.multiply(vector.floor(vector.divide(pos, mcl_vars.MAP_BLOCKSIZE)), mcl_vars.MAP_BLOCKSIZE) local key = minetest.pos_to_string(blockpos) for i=1,2 do -- give engine 2 chances to emerge the data if not get_node_emerge_queue[key] then get_node_emerge_queue[key] = minetest.get_us_time() minetest.emerge_area(blockpos, vector.add(blockpos, mcl_vars.MAP_BLOCKSIZE-1), ecb_get_far_node, key) end while minetest.get_us_time() - (get_node_emerge_queue[key] or 0) < 2000 do end node = minetest.get_node(pos) if node.name ~= "ignore" then return node end minetest.get_voxel_manip():read_from_map(pos, pos) node = minetest.get_node(pos) if node.name ~= "ignore" or not force then return node end end node.name = "air" -- engine continuously returns "ignore" - probably it is a bug minetest.swap_node(pos, node) -- engine continuously returns "ignore" - probably it is a bug return node -- engine continuously returns "ignore" - probably it is a bug end ``` I think it's a garbage now, though it is really the first function which can force engine to stop returning annoying "ignore" nodes even if we read voxels, emerge, wait, etc... but villages mod uses really lot of read operations, so we would wait several game years without any success... But before I found the error I posted this function as an update to minetest issue https://github.com/minetest/minetest/issues/8232 , then explored the subject and created several tests like that: ```lua minetest.register_on_generated(function(minp, maxp, blockseed) local nodes = minetest.find_nodes_in_area(minp, maxp, "ignore") if #nodes > 0 then minetest.chat_send_all("block "..minetest.pos_to_string(minp).."-"..minetest.pos_to_string(maxp).." : ignore - "..tostring(#nodes) .. "node(s)") end end) ``` which continuously prints something like that: ![image](/attachments/aee9d9f9-1c77-4e4e-a439-d43c28cd1be7) and according the docs it's probably wrong, but I still can't be 100% sure the problem isn't in MineClone 2 itself. There were too many on_generated callbacks registered. So I've organized them in a queue. And still no success. When we try to manipulate voxels in these callbacks to build dungeons and strongholds, they often just overwrite by stones. When we set nodes - seems it's fine. But voxels supposed to be processed faster. So at least if I can fix the schematics - it will cause slowing down generation speed.... OMG, so many text so little value... I need more information, probably I will push generation queue but before doing that I'm planning to think twice. Thanks for reading
Contributor

Should that be in End dimension under the islands or it's just my new bug?
изображение

Should that be in End dimension under the islands or it's just my new bug? ![изображение](/attachments/8f10c5f4-69bc-48fa-a846-e5a8569668e5)
Author
Member

It's not a new bug.

It's not a _new_ bug.
Contributor

Really?.. I hadn't seen before. I was sure v6 mapgen works better but I didn't think 'better' is:

изображение

I just tried to shrink area sizes to chunk boundaries and turned off some hacks :) before that I hadn't seen this, only seen the cuts, what's the issue about, but cuts don't fix by these changes, at all.

Locally I've found that when I remove ground_content flag it turns off endless engine map generation, but suitable nor for all cases

Really?.. I hadn't seen before. I was sure v6 mapgen works better but I didn't think 'better' is: ![изображение](/attachments/16faccf6-9420-4ccc-a69e-0d902799e8ee) I just tried to shrink area sizes to chunk boundaries and turned off some hacks :) before that I hadn't seen this, only seen the cuts, what's the issue about, but cuts don't fix by these changes, at all. Locally I've found that when I remove ground_content flag it turns off endless engine map generation, but suitable nor for all cases
Contributor

I've fixed it locally, debugging now.
What do you think, is it okay (screenshot)?
image

I've fixed it locally, debugging now. What do you think, is it okay (screenshot)? ![image](/attachments/0cdc4819-5a6e-475b-8f27-c7a0b53e6c15)
624 KiB
Contributor

It looks great, from up here. :P Can the cacti be removed from the temple's body? They're only supposed to grow on sand, and the temples are made out of sandstone. That's the only thing looking unusual.

It looks great, from up here. :P Can the cacti be removed from the temple's body? They're only supposed to grow on sand, and the temples are made out of sandstone. That's the only thing looking unusual.
Contributor

hope i've trimmed leftovers of cacti, thanks
изображение

but this screen was made with increased frequency of spawning desert temples...
with normal one there will be no temples at all, so sad:
изображение

i willing to push latest changes to master branch but experience merging problems :) and the result of my war with mapgen are some weird holes near the villages, which I should remove still, hope I'll find a way

изображение

hope i've trimmed leftovers of cacti, thanks ![изображение](/attachments/fafea3df-34f4-4b11-b102-0cc003ff81df) but this screen was made with increased frequency of spawning desert temples... with normal one there will be no temples at all, so sad: ![изображение](/attachments/b089219a-1af2-4a99-9d9c-812dc172f88d) i willing to push latest changes to master branch but experience merging problems :) and the result of my war with mapgen are some weird holes near the villages, which I should remove still, hope I'll find a way ![изображение](/attachments/ae915857-e253-43f7-9d5a-a9a296e5ece9)
Contributor

The problem is - map generation is slow itself. We should place structures, callback fires as if we really can do that! But still lots of 'ignore' nodes in chunk:

2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (187,160,34), blockpos=(176,160,32) - replacing to air 4096 node(s)
2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (187,176,34), blockpos=(176,176,32) - replacing to air 4096 node(s)
2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (187,192,34), blockpos=(176,192,32) - replacing to air 4096 node(s)
2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,8,17), blockpos=(208,0,16) - replacing to air 3556 node(s)
2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (177,11,57), blockpos=(176,0,48) - replacing to air 3016 node(s)
2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (177,16,57), blockpos=(176,16,48) - replacing to air 2944 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,46,-14), blockpos=(208,32,-16) - replacing to air 3840 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,31,-14), blockpos=(208,16,-16) - replacing to air 4096 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,15,-14), blockpos=(208,0,-16) - replacing to air 4096 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,-1,-14), blockpos=(208,-16,-16) - replacing to air 4096 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,-1,1), blockpos=(208,-16,0) - replacing to air 4096 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,46,17), blockpos=(208,32,16) - replacing to air 3840 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,31,17), blockpos=(208,16,16) - replacing to air 3520 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,-1,17), blockpos=(208,-16,16) - replacing to air 3628 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (211,46,36), blockpos=(208,32,32) - replacing to air 3840 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (211,31,36), blockpos=(208,16,32) - replacing to air 4096 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (211,15,36), blockpos=(208,0,32) - replacing to air 4096 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (211,-1,36), blockpos=(208,-16,32) - replacing to air 4096 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (217,46,-23), blockpos=(208,32,-32) - replacing to air 3840 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (217,31,-23), blockpos=(208,16,-32) - replacing to air 4096 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (217,15,-23), blockpos=(208,0,-32) - replacing to air 4096 node(s)
2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (217,-1,-23), blockpos=(208,-16,-32) - replacing to air 4096 node(s)

! and we wait, wait, wait, but what's next if there are still too many 'ignores'? The picture above is the result when I just replace them by air nodes. Yep, I know, I shouldn't replace "ignore" nodes but I aldo don't know what to do with that. So replacing looks not too bad for me. But still too weird. And the water sources would be weird too:
изображение
This minetest issue is more or less about that: https://github.com/minetest/minetest/issues/8232#issuecomment-778869969

This my code just reads the node, as minetest.get_node(pos) should do by design, withoud the part which stores number of chunks generated:

function mcl_mapgen_core.get_far_node(p, force, us_timeout)
	if not p or not p.x or not p.y or not p.z then
		-- minetest.log("warning","[mcl_util] nil passed as node coordinate - return air")
		return {name = "ignore"}
	end
	local node = minetest.get_node(p)
	if node.name ~= "ignore" then
		return node
	end

	local pos = {x=p.x,y=p.y,z=p.z}

	minetest.get_voxel_manip():read_from_map(pos, pos)
	node = minetest.get_node(pos)
	if node.name ~= "ignore" or not force then
		return node
	end

	local blockpos = vector.multiply(vector.floor(vector.divide(pos, mcl_vars.MAP_BLOCKSIZE)), mcl_vars.MAP_BLOCKSIZE)
	local pos2 = vector.add(blockpos, mcl_vars.MAP_BLOCKSIZE-1)

	if mcl_mapgen_core.is_generated(pos) then
		minetest.forceload_block(pos, true)
		local t = minetest.get_us_time()
		local us_timeout = us_timeout or 1000
		node = minetest.get_node(pos)
		while (not node or node.name == "ignore") and (minetest.get_us_time() - t < us_timeout) do
			node = minetest.get_node(pos)
		end
		if node.name ~= "ignore" then
			return node
		end
	else
		local attempts = 5
		local key = minetest.pos_to_string(blockpos)
		local us_timeout = math.floor((us_timeout or 10000) / attempts)

		for i = 1, attempts do -- give engine some chances to emerge the data
			local run = (get_node_emerge_queue[key] ~= nil)
			get_node_emerge_queue[key] = minetest.get_us_time()
			if run then
				minetest.emerge_area(blockpos, pos2, ecb_get_far_node, key)
			end

			while minetest.get_us_time() - (get_node_emerge_queue[key] or 0) < us_timeout do end

			node = minetest.get_node(pos)
			if node.name ~= "ignore" then
				return node
			end

			minetest.get_voxel_manip():read_from_map(pos, pos)
			node = minetest.get_node(pos)
			if node.name ~= "ignore" or not force then
				return node
			end
		end
	end

	 -- engine continuously returns "ignore" - maybe a bug
	node.name = "air"

	local nodes = minetest.find_nodes_in_area(blockpos, pos2, "ignore")
	minetest.log("warning","[mcl_util] still IGNORE at "..minetest.pos_to_string(pos)..", blockpos="..minetest.pos_to_string(blockpos).." - replacing to air "..tostring((#nodes) or 1).. " node(s)")
	if #nodes == 1 then
		minetest.swap_node(pos, node)
	elseif #nodes < 13 then
		minetest.bulk_set_node(nodes, node)
	else
		local manip = minetest.get_voxel_manip()
		local e1, e2 = manip:read_from_map(blockpos, pos2)
		local area = VoxelArea:new{MinEdge=e1, MaxEdge=e2}
		local data = manip:get_data()
		for _, np in pairs(nodes) do
			data[area:index(np.x, np.y, np.z)] = c_air
		end
		manip:set_data(data)
		manip:write_to_map()
	end

	return node
end
The problem is - map generation is slow itself. We should place structures, callback fires as if we really can do that! But still lots of 'ignore' nodes in chunk: ``` 2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (187,160,34), blockpos=(176,160,32) - replacing to air 4096 node(s) 2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (187,176,34), blockpos=(176,176,32) - replacing to air 4096 node(s) 2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (187,192,34), blockpos=(176,192,32) - replacing to air 4096 node(s) 2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,8,17), blockpos=(208,0,16) - replacing to air 3556 node(s) 2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (177,11,57), blockpos=(176,0,48) - replacing to air 3016 node(s) 2021-02-20 11:45:42: WARNING[Emerge-0]: [mcl_util] still IGNORE at (177,16,57), blockpos=(176,16,48) - replacing to air 2944 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,46,-14), blockpos=(208,32,-16) - replacing to air 3840 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,31,-14), blockpos=(208,16,-16) - replacing to air 4096 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,15,-14), blockpos=(208,0,-16) - replacing to air 4096 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,-1,-14), blockpos=(208,-16,-16) - replacing to air 4096 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,-1,1), blockpos=(208,-16,0) - replacing to air 4096 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,46,17), blockpos=(208,32,16) - replacing to air 3840 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,31,17), blockpos=(208,16,16) - replacing to air 3520 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (212,-1,17), blockpos=(208,-16,16) - replacing to air 3628 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (211,46,36), blockpos=(208,32,32) - replacing to air 3840 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (211,31,36), blockpos=(208,16,32) - replacing to air 4096 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (211,15,36), blockpos=(208,0,32) - replacing to air 4096 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (211,-1,36), blockpos=(208,-16,32) - replacing to air 4096 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (217,46,-23), blockpos=(208,32,-32) - replacing to air 3840 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (217,31,-23), blockpos=(208,16,-32) - replacing to air 4096 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (217,15,-23), blockpos=(208,0,-32) - replacing to air 4096 node(s) 2021-02-20 11:45:43: WARNING[Emerge-0]: [mcl_util] still IGNORE at (217,-1,-23), blockpos=(208,-16,-32) - replacing to air 4096 node(s) ``` ! and we wait, wait, wait, but what's next if there are still too many 'ignores'? The picture above is the result when I just replace them by air nodes. Yep, I know, I shouldn't replace "ignore" nodes but I aldo don't know what to do with that. So replacing looks not too bad for me. But still too weird. And the water sources would be weird too: ![изображение](/attachments/c676ecd5-a92e-425f-8166-ff3be28a9cd6) This minetest issue is more or less about that: https://github.com/minetest/minetest/issues/8232#issuecomment-778869969 This my code just reads the node, as ```minetest.get_node(pos)``` should do by design, withoud the part which stores number of chunks generated: ```lua function mcl_mapgen_core.get_far_node(p, force, us_timeout) if not p or not p.x or not p.y or not p.z then -- minetest.log("warning","[mcl_util] nil passed as node coordinate - return air") return {name = "ignore"} end local node = minetest.get_node(p) if node.name ~= "ignore" then return node end local pos = {x=p.x,y=p.y,z=p.z} minetest.get_voxel_manip():read_from_map(pos, pos) node = minetest.get_node(pos) if node.name ~= "ignore" or not force then return node end local blockpos = vector.multiply(vector.floor(vector.divide(pos, mcl_vars.MAP_BLOCKSIZE)), mcl_vars.MAP_BLOCKSIZE) local pos2 = vector.add(blockpos, mcl_vars.MAP_BLOCKSIZE-1) if mcl_mapgen_core.is_generated(pos) then minetest.forceload_block(pos, true) local t = minetest.get_us_time() local us_timeout = us_timeout or 1000 node = minetest.get_node(pos) while (not node or node.name == "ignore") and (minetest.get_us_time() - t < us_timeout) do node = minetest.get_node(pos) end if node.name ~= "ignore" then return node end else local attempts = 5 local key = minetest.pos_to_string(blockpos) local us_timeout = math.floor((us_timeout or 10000) / attempts) for i = 1, attempts do -- give engine some chances to emerge the data local run = (get_node_emerge_queue[key] ~= nil) get_node_emerge_queue[key] = minetest.get_us_time() if run then minetest.emerge_area(blockpos, pos2, ecb_get_far_node, key) end while minetest.get_us_time() - (get_node_emerge_queue[key] or 0) < us_timeout do end node = minetest.get_node(pos) if node.name ~= "ignore" then return node end minetest.get_voxel_manip():read_from_map(pos, pos) node = minetest.get_node(pos) if node.name ~= "ignore" or not force then return node end end end -- engine continuously returns "ignore" - maybe a bug node.name = "air" local nodes = minetest.find_nodes_in_area(blockpos, pos2, "ignore") minetest.log("warning","[mcl_util] still IGNORE at "..minetest.pos_to_string(pos)..", blockpos="..minetest.pos_to_string(blockpos).." - replacing to air "..tostring((#nodes) or 1).. " node(s)") if #nodes == 1 then minetest.swap_node(pos, node) elseif #nodes < 13 then minetest.bulk_set_node(nodes, node) else local manip = minetest.get_voxel_manip() local e1, e2 = manip:read_from_map(blockpos, pos2) local area = VoxelArea:new{MinEdge=e1, MaxEdge=e2} local data = manip:get_data() for _, np in pairs(nodes) do data[area:index(np.x, np.y, np.z)] = c_air end manip:set_data(data) manip:write_to_map() end return node end ```
Contributor

Thanks for pushing for this. It looks both complicated and messy. I hope the Minetest developers can provide some useful feedback to address the issue.

Thanks for pushing for this. It looks both complicated and messy. I hope the Minetest developers can provide some useful feedback to address the issue.
kay27 closed this issue 2021-02-22 00:15:46 +01:00
kay27 added the
ground content conflict
label 2021-03-26 23:57:08 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#993
No description provided.