RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
787 stars 259 forks source link

[Refactoring]: Internal Hex Grid Coordinate Change #4930

Open ColdAnkles opened 1 week ago

ColdAnkles commented 1 week ago

Describe the problem

Discussion in #4886 revealed some distaste for the offset coordinate system used by MapTool for hex grids. (off-q, or off-r)

The improvement you'd like to see

It is suggested to move to cubic coordinates instead of offset.

Expected Benefits

This should simplify the java side coordinate math, since no offset maths would be required any longer, and vectors would just work. Display coordinates could then be implemented for graphs, allowing for options such as the existing offset system, cubic, or axial. Also allowing for y-up instead of the current y-down.

Additional Context

Coordinate vector math would also no longer need to care about handling offsets wherever it is - entities dealing with coordinates don't care about the grid and what offset it is.