Ruins (Structure Spawning System)

Ruins (Structure Spawning System)

24M Downloads

[Ruins 1.12.2] acceptable target blocks / max leveling, not allowing spawning

Shivaxi opened this issue ยท 10 comments

commented

I've been doing a lot of trial and error testing to get down to the bottom of why a lot of structures I have in Ruins just never naturally generate. Tested on a flat world plains biome with a specific castle structure in the generic folder, which had these lines:

acceptable_target_blocks=stone,grass,dirt,sand,gravel
max_leveling=0

Now I tested max_leveling out on another structure that was spawning fine. If I set it to max_leveling=0, it refused to spawn at all anymore. max_leveling had to be ATLEAST 1 for it to spawn. So I changed the castle structure above to max_level 0, but it still refused to spawn, until i completely wiped the "acceptable_target_blocks" line from the template, then it began spawning everywhere. Was using a high weight to test as well with short unique min distance.

I'm not sure why I had to wipe acceptable_target_blocks", grass blocks were listed, the plains is filled with grass (obviously), so I'm not sure what's going on

https://pastebin.com/0caQDZ2c - the castle structure template

commented

As I said, I did it on a flat world plains biome that was entirely made of grass...so...

I just used that template as an example, but much smaller ones also would not spawn at all. I'm sure if you try it yourself, you will see. Set a small template to have a high weight and low unique min distance, add acceptable blocks like grass dirt gravel stone whatever, and see if it generates naturally at all. I had this template as the ONLY activated template in the Generic folder and it still would not spawn in a completely flat world plains biome full of grass blocks. I used overworld preset on the flatworld as well so there was enough depth for any structure to spawn.

commented

First, Ruins never generates anything below Y=8, and the "default" superflat preset is only 4 blocks deep. No Ruins structures will spawn on such a world (unless maybe it's something that can spawn on top of a village roof). If you want to test in a superflat world, you'll need to customize the preset to be at least 9 blocks deep (e.g., change 2*minecraft:dirt to 7*minecraft:dirt).

I suspect the real problem with your template is the max_leveling=0 line. That means your structure will only spawn where Ruins finds a perfectly flat 37x34 area of acceptable blocks--exceedingly unlikely in a vanilla overworld dimension. Think of setting the max_leveling parameter as specifying how uneven the terrain can be. For a structure of this size, a good setting might be max_leveling=3, which means there can be bumps and dips as much as 3 blocks up or down from the average, allowing about a 20% grade. Fiddle with this a bit to get the results you want.

So why does removing the acceptable_target_blocks line appear to work? I suspect when you say "they are spawning everywhere now," you mean they are spawning on water; you probably still don't see them occur on land. When you remove acceptable_target_blocks, then all blocks are valid surfaces for structures--including water, which is the one terrain block that does present large, perfectly flat areas in the overworld.

If you notice certain structures aren't spawning (assuming they're not emitting error messages to the log file), it's likely an overly restrictive max_leveling value is the culprit.

commented

No, even with the max leveling line at 1 or more, the structure still never spawned. Though max leveling being at 0 is also causing the structure not to spawn, on a flat world even with Overworld preset.

Also you must have skipped over where I said I was using the Overworld preset for my flatworld, so no I wasn't using the default flatworld with only Y=4. Other structures were spawning just fine in my tests.

I tried with a smaller structure that had defined Acceptable Target Blocks, and this one actually spawned. The larger structures however still have an incredibly difficult time spawning though, even though there is plenty of areas thats just grass blocks for a good 50x50 block radius on an overworld preset flatworld. I wonder if perhaps the Acceptable Target Blocks isn't taking into account ALL blocks in the list at once. Like if grass and stone are in the list, and there's a lot of grass and stone all mixmatched, the structure is only looking for 30 grass OR 30 stone blocks to spawn on, instead of 30 grass AND 30 stone blocks (considering a large structure that's 30x30 for example). Could this be the case?

commented

hell, the only reason this has become a problem as of late is because I've been trying to fix all the structures spawning in with these trenches or "grooves" dug around them:

image

settingh max leveling to 0 fixed it when spawned in manually, but then of course they dont naturally spawn anymore, and the majority of structures i have do this, probably since they're older and were made for an old version of Ruins but...finding the true cause has been eluding to say the least

commented

Figured out my trench/groove problem was leveling-buffer. I set that to 0 and now the groove vanishes, as leveling buffer is set to define the area around the build that also gets leveled, and since it is 1 block deep into the ground, that first layer levels a ring around it. It's strange though that these same builds didn't do this back in 1.10 though, did leveling-buffer do something different back then?

commented

confirmed "acceptable_target_blocks" seems to be broken to some degree. I've just tried on several more templates that had defined acceptable target blocks, templates that would nearly never spawn, even with high weights (talking about flying 3000 blocks before i would see one of these) and as soon as I removed "acceptable_target_blocks" they are spawning everywhere now.

It is to note that the acceptable target blocks listed should have covered nearly anything it could spawn on in the given biomes they were set to spawn in, grass, dirt, sand, gravel, you name it

commented

Please ask in the thread for support: https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/1282339-1-14-3-ruins-structure-spawning-system

As for the code, i see nothing obviously wrong with the acceptable block system.

I see the default templates use the unacceptable block system instead - i suspect there is simply some blocks missing from your acceptable block list for a ... 14 by 33?! pretty huge template to spawn. Remember: Every single surface block (minus snow and plants) has to be in that list, across all of the template, for it to work!

commented

Leveling has always been a bit flaky. Best to set leveling_buffer=0 to restrict it to only what's directly below the structure, or--better still--leveling_buffer=-1 to turn it off altogether.

Anyway, I'm not able to duplicate the problem you're describing. I just downloaded and installed the latest 1.12.2 Forge, the latest 1.12.2 Ruins release, and the template file you posted on Pastebin with no changes whatsoever to either the template or default config files. I see the ground littered with your structures, both in the regular overworld...
2019-11-08_17 05 13
...and the "Overworld" superflat preset...
2019-11-08_17 05 52
...so I have to presume something's amiss in your particular installation. Are you seeing error messages in the log file? Are there other mods involved?

commented

Looking at that picture you posted, I notice something that looks like stone buttons scattered around the landscape. What are those? If they're something being placed during worldgen by another mod, you'll need to add them to the acceptable_target_blocks list; otherwise, they could easily inhibit the placement of Ruins with any significant footprint.

If, however, they're Ruins themselves, probably with a very small uniqueMinDistance value, they're starving out all other Ruins. The uniqueMinDistance parameter was intended for structures that should be rarer, not more common--in other words, uniqueMinDistance (and templateInstancesMinDistance, for that matter) should always be greater than anyRuinsMinDistance (or zero, which effectively disables the feature). Otherwise, it causes an undesirable spamming effect, wherein once a template with a particularly low uniqueMinDistance is instantiated, that's pretty much the only template that will be instantiated. This issue pops up in the Forum from time to time.

commented

Jesus....yeah...yeah that would be the problem lol. Christ, those little rocks are from the No Tree Punching mod, and yeah they do count as blocks. Alright well that makes sense why most of those structures weren't spawning haha. I still had to fix all the "grooves" or trenches a lot of the structures were making but, changed everything to the unnacceptable blocks list anyway. took me a solid 24 hours but, it's all working now haha. Man, I shoulda known about those rocks causing some issues with the template gens...that one's my bad.