MinimumContent / muon

Muon is a Forge mod for Minecraft versions 1.9 to 1.11 inspired by Quark. Its primary focus is to improve and enhance Villages in keeping with the style and spirit of Vanilla Minecraft.
http://muon.mc.izno.gd/
GNU Lesser General Public License v3.0
8 stars 4 forks source link

Suggestion: Config to alter village gen order #11

Open IdrisQe opened 5 years ago

IdrisQe commented 5 years ago

I'm not entirely sure this is possible, but as Muon is a coremod I imagine it's at least a little bit more feasible than with a normal mod? Would it be possible to add a config option, say... B:villageGenAfterFeatures=true which would make it so that village layout, buildings, features, etc. will all generate after terrain generation is complete, including things like random lakes and rivers and the like. This way, houses wouldn't get partially cut off as overzealously generated pools of water shred them, and they wouldn't mash themselves into trees weirdly. Alternatively, maybe after a village has been generated, Muon goes over it and moves buildings and features to better positions, and repairs any blocks that have gone missing from generation overlap. Perhaps by replacing the village structure system with a custom one that takes note of every block generated in the village, and each corresponding structure that was used to generate it (including modded ones), allowing the position and existence of each block to be recalculated after the village and all terrain around it has already been generated, while keeping structures held together. So like...

Terrain Generates Village generates, custom spawner takes note of each structure and the blocks that make them up. Features generate and likely cut into structures Muon compares the current layout of what currently is there to what is expected from the structure, if blocks are missing from having been cut by terrain features, they are replaced, and the structure's whole position is recalculated so that the entire thing is on solid ground.

Of course, I'm not sure how this would work with mods that add villagers and village buildings, but... Assuming Minecraft is coded somewhat sensibly (which I know it isn't, oh well) and there's say, a registry of village buildings which mods can add to, which all spawn at village generation, then theoretically all village generation could be queued up to happen all at once off-thread or something. I'm assuming that's not the case, however, since I already notice Muon not affecting some modded village buildings like those from Immersive Engineering.

Again, no idea if this is even possible; this is coming from someone with like, the bare minimum of knowledge about Minecraft's internal code. If it is, it would probably be laggy to catalogue every block generated by the village generator then generate the village, then re-generate it after terrain features to repair any damage and positioning issues their generation caused. It would also be worth the lag, so long as villages are made a bit less common.

TrinaryLogic commented 5 years ago

A lot of what you suggest is simply not practical, it's much better (and easier) to generate it right the first time than go back and try to re-do it later. Muon has a few outstanding issues that have to do with the way minecraft aligns feature generation to chunks (or doesn't), which causes odd artifacts depending on chunk generation order and results in Muon's fixes sometimes not being applied to a chunk at all.

The definition of buildings is entirely pluggable in forge and Muon attempts to change this as little as possible for maximum compatability, but it doesn't always work the way I intended.

I hope (when I get some more serious development time again) to address some of the deficiencies with where muon's terrain fixes are integrated into the chunk generation, but in the meantime I'm open to pull requests. :)