The Lost Cities

The Lost Cities

60M Downloads

[1.12.2] Random values don't work correctly in palettes and spawning of buildings

spaseksplorer opened this issue ยท 13 comments

commented

In the profile config, setting the park or fountain spawn chance to 0.0 does not prevent parks or fountains from spawning.
In palettes, the random values seem to have a underlying max sum they are trying to fill. Setting the random weights for blocks too low (so the sum of the weights is less than 100) makes the structure spawn with empty spaces where blocks should be. Setting the random weights for blocks to high (>100 each) prevents later items in the list from generating in the parts.

commented

No idea about the fountains

yes indeed. That's how it is implemented for the random blocks

commented

Why is the random weights for blocks implemented that way? Why is there an invisible, arbitrary limit to the value of weights I put in?

commented

The limit is actually 128. So a weight of 32 means 1/4 chance.
This is done for efficiency reasons

commented

The 1000 basically means: all the rest. Because the mod automatically caps the maximum to 128. So it's an easy way of saying: 'if it's not one of the above then take this'

commented

Then how do the palettes that ship with the mod work? They have values of 8, 9, and 1000.

commented

How does setting a limit improve efficiency? Is it possible to remove this limit?

commented

It uses a lookup table internally with 128 values. So no, not possible to remove this limit

commented

Also why would you want to remove this limit?

commented

ok, but it's not possible. Also you asked for 1.12.2 and I no longer work on 1.12.2 (or 1.16.5)

commented

To have finer control over the random weights. So it can actually function like a true weighted list.

commented

Why is it not possible? Could you add a comment to the docs describing this limit then?

commented

It's not possible because it would require more memory

commented

parkType = AssetRegistries.PARTS.get(cs.getRandomPark(rand));

Line 738 might need to go where line 729 is to fix the parks still spawning issue.