Adding Generator For Single Prefab Structures
#1
Lightbulb 
So I had a look around in old issues and found the one asking for a generator which generates single piece structures like jungle temples, dessert temples...



There is the cGridStructGen generator which would makes sense to use because these structures are placed more or less on a grid.

So this is the generator I would use.

Further research shows this is more or less biome dependent so maybe change the generator


I thought about creating just one generator and passing the type of structure to generate to the constructor which takes care of everythin else. So further additions would be easier

The Generator would be handed the placement parameters and the type. Dependent on the type it would load a different file.



The Generator would need a prefab loaded into memory like in the piece structure generator (e.g. villages) but only once so I need a way to store that.
I had a look around on the Galery Server and found some models. And multiple ones for one structure so the the class should hold multiple options for one structure



Madmaxoft already noted that it should be configurable if the generator places those structures. I put it that way that the Generator checks if the world.ini includes the structures in the "Finishers" parameter.



So the flow would be



1. Composable Generator checks if the structure should be genrated; if "no" don't; else

2. call the PrefabSingleStructure generator with the asked structure to generate

3. load the structure from file (like with the other prefab pieces)

4. the cGridStructGen should handle everything else



There are some edge cases to be checked on each strucure:

e.g. DesertTemples may be generated into water and get cut off



Some of the strucutures contain chests which need to be filled. A chest entity function takes care of that.



The loading from file is coded into the cPrefabPiecePool. This could be reused for this purpose. I thought abbout creating a class that does care of that avoiding stupidly copying some code. But since there are only two types of generated structures this makes no sense so i will copy the code neeeded.

Using the cPrefabPiecePool is possible (I think) but is way to overpowered for this use.



I would start making the Desert Temples work and everything else should be not that bad.

Structures I Found on the Galery Server:

Desert Temple: Desert 48 + 49 + 115
generates within desert always at height 64 (may be burried in sand) (contains loot) [https://minecraft.gamepedia.com/Desert_pyramid]
Jungle temple:                                  
generates within a jungle - generated with a chance of 3/4 in jungle (contains loot) [https://minecraft.gamepedia.com/Jungle_pyramid]
Witch hut:                                        
generates rarely in swamp biomes - spawns whitches and only lets spawn black cats [https://minecraft.gamepedia.com/Swamp_hut]
Desert well: Desert 221                     
generates with the chance of 1/1000 in a desert chunk [https://minecraft.gamepedia.com/Desert_Well]

Structures NOT in vanilla but still nice
Plans 341 (Flying Island with Flowers)

BigPlains 1 (Creepy ghost house)
Reply
Thanks given by:


Messages In This Thread
Adding Generator For Single Prefab Structures - by 12xx12 - 08-21-2020, 02:25 AM



Users browsing this thread: 1 Guest(s)