Background
The plan currently works out a seed for each tile from the global seed and the tile coordinate, and everything inside that tile draws its starting static from it. That makes two tiles sitting side by side start from unrelated static, so the terrain does not carry across the join between them. The blending in #4 removes seams between windows, but it cannot remove a seam between two tiles that were never related to begin with.
The seeding belongs one level lower. Every window gets its own starting static, worked out from the seed together with that window's position on the world grid. A window that straddles a tile boundary then carries the terrain across it on its own, because the static depends on where the window sits in the world rather than on which tile or which region it was asked for as part of.
Description
Create something that takes a seed, a window's position on the world grid, and the size of a window, and returns the starting static for that window at that size.
The same seed and position must always give back the same static. Two different positions must give different static, and so must two different seeds at one position.
Work the seed and the position into the random number generator without first squashing them together into a single number. Two positions that squashed down to the same number would produce identical static, and nothing further along would catch it.
This replaces #37. Once a window's static comes from its own position in the world there is nothing left for a per tile seed to do, so #37 should be closed rather than built.
Testing:
- Assert the same seed and window position always give the same starting static
- Assert two different window positions under the same seed give different starting static
- Assert two different seeds at the same window position give different starting static
- Assert the static is the size asked for
Background
The plan currently works out a seed for each tile from the global seed and the tile coordinate, and everything inside that tile draws its starting static from it. That makes two tiles sitting side by side start from unrelated static, so the terrain does not carry across the join between them. The blending in #4 removes seams between windows, but it cannot remove a seam between two tiles that were never related to begin with.
The seeding belongs one level lower. Every window gets its own starting static, worked out from the seed together with that window's position on the world grid. A window that straddles a tile boundary then carries the terrain across it on its own, because the static depends on where the window sits in the world rather than on which tile or which region it was asked for as part of.
Description
Create something that takes a seed, a window's position on the world grid, and the size of a window, and returns the starting static for that window at that size.
The same seed and position must always give back the same static. Two different positions must give different static, and so must two different seeds at one position.
Work the seed and the position into the random number generator without first squashing them together into a single number. Two positions that squashed down to the same number would produce identical static, and nothing further along would catch it.
This replaces #37. Once a window's static comes from its own position in the world there is nothing left for a per tile seed to do, so #37 should be closed rather than built.
Testing: