Wrangling resource autoplace / noise expressions?
Posted: Sat Dec 30, 2023 2:58 pm
I find noise expressions and their documentation very, very difficult to comprehend. At this point nothing you can say will convince me that they aren't an occult ritual.
I want to add a new resource that spawns "spotty" resources in exactly the same manner as vanilla's crude oil, just with tweaked frequencies and patch size. That's the easy part, done.
I also want to be able to tweak any spawned resources via script on chunk generation, replacing them conditionally with things based on tile properties such as elevation and temperature. That's also relatively straightforward thanks to surface.calculate_tile_properties().
What you can't do straight off the shelf is access the noise that generates ore or crude oil resources. Noise layers appear to be defined for them but as far as I can tell they aren't actually used anywhere, maybe they are a left-over from way back when resources still used peak expressions, I don't know. I would like to be able to access "crude oiliness" in the same way that I can access elevation, moistness or temperature.
So I guess what I want to be able to do is:
- Convert crude oil's autoplace settings to a named noise expression that precisely duplicates the existing spawn behaviour of crude oil
- Tell crude oil to use that expression
- Hope that this allows you to access the rough proximity to a crude oil patch via surface.calculate_tile_properties
How do I even get started with that?
I want to add a new resource that spawns "spotty" resources in exactly the same manner as vanilla's crude oil, just with tweaked frequencies and patch size. That's the easy part, done.
I also want to be able to tweak any spawned resources via script on chunk generation, replacing them conditionally with things based on tile properties such as elevation and temperature. That's also relatively straightforward thanks to surface.calculate_tile_properties().
What you can't do straight off the shelf is access the noise that generates ore or crude oil resources. Noise layers appear to be defined for them but as far as I can tell they aren't actually used anywhere, maybe they are a left-over from way back when resources still used peak expressions, I don't know. I would like to be able to access "crude oiliness" in the same way that I can access elevation, moistness or temperature.
So I guess what I want to be able to do is:
- Convert crude oil's autoplace settings to a named noise expression that precisely duplicates the existing spawn behaviour of crude oil
- Tell crude oil to use that expression
- Hope that this allows you to access the rough proximity to a crude oil patch via surface.calculate_tile_properties
How do I even get started with that?