So, first, love this series of videos. Learning so much. Thanks!
Now, bug report.
When north-south wrapping is turned on the Hex.GetNeighbours() function returns "incorrect" values when the origin Hex is in a corner. Specifically when the origin is 0,0. I have not had time to test the other corners, but given the nature of the issue I imagine they all have the same issue. In fact, my best guess is any coordinate along the north or south borders will suffer from this.
So, on a Rows = 30 by Columns = 40 map, if your origin Hex is 0,0 and you enable East-West and North-South wrapping, then the tiles surrounding 0,0 in function order are
1,0 39,0 0,1 25,29 26,29 39,1
however, the results of Hex.GetNeighbours() are
1,0 39,0 0,1 0,29 1,29 39,1
So we can clearly see the issue is with the two R minus 1 coordinates. If you turn wrapping off you can clearly see why the GetNeighbours values are chosen. The values make sense mathematically with the skewed (rhomboid?) shape. But visually they are incorrect. And from a user's perspective nobody cares about the correctness of the math as their units are jumping all over the board for no apparent reason.
I'll continue to work on this, but I'm not sure if my math skills are up to snuff.
Keep up the fantastic work!
So, first, love this series of videos. Learning so much. Thanks!
Now, bug report.
When north-south wrapping is turned on the
Hex.GetNeighbours()function returns "incorrect" values when the origin Hex is in a corner. Specifically when the origin is 0,0. I have not had time to test the other corners, but given the nature of the issue I imagine they all have the same issue. In fact, my best guess is any coordinate along the north or south borders will suffer from this.So, on a Rows = 30 by Columns = 40 map, if your origin Hex is 0,0 and you enable East-West and North-South wrapping, then the tiles surrounding 0,0 in function order are
however, the results of
Hex.GetNeighbours()areSo we can clearly see the issue is with the two R minus 1 coordinates. If you turn wrapping off you can clearly see why the
GetNeighboursvalues are chosen. The values make sense mathematically with the skewed (rhomboid?) shape. But visually they are incorrect. And from a user's perspective nobody cares about the correctness of the math as their units are jumping all over the board for no apparent reason.I'll continue to work on this, but I'm not sure if my math skills are up to snuff.
Keep up the fantastic work!