MegaMek / megameklab

MegaMekLab is a BattleTech unit modification program. It allows creating and modifying all unit types available in MegaMek from Support Vehicles up to WarShips. It also allows printing record sheets for single or multiple units.
http://www.megamek.org
86 stars 129 forks source link

Add experimental option for drawing armor pips in groups of 5 #1598

Closed pavelbraginskiy closed 6 days ago

pavelbraginskiy commented 1 month ago

Many people prefer the armor pip layout used by programs like Flechs, which renders armor pips in clusters of 5.

This pull request adds an option to attempt to render the armor pips in a similar fashion.

Even with the option enabled, not all unit types are supported, units where the alternate pip-placement method is known to not work well will always use the old drawing method.

Sometimes adding pips in groups of 5 fails, in which case the code simply falls back to the old method.

The option to enable this method is clearly marked as Experimental so people don't think this feature is guaranteed to produce good results. A future version of MML will remove the Experimental marker and have better support for more units.

I've playtested these sheets on the tabletop with players at my local LGS where they've been generally very well-received.

The following sheets have dedicated support, with custom pip layout hints:

The following sheets might be supported in the future, but are extremely rare and work ok without dedicated support:

The following units aren't supported, and armor pips will not be attempted to be drawn using the new method. These units mostly just have a completely different conception of how armor pips work for them, but for ProtoMeks specifically, it's because applying this method to their armor diagram causes the code to fail spectacularly in a way I haven't been able to really fix.

And now, some example record sheets:

image

image

image

image

image

image

image

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 2.16%. Comparing base (f3645a6) to head (7119d96). Report is 42 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1598 +/- ## =========================================== + Coverage 2.15% 2.16% +0.01% - Complexity 205 208 +3 =========================================== Files 266 266 Lines 30638 30731 +93 Branches 5236 5255 +19 =========================================== + Hits 660 666 +6 - Misses 29825 29909 +84 - Partials 153 156 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pavelbraginskiy commented 1 month ago

Thanks to TimberwolfD1 for providing SVG work to better support this armor layout scheme.

rjhancock commented 6 days ago

Just did a sanity check on code.