It's to do with how the game manages the base map. To us, we see a 2d map of 6x6 modules. We can work with any part of the map by going directly to it with its row and column coordinates. Note that Row and Column coordinates start from 0, so the the top-left most module is (0,0), and the bottom right most module is (5,5).
The game however handles the map as a 1d map. A continuous series of all 36 modules. If we laid it out flat with each module location numbered in numerical order starting from 0, it would look like:
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
To us, the 2d map is laid out like so:
00 01 02 03 04 05
06 07 08 09 10 11
12 13 14 15 16 17
18 19 20 21 22 23
24 25 26 27 28 29
30 31 32 33 34 35
To access the module at any particular row or column, The game uses the following formula:
(Row x 6) + column
6 is the map width.
Say you want to access the module at row 2 column 1 (or three down, two across). We would have (2 x 6) + 1 = 12 + 1 = 13 .
When placing a hangar, you're placing the top-left quarter. The three other quarters are offset from this. With the 2nd quarter being +1 column, 3rd quarter being +1 row, and 4th quarter +1 row, +1 column.
Let's say we're placing a hangar at the previous example of row 2 column 1:
Quarter 1 (2, 1) = (2 x 6) + 1 = 12 + 1 = 13
Quarter 2 (2, 2) = (2 x 6) + 2 = 12 + 2 = 14
Quarter 3 (3, 1) = (3 x 6) + 1 = 18 + 1 = 19
Quartter 4(3, 2) = (3 x 6) + 2 = 18 + 2 = 20
If you look at the 2d map, the hangar would therefore be occupying locations 13, 14, 19 and 20.
Now, with the bug, what happens if you place the top-left quarter along the last column? Let's say we put the hangar down at the end of the top line of the base at row 0, column 5
Quarter 1 (0, 5) = (0 * 6) + 5 = 0 + 5 = 5
Quarter 2 (0, 6) = (0 * 6) + 6 = 0 + 6 = 6
Quarter 3 (1, 5) = (1 * 6) + 5 = 6 + 5 = 11
Quarter 4 (1, 6) = (1 * 6) + 6= 6 + 5 = 12
Technically the column should never be able to go beyond 5. But as the three other quarters are offset from the quarter you set down, the column ends up going beyond the map width. It doesn't go off the map as such but instead is pushed to the start of the next row down. So 5 and 11 are placed just fine, but 6 and 12 end up on the other side of the base, shifted down one line.
That's it really. And yes, placing a hangar at 29 or 35 would result in the game overwriting whatever is in memory immediately after the base map, which isn't good at all.
- NKF
NKF - finally built a gaming PC in 2020 (though not any of that RGB nonsense). Can now play games up to '89!