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
Please document current status of is_ground_content
and how to use it safely to place schematics (with it) in register_on_generated
callbacks
#11125
Comments
is_ground_content
and how to use it safely
is_ground_content
and how to use it safelyis_ground_content
and how to use it safely to place schematics (with it) in register_on_generated
callbacks
This block should be solid by design, to clarify: I'm updating issue https://git.minetest.land/MineClone2/MineClone2/issues/1395 during experiments. Not sure if it is a good idea to require writing the same data into map blocks up to 8 times. Maybe cavegen.cpp needs some node markers, like meta data, which would mean "don't change this node". |
Okay, I made Lua API to process every mapblock only once.
|
So what specifically do you need? Is it just that the weird negation that is confusing? Do you want examples to be added (like what to do with air, ignore, stone)? Any other concrete questions? I think the current way this is written seems correct to me tho, just weirdly worded. |
Hi @Wuzzy2 ! Thanks for paying attention.
As a developer, I need confidence that all the structures and nodes, be/contain they 'ground content' or not, after placing them in For MCL2, maybe this story has started from disappearance of a stronghold: https://forum.minetest.net/viewtopic.php?p=381747#p381747 And I kind of found a fix - skip unfinished blocks until mapgen finishes them: https://git.minetest.land/MineClone5/MineClone5/src/branch/master/mods/CORE/mcl_mapgen/init.lua#L266 (we only lose possibility of using full-chunk mapgen objects.) It works fast and perfect, but for MCL2 people it seemed to be too complicated for accepting: https://git.minetest.land/MineClone2/MineClone2/pulls/1976 So I believe any progress from engine devs means a lot for all the schematics all over the worlds :) |
Problem
First of all, this option not seems to be documented well, currently Lua API contains the text which we can understand differently:
If you perceive first sentence as self-consistent, next one means
true
value stops, which seems to be wrong andfalse
should stop nodes being removed by caves.Next problem is cavegen.cpp not only carves the blocks but fills nodes with liquids (I mentioned it in issue 8232 with an example), and possible stones - maybe would be nice to document it.
Of course it wouldn't be a problem if
register_on_generated
callbacks worked as expected. But according to this @paramat 's comment, we have1 - (3*3*3/5/5/5) = 0.784
probability (extremely high) to meet this kind of problems by placing anything withis_ground_content
flag. (3*3*3 is kinda protected cube from neighbor caves, in the middle of 5*5*5 chunk).There is also a suggestion to use different nodes with correct drops. This suggestion has two problems for me currently:
basenode:sand_but_not_ground_content
we must process it as a special case somehow to get justbasenode:sand
still;I stop here, though it's not all the problems but hope enough to get started.
Solutions
We need to document properly what
is_ground_content
flag does and especially what it does not. Areair
,liquids
,ignore
ground content too or not (by design).And work out a way to place schematics with ground content like sand, stone, water, lava, air, etc. during
register_on_generated
callback to let the schematic survive after neighbour chunks further generation.Additional context
It is related to:
The text was updated successfully, but these errors were encountered: