Structure placement api #2275

Merged
cora merged 12 commits from structure_api into master 2022-06-15 05:14:14 +02:00
Contributor

Adds a (new) mcl_structures.register_structure(name,def) command.

The old register_structure thing was renamed to structure_data - the only thing it has been used for is to store the locations of strongholds.

Also adds dynamically generated geodes and surface pools (lava pools and lakes) as a test for the placement by function option.

It supports /spawnstruct now so you can test placement by using that.

Shipwrecks and geodes are using this right now but I hope to get some or hopefully most of the legacy structures to use this. But since this is 100% compatible there's no need to rush. mcl_mapgen_core is going to be a bit of a task to untangle hehe.

Testing

Use seed "y" for testing:

  • -20,1,160 - shipwreck
  • -63, 44, -75 - water lake
  • -729, 38, -1493 lava pool
  • -105,-34,-177 - geode

they are all somewhat common right now. Might have to make them a bit rarer in the future but for now I think it's good when they're easy to find both so players actually do find them and they get some testing.

Perspective

End cities are going to be fairly easy with this as level 2 (multipart structures) - the plan is to make it so you put the structblock inside of another schematic (or just define its relative position) so it gets gradually placed by lbm and will always fit.

Level 3 is going to be nether fortresses and overworld (surface) structures which need to be more clever about terrain.

Adds a (new) mcl_structures.register_structure(name,def) command. The old register_structure thing was renamed to structure_data - the only thing it has been used for is to store the locations of strongholds. Also adds dynamically generated geodes and surface pools (lava pools and lakes) as a test for the placement by function option. It supports /spawnstruct now so you can test placement by using that. Shipwrecks and geodes are using this right now but I hope to get some or hopefully most of the legacy structures to use this. But since this is 100% compatible there's no need to rush. mcl_mapgen_core is going to be a bit of a task to untangle hehe. ### Testing Use seed "y" for testing: * -20,1,160 - shipwreck * -63, 44, -75 - water lake * -729, 38, -1493 lava pool * -105,-34,-177 - geode they are all somewhat common right now. Might have to make them a bit rarer in the future but for now I think it's good when they're easy to find both so players actually do find them and they get some testing. ### Perspective End cities are going to be fairly easy with this as level 2 (multipart structures) - the plan is to make it so you put the structblock inside of another schematic (or just define its relative position) so it gets gradually placed by lbm and will always fit. Level 3 is going to be nether fortresses and overworld (surface) structures which need to be more clever about terrain.
cora force-pushed structure_api from 9ba3ff4ae8 to 2903639459 2022-06-07 03:37:14 +02:00 Compare
chmodsayshello added the
non-Minecraft feature
API
labels 2022-06-07 21:51:42 +02:00
cora force-pushed structure_api from c7d5e2a197 to 3b297ce047 2022-06-10 01:14:42 +02:00 Compare
Author
Contributor

rebased and removed 2 debug lines lol

rebased and removed 2 debug lines lol
cora force-pushed structure_api from 7ff610fff2 to 3782797dec 2022-06-11 12:23:54 +02:00 Compare
cora force-pushed structure_api from 4603c58c62 to 5294bc4a37 2022-06-13 03:08:18 +02:00 Compare
cora changed title from WIP: Structure placement api to Structure placement api 2022-06-13 03:08:54 +02:00
cora changed title from Structure placement api to WIP: Structure placement api 2022-06-13 03:09:29 +02:00
Author
Contributor

o wait i gotta figure out noise values instead of fill ratio - i noticed otherwise they get placed differently when a new structure is added rofl

o wait i gotta figure out noise values instead of fill ratio - i noticed otherwise they get placed differently when a new structure is added rofl
cora changed title from WIP: Structure placement api to Structure placement api 2022-06-13 12:00:09 +02:00
cora force-pushed structure_api from c0439a815b to 9eafee2fe0 2022-06-13 12:57:25 +02:00 Compare
Author
Contributor

well gotta tweak the noise values still ... sometimes theres way too many lava pools lol

well gotta tweak the noise values still ... sometimes theres way too many lava pools lol
cora force-pushed structure_api from 9eafee2fe0 to b87723e8c0 2022-06-13 23:54:03 +02:00 Compare
Contributor

Yeah, we don't want to set the world on fire. :P

Yeah, we don't want to set the world on fire. :P
Author
Contributor

well seems better now

well seems better now
Member

I couldn't find any lava or water lakes at the listed coordinates.
Same seed with a completely reset 'minetest.conf'; so vanilla values for v7 mapgen.

But, I eventually found one of each here:
water lake: -63, 44, -75
lava lake: -729, 38, -1493

Shipwrecks, and geodes came up fine at the listed coordinates. Also, saw a lot of dungeons here, & there.

Looks good, nice work!


On the minor issue side of things.

That little wrapper around the "spawnstruct" chat command causes Minetest to label the mod it's under as "???"; when you type, 'help' in-game. Instead of the usual "mcl_structures".

So, it may eventually be better to just add the parameters for shipwrecks, & lakes to the command directly.
As right now. If you remove the wrapper; the commands to place shipwrecks/lakes still works, but they don't show up as optional parameters.

But, we can tweak this at another time if you want.

I couldn't find any lava or water lakes at the listed coordinates. Same seed with a completely reset 'minetest.conf'; so vanilla values for v7 mapgen. But, I eventually found one of each here: water lake: -63, 44, -75 lava lake: -729, 38, -1493 Shipwrecks, and geodes came up fine at the listed coordinates. Also, saw a lot of dungeons here, & there. Looks good, nice work! --- On the minor issue side of things. That little wrapper around the "spawnstruct" chat command causes Minetest to label the mod it's under as "???"; when you type, 'help' in-game. Instead of the usual "mcl_structures". So, it may eventually be better to just add the parameters for shipwrecks, & lakes to the command directly. As right now. If you remove the wrapper; the commands to place shipwrecks/lakes still works, but they don't show up as optional parameters. But, we can tweak this at another time if you want.
MysticTempest approved these changes 2022-06-15 03:50:05 +02:00
Author
Contributor

well one of the ideas of this is to not have to edit 50 places in the code if you want to add a structure (the whole mcl_mapgen_core / mcl_structures circus is quite ridiculous tbh ^^ )

It seems less than ideal if they need to be added to /spawnstruct ... but i have an idea. i suppose i could just rewrite its params field on_mods_loaded

well one of the ideas of this is to not have to edit 50 places in the code if you want to add a structure (the whole mcl_mapgen_core / mcl_structures circus is quite ridiculous tbh ^^ ) It seems less than ideal if they need to be added to /spawnstruct ... but i have an idea. i suppose i could just rewrite its params field on_mods_loaded
Author
Contributor

yep looks like that works ... and yeah i changed the noise of surface pools and forgot to put in new coords

yep looks like that works ... and yeah i changed the noise of surface pools and forgot to put in new coords
cora force-pushed structure_api from 60cc55ec18 to 92da429f50 2022-06-15 05:13:43 +02:00 Compare
cora merged commit 20945db0e6 into master 2022-06-15 05:14:14 +02:00
cora deleted branch structure_api 2022-06-15 05:14:17 +02:00
Author
Contributor

Side note about dungeons:

They were not touched here at all - there's always been tons of them.

Incidentally i discovered that they can make mapgen fairly slow. A number of times i thought I made it slow but then when i measured it tsm_railcorridors came up hehe.

I'll look at it some time and see if it can be made faster.

Side note about dungeons: They were not touched here at all - there's always been tons of them. Incidentally i discovered that they can make mapgen fairly slow. A number of times i thought I made it slow but then when i measured it tsm_railcorridors came up hehe. I'll look at it some time and see if it can be made faster.
Contributor

Do we need these logged?

WARNING[Emerge-0]: [mcl_structures] placing geode failed at (3013,-34,1830)
WARNING[Emerge-0]: [mcl_structures] placing geode failed at (3063,-34,1753)
WARNING[Emerge-0]: [mcl_structures] placing geode failed at (2961,-34,1742)
WARNING[Emerge-0]: [mcl_structures] placing geode failed at (1981,-34,2200)
Do we need these logged? ``` WARNING[Emerge-0]: [mcl_structures] placing geode failed at (3013,-34,1830) WARNING[Emerge-0]: [mcl_structures] placing geode failed at (3063,-34,1753) WARNING[Emerge-0]: [mcl_structures] placing geode failed at (2961,-34,1742) WARNING[Emerge-0]: [mcl_structures] placing geode failed at (1981,-34,2200) ```
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 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#2275
No description provided.