Additionally, it seems to return positive distances, not negative ones as specified - at least, for euclidean distance.
Documentation https://lua-api.factorio.com/latest/aux ... spot_noise:
For example, this (data.lua):voronoi_spot_noise
The distance from the current location to the closest point (0 at each point and descending to negative values in a cone around each point).
data.raw["noise-expression"]["elevation"].expression = "voronoi_spot_noise{x=x, y=y, seed0=1241, seed1=12412, grid_size=200, jitter=0, distance_type='manhattan'}-0.5"
* Note the -0.5
for this command-line preview:
"$(FACTORIO_EXECUTABLE)" $(MOD_ARG) $(MOD_LOCATION) --generate-map-preview $(PREVIEW_LOCATION)/preview-4198238.png --map-preview-size 400 --map-gen-seed 4198238
yields this: And if it returned tile distance (as seems implied), there would just be a speck of ocean in the center.
If it actually returned negative distance, that would all be ocean, not land and ocean.
The documentation should reflect this, so people don't spend several hours debugging their noise expressions only to find out the voronoi_spot_noise doesn't return tile distance.
On a related note, it would be nice to have voronoi functions that return the actual tile distance from the cell center/edge/etc.,