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
Structures can generate in saltwater and below mantle #3564
Comments
Underwater generation itself fits perfectly with "the world got scrambled" idea implied by the lore. The issue is generating things that should not be there - grass, regular water, etc. |
@Barhandar And the system atm should prevent complete underwater spawns so this is a bug. |
IIRC the problem with "shallow" vs "not shallow" is that the game doesn't actually deal with saltwater correctly at all, as evidenced by [this comment](https://mods.vintagestory.at/show/mod/8969#cmt-19114 (the code checks for nonexistent "seawater" block rather than existent "saltwater"), besides lacking a check for water depth. |
Yeah with the the problem with the saltwater is why this issue has been posted. The shallow water is bcs structures only get checked on each corner for performance reasons so the there is no water it will spawn that's why they can spawn in shallow water |
I don't think the issue is specific to salt water, the code checks for any kind of water at the 4 corners. Maybe seen more on high ocean worlds just because there is more, and more deep, water on such worlds. The issue here is the checking code is buggy, it is checking at heights based on the centre position of the ruin, but in the 4 corners being checked, those checks may be inside rock, if the lake / seabed is uneven. No water of any kind inside rock! We can fix in 1.20 I think, simply by checking for liquids at a higher point on the structure - but this will require testing and tuning. We don't want to lose the current behavior where vanilla ruins sometimes spawn underwater - it looks awesome in shallow lakes - but I can understand that surface ruins should not spawn deep underwater. My current thinking: the liquid check should be at a random position between 3 and 7 blocks high on the structure: this will mean that structures will naturally be less and less likely to spawn, the deeper the water is, and nothing below depth 7. Something like that. Needs tuning. |
Hey might be a stupid idea but why not just check 2 or 3 blocks +the offset of the structure. This would always check 2 or 3 blocks above ground level for water so the structure could spawn 1-2 blocks in water? @radfast |
Yep, something like that, needs testing for the structures with very deep cellars. Meanwhile, the "below mantle" issue, is that seen in 1.19.4-rc.1 or later? -rc.1 included code to fix structures attempting to generate off the map edge, I don't remember now whether we also check for below mantle |
It's pre 1.19.4 and it wasn't reported directly by me but by one of the mod users. I can try to test it in the future but I'm generally not using oceans... |
I'll look at the mantle issue - though it may also be mitigatable using an appropriate You're right, the underwater generation issue will affect larger (wider) structures much more, as the 4 corners are more likely to be in rock/lake-bed not water. But it will affect vanilla and will need careful testing - we want vanilla ruins to be able to spawn still in shallow water - so a fix for that will have to wait until 1.20, I'm afraid. Meanwhile you should be able to mitigate underwater generation completely by setting |
Sounds good thanks for the detailed explanation! Will update that in my mod and give feedback if any issues come up |
I messaged radfast about this on dc dm The minY doesn't work at all atm. |
Game Version
v1.19.3
Platform
Windows
Modded
Modded
SP/MP
Multiplayer
Description
The code for structure is not checking for saltwater. Also the underwater checks are insufficient. it's only checking the corners to my information. I'm guessing performance reasons.
How to reproduce
You can use my mod betterruins or vanilla and fly around with oceans enabled.
Screenshots
Logs
Log
The text was updated successfully, but these errors were encountered: