Closed andersfischernielsen closed 3 years ago
Identified bug: All tiles have been placed according to the rule (don't place harbor next to harbor), and no spaces are left for them to be placed. So in the current algorithm for placement, we fail due to the order of placing harbor.
When generating a random board, the harbors surrounding the board are supposed to be generated such that every other ocean tile is a harbor.
We currently do this by checking whether surrounding tiles for a given ocean tile are already a harbor and if not, then we make the current tile a harbor.
https://github.com/Colonists-Game/Colonists/blob/6ddb7fdbeed99cb488d00fc92d1675cdde212002/colonists-shared/lib/WorldGenerator.ts#L128-L140
For some reason, this check evaluates to
true
in certain cases where it should befalse
. See this (incorrect) result: