Grand mapgen cleanup Part 1 #2355

Merged
cora merged 29 commits from mapgen_fixes into master 2022-07-01 19:13:19 +02:00
Contributor

While I'm overall happy with the performance of the new structure api - even unoptimized it was notably faster than some legacy mapgen stuff (cough tsm_railcorridors)

I did findd a few things that could still be optimized though:

Furthermore some cleanup of legacy stuff in mcl_mapgen_core.

  • Use mcl's "register_generator" mapgen pipeline instead of plain on_generated

  • Optimize Terrain feature generation (bulk_set_node instead of set_node, no logging)

  • Use decorations in caves except for v6 (minetest used to not support it apparently, but now it does via the "all_floors" flag)

  • Add "solid_ground" flag for structures which means the api will check if there's solid ground and deny placement if there is not.

  • Add "make_foundation" flag which will make the solid ground if needed

  • Add jungle temple and ocean ruins (schematics by @PrairieAstronomer

  • implement the old chunk probability logic in the new api

  • Move simple legacy structures to new api

- implement mcl_secret_ores for netherite (
I'll make that a separate pr once netherite is in.

Most of this PR is adding some features to the structure api so it supports the stuff that was done "manually" in a long spaghetti in mcl_mapgen_core and moving those features to mcl_structures into separate files using the new struct api.

Next up (in part 2)

  • Clean out mcl_mapgen_core of all (non-v6) structure generation
  • Figure out what decoration stuff in mcl_mapgen_core can be done as actual decorations
  • Try to move all remaining fake (on_generated) decorations to mcl_biomes (might not work bc of dependencies)
  • Move End exit portal to mcl_structures
  • Move Stronghold gen to separate file
  • Move v6-compat code to separate file
  • Split mcl_biomes into separate files

after this mcl_mapgen_core should only contain api code and the generation code for the basic world layout (bedrock, dimensions).

so we'll have

  • mcl_mapgen_core
  • mcl_biomes
  • mcl_structures

neatly separated as the main mapgen mods. More complex structure stuff like villages can still be their own mods and depend on mcl_structures. Simple structures can be additional lua files in mcl_structures (I'll move shipwrecks back there).

This PR fixes #2364
This PR fixes #2372

Testing

Seed "y"

  • cold_ocean_ruins (1205,-10,2896)

  • desert_temple (1639,-7,2628)

  • igloo (1187,2,2867)

  • jungle_temple (2440,36,4193)

  • shipwreck (1106,-22,16573)

  • warm_ocean_ruins (1032,-20,17333)

  • witch_hut (670,2,15623)

  • desert well (2165,6,1956)

  • fossil (-650,-9,4)

  • woodland cabin (1283,56,-473)

  • water lake 210,14,904

  • lava pool 1030,8,1285

  • village (690,30,5000) - village gen is unchanged as of yet

While I'm overall happy with the performance of the new structure api - even unoptimized it was notably faster than some legacy mapgen stuff (*cough* tsm_railcorridors) I did findd a few things that could still be optimized though: Furthermore some cleanup of legacy stuff in mcl_mapgen_core. - [x] Use mcl's "register_generator" mapgen pipeline instead of plain on_generated - [x] Optimize Terrain feature generation (bulk_set_node instead of set_node, no logging) - [x] Use decorations in caves except for v6 (minetest used to not support it apparently, but now it does via the "all_floors" flag) - [x] Add "solid_ground" flag for structures which means the api will check if there's solid ground and deny placement if there is not. - [x] Add "make_foundation" flag which will make the solid ground if needed - [x] Add jungle temple and ocean ruins (schematics by @PrairieAstronomer - [x] implement the old chunk probability logic in the new api - [x] Move simple legacy structures to new api ~~- implement mcl_secret_ores for netherite (~~ I'll make that a separate pr once netherite is in. Most of this PR is adding some features to the structure api so it supports the stuff that was done "manually" in a long spaghetti in mcl_mapgen_core and moving those features to mcl_structures into separate files using the new struct api. Next up (in part 2) * Clean out mcl_mapgen_core of all (non-v6) structure generation * Figure out what decoration stuff in mcl_mapgen_core can be done as actual decorations * Try to move all remaining fake (on_generated) decorations to mcl_biomes (might not work bc of dependencies) * Move End exit portal to mcl_structures * Move Stronghold gen to separate file * Move v6-compat code to separate file * Split mcl_biomes into separate files after this mcl_mapgen_core should only contain api code and the generation code for the basic world layout (bedrock, dimensions). so we'll have * mcl_mapgen_core * mcl_biomes * mcl_structures neatly separated as the main mapgen mods. More complex structure stuff like villages can still be their own mods and depend on mcl_structures. Simple structures can be additional lua files in mcl_structures (I'll move shipwrecks back there). This PR fixes #2364 This PR fixes #2372 ### Testing Seed "y" * cold_ocean_ruins (1205,-10,2896) * desert_temple (1639,-7,2628) * igloo (1187,2,2867) * jungle_temple (2440,36,4193) * shipwreck (1106,-22,16573) * warm_ocean_ruins (1032,-20,17333) * witch_hut (670,2,15623) * desert well (2165,6,1956) * fossil (-650,-9,4) * woodland cabin (1283,56,-473) * water lake 210,14,904 * lava pool 1030,8,1285 * village (690,30,5000) - village gen is unchanged as of yet
cora force-pushed mapgen_fixes from d549d3721c to b7957a1930 2022-06-23 20:24:14 +02:00 Compare
cora changed title from WIP: mapgen/structures fixes, optimizations, api additions to WIP: mapgen/structures fixes, optimizations, api additions, new schematics 2022-06-24 15:59:55 +02:00
cora changed title from WIP: mapgen/structures fixes, optimizations, api additions, new schematics to WIP: Grand mapgen cleanup Part 1 2022-06-24 23:36:18 +02:00
AFCMS added the
mapgen
label 2022-06-27 18:18:44 +02:00
cora changed title from WIP: Grand mapgen cleanup Part 1 to Grand mapgen cleanup Part 1 2022-06-30 02:00:18 +02:00
cora force-pushed mapgen_fixes from 3978da690a to 8f1ab7f86e 2022-06-30 02:01:47 +02:00 Compare
Author
Contributor

rebased

rebased
Author
Contributor

The distribution still needs to be tweaked (most structs are somewhat common rn hehe) but seeing as this fixes some issues and all of this will need testing anyways i think it is good to go.

The distribution still needs to be tweaked (most structs are somewhat common rn hehe) but seeing as this fixes some issues and all of this will need testing anyways i think it is good to go.
cora force-pushed mapgen_fixes from 8f1ab7f86e to e3432a8b90 2022-06-30 15:20:47 +02:00 Compare
cora force-pushed mapgen_fixes from e3432a8b90 to f115fc8ea0 2022-07-01 04:26:25 +02:00 Compare
cora added 1 commit 2022-07-01 04:26:54 +02:00
cora added 1 commit 2022-07-01 06:11:26 +02:00
Member

Alright, been testing this for a while. Pretty awesome so far.

First up:
I tried testing to see if issue #2372 was fixed. And, while there's no crash. No lake loaded. And, I'm having trouble finding one to test.

On master, with seed "y" I found one at the following location:
water lake: 1312, 14, 1320

On this branch it's gone.
I know there's a couple changes to spawning them. Do you know of a water or lava lake spawn to confirm?


Second:
The desert temple's have no loot.

Seems to work okay if I set the following line:
https://git.minetest.land/MineClone2/MineClone2/src/branch/mapgen_fixes/mods/MAPGEN/mcl_structures/desert_temple.lua#L50

To:

		["mcl_chests:chest" ] ={

Then load a new temple.


Everything else seems to spawn correctly, nice work!

Alright, been testing this for a while. Pretty awesome so far. **First up:** I tried testing to see if issue #2372 was fixed. And, while there's no crash. No lake loaded. And, I'm having trouble finding one to test. On master, with seed "y" I found one at the following location: ***water lake***: 1312, 14, 1320 On this branch it's gone. I know there's a couple changes to spawning them. Do you know of a water or lava lake spawn to confirm? --- **Second:** The desert temple's have no loot. Seems to work okay if I set the following line: https://git.minetest.land/MineClone2/MineClone2/src/branch/mapgen_fixes/mods/MAPGEN/mcl_structures/desert_temple.lua#L50 To: ``` ["mcl_chests:chest" ] ={ ``` Then load a new temple. --- Everything else seems to spawn correctly, nice work!
Author
Contributor

Oh yeah i suppose they have the old chests in the schematic .. i'll see about the lakes

Oh yeah i suppose they have the old chests in the schematic .. i'll see about the lakes
cora added 1 commit 2022-07-01 14:31:19 +02:00
Author
Contributor

yeah surface pools were broken..

  • water lake 210,14,904
  • lava pool 1030,8,1285
yeah surface pools were broken.. * water lake 210,14,904 * lava pool 1030,8,1285
cora added 1 commit 2022-07-01 14:43:41 +02:00
Author
Contributor

That last one is because pools (and geodes) tend to get cut off sometimes otherwise.

That last one is because pools (and geodes) tend to get cut off sometimes otherwise.
MysticTempest approved these changes 2022-07-01 15:33:51 +02:00
Member

Retested, works; thanks!

Retested, works; thanks!
cora merged commit cea6af267f into master 2022-07-01 19:13:19 +02:00
cora deleted branch mapgen_fixes 2022-07-01 19:13:33 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 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#2355
No description provided.