Open blixt opened 10 years ago
It seems that the variant number is decided by a Fowler/Noll/Vo hash function.
Here's a question by OmnipotentEntity showing some code of the variant generator: http://stackoverflow.com/questions/10468064/static-pseudorandom-field-generator
The variables used in the actual Starbound code are allegedly world seed, followed by either 455934271 (for background tiles) or 786571541 (for foreground tiles), followed by the X and Y coordinates.
Experimentation will be needed to come up with the actual working implementation of this.
Variants are not stored in the
.world
file, they're calculated. They seem to follow a noise algorithm, but the algorithm is deterministic (so the same X, Y coordinates always get the same variant).