Skip to content

StratCon Advanced Terrain #3693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jul 6, 2023
Merged

Conversation

NickAragua
Copy link
Member

Fix #3669 (not really, but I want it to auto-close when this is done)

When completed, this pull request will give StratCon the capability to generate a substantially greater variety of terrain. A few highlights:

  • Each track has an average temperature (based on average planetary temperature +/- 35)
  • The track's temperature determines the available biomes (a cold track will have cold biomes, a hot track will have hot biomes)
  • The biome of a hex on a track determines the map generator preset used to generate maps for that hex
  • For the first time, map themes are used to give a distinct visual look to many of the maps
  • Expect to see jungles, deserts, frozen wastelands and many others

@NickAragua NickAragua marked this pull request as draft June 10, 2023 03:19
@codecov
Copy link

codecov bot commented Jun 10, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.02 ⚠️

Comparison is base (32d19fa) 10.65% compared to head (df8794d) 10.64%.

❗ Current head df8794d differs from pull request most recent head 292c6ee. Consider uploading reports for the commit 292c6ee to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3693      +/-   ##
============================================
- Coverage     10.65%   10.64%   -0.02%     
- Complexity     5472     5473       +1     
============================================
  Files           830      834       +4     
  Lines        113498   113677     +179     
  Branches      17154    17174      +20     
============================================
+ Hits          12097    12099       +2     
- Misses       100194   100372     +178     
+ Partials       1207     1206       -1     
Impacted Files Coverage Δ
MekHQ/src/mekhq/MHQConstants.java 0.00% <ø> (ø)
...hq/campaign/mission/AtBDynamicScenarioFactory.java 0.75% <0.00%> (+<0.01%) ⬆️
...Q/src/mekhq/campaign/mission/ScenarioTemplate.java 0.00% <0.00%> (ø)
...kHQ/src/mekhq/campaign/stratcon/StratconBiome.java 0.00% <0.00%> (ø)
...mekhq/campaign/stratcon/StratconBiomeManifest.java 0.00% <0.00%> (ø)
...campaign/stratcon/StratconContractInitializer.java 0.00% <0.00%> (ø)
...HQ/src/mekhq/campaign/stratcon/StratconCoords.java 0.00% <0.00%> (ø)
.../src/mekhq/campaign/stratcon/StratconFacility.java 0.00% <0.00%> (ø)
.../mekhq/campaign/stratcon/StratconRulesManager.java 0.00% <0.00%> (ø)
.../src/mekhq/campaign/stratcon/StratconScenario.java 0.00% <0.00%> (ø)
... and 7 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Thom293
Copy link
Contributor

Thom293 commented Jun 10, 2023

Oh wow this sounds awesome!

@Thom293
Copy link
Contributor

Thom293 commented Jun 16, 2023

So is the terrain thing in the nightly now or would have to use just the artifact build?

@NickAragua
Copy link
Member Author

Artifact build until the pull request is merged. It's currently missing multiple biome definitions so for a lot of biomes you'll just see the default terrain mix.

@NickAragua NickAragua marked this pull request as ready for review July 5, 2023 20:12
@NickAragua
Copy link
Member Author

All right, this baby's ready for review; code-wise at least. Still waiting on some art assets and map presets, but those don't require code review.

Copy link
Member

@SJuliez SJuliez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, some of this is very specific and hard to read, but no complaints from my side (FWIW). I have some suggestions.

@@ -356,9 +397,17 @@ private boolean drawHexes(Graphics2D g2D, DrawHexType drawHexType) {
}
}

// here we draw the coordinate labels
if (drawHexType == DrawHexType.Hex) {
g2D.setColor(Color.GREEN);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want, it should be possible to replace 402-410 with
new StringDrawer(currentCoords.toBTString()) .at(graphHex.xpoints[0] + xRadius / 2, graphHex.ypoints[0] + ((int) (g2D.getFontMetrics().getHeight() / 1.25))) .centerX() .color(Color.GREEN) .font(g2D.getFont().deriveFont(Font.BOLD, g2D.getFont().getSize())) .draw(g2D);

I had to guess for the x center, but the coords probably look better when x-centered. Also I struggled a bit with the font, as it is not set anywhere. I dont know what the font size is then, I'd guess 12. It could simplify things if the font size were set, e.g. at yRadius/3

float fontSize = yRadius/3;
new StringDrawer(currentCoords.toBTString())
.at(graphHex.xpoints[0] + xRadius / 2, graphHex.ypoints[0] + (int)(fontSize*1.2))
.center()
.color(Color.GREEN)
.font(g2D.getFont().deriveFont(Font.BOLD))
.fontSize(fontSize)
.draw(g2D);

The font and fontSize could be set outside of the loop, making the call simpler.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The font is "whatever is the default"; you do bring up a good point about only setting it once. It looks pretty centered to me for the moment. I can revisit it if people report display issues with it.

@NickAragua NickAragua merged commit cdf6983 into MegaMek:master Jul 6, 2023
@NickAragua NickAragua deleted the terrain_rules branch July 6, 2023 23:20
@HammerGS HammerGS added the StratCon Bugs relating strictly to StratCon label Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
StratCon Bugs relating strictly to StratCon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE - Stratcon - Map Presets
5 participants