Why is one of my Feebas tiles on the ground?
This is not a bug in the calculator, this is a bug in BDSP. For some reason, the 4 ground tiles on the south side of the big rock can be selected as Feebas tiles, even though they can't be fished. This will affect at most one tile per day.
I only see one (or no) green square?
It is possible that two of the potential tiles overlap. In this case, one of the red squares is guaranteed to work.
How does this work?
See the How this Works section below.
Why are there two sets of tiles?
The lottery number only gives us enough information to narrow down two of the four Feebas tiles with 50% certainty. See the How this Works section below for more details.
Why are there some tiles where Feebas never appears?
Due to weird edge cases in the algorithm used by BDSP, there are 7 tiles where Feebas will never appear. Overall, the code in BDSP seems way buggier than the approach used in DPPt.
I checked both red and green tiles, and can't find Feebas?
Make sure you're fishing the correct tile; your character should be on an adjacent tile, and your fishing bobber should be on the Feebas tile. Remember that even if you're fishing the correct tile, Feebas still only has a 50% spawn chance, so keep trying.
If you're very sure that none of the tiles are working, double check that your lottery number is correct. It's also possible that we missed something in reverse engineering the algorithm, and there's a bug in the calculator. Furthermore, this tool is based on v1.1.1 of the game, so a new update may have changed the algorithm.
Both the lottery number and Feebas tiles are based on the group seed. This is a number that is randomly generated once when you create your save and each time you create a new group. When other players join your group, their group seed is updated to match yours. Each day, this value is progressed following a predictable pattern (unimportant to this tool).
The lottery number is computed as
(group_seed * 0x41c64e6d + 0x3039) & 0xffff
.
Using this, we can calculate the 2 low bytes of the group seed as
(lotto * 0xeb65 + 0xa683) & 0xffff
(since the multiplicative inverse of 0x41c64e6d
is 0xeeb9eb65
and 0xeeb9eb65 * -0x3039 = 0xfc77a683
).
The 4 Feebas tiles are each based on one of the 4 bytes of the absolute value of the group seed. First, 4 indexes are calculated:
(abs(group_seed) >> 24 & 0xff) % 0x84
(abs(group_seed) >> 16 & 0xff) % 0x84 + 0x84 + 1
(abs(group_seed) >> 8 & 0xff) % 0x84 + 0x84 * 2 + 2
(abs(group_seed) & 0xff) % 0x84 + 0x84 * 3 + 3
Since we have the two low bytes of the group seed from the lottery number, we can find 2 Feebas tiles (in the bottom half). Due to the absolute value, we have two possible possitions for each tile (since we don't know the high bit of the group seed). This tool simply calculates the four possible values, two for each of the low bytes of the group seed.