MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
133 stars 171 forks source link

Strategic grid system - use Delaunay/TIN rather than fixed hexes #2527

Closed SuperStucco closed 3 years ago

SuperStucco commented 3 years ago

The strategic grid system as presented in Interstellar Operations, shown on the Interstellar Map tab with the ISW toggle, uses a basic hex grid. This is a good compromise for simplified tracking and is thematically consistent with BattleTech, but to me falls a little short for this type of map.

What I'd like to see is the system map on the Interstellar Map tab divided into sectors using Delaunay triangulation/triangulated irregular network (TIN)/Voronoi diagramming (see https://en.wikipedia.org/wiki/Delaunay_triangulation) as an alternative the fixed hex grid. This creates areas of control with only one system at the center, with the boundaries and overall size relative to the nearness of other systems.

There is no question about whether a system is in one sector or another. With only one system to determine control, there is less need for multi-color striping to indicate contested areas (only for actually contested or shared systems). For example, with Taussen being in the same sector as Tiskilwa and Scudder it's automatically marked as shared/contested on the current map even though that's clearly not the case. It is much easier to generate and see lines of communication, national boundaries, and contested areas, which would be highly useful for any future strategic-level ISaW gaming elements.

There are a few downsides. While the tessellations are fixed and can be pre-computed, they require storing multiple coordinates to define each sector boundary - typically five or six vertices and potentially more. As this is not a regular grid, finding adjacent sectors is not a matter of computing coordinates but instead must rely on stored lists. Boundary systems on the edge of the Periphery and systems created for transit purposes to remote areas require special handling to avoid calculating overly large sectors. While it's possible to handle sectors of any size as long as they have different coordinates, at the scale this is for it would make sense to treat some extremely close systems (e.g. Taurus/Hyades Cluster) as a single sector.

Windchild292 commented 3 years ago

IO pg 345 states 30 light year hexes.

We are a small dev team that handles this in our spare time, and we do not have the time to handle large unofficial projects like this. Feel free to submit a PR containing tested code that implements this in an optional format, but otherwise this will not be implemented.