Add building auto-detection for map preview overlays and fix incorrect starting locations - #1023
Draft
11EJDE11 wants to merge 1 commit into
Draft
Add building auto-detection for map preview overlays and fix incorrect starting locations#102311EJDE11 wants to merge 1 commit into
11EJDE11 wants to merge 1 commit into
Conversation
…ate starting locations
|
Nightly build for this pull request:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds automatic detection of building for overlays on the map preview. These are defined in
ClientDefinitions.ini:To do it properly we need to read IsoMapPack to get the building's level, otherwise the overlays will be offset if the buildings are on cliffs. Because we're reading IsoMapPack, we can also fix the issue where starting locations are incorrect due to cliffs.
Adds a new cache
map_tile_levels_v1shared across official and custom maps. Invalidated with size+last write time.Performance wise, we directly scan the maps for IsoMapPack5 and Structures. It takes about 11 seconds to build a cache for 6,000 maps on my system. No noticeable impact on startup time once cached.
The building ID allows for a wildcard. Some blitz maps for example have several types of oils so you can catch all with
CAOILD*:You can also specify an owner. So setting to
Neutralwould ignore pre-captured oils, and you'd only get overlays on capturable ones.The tile offset parameters help with centering the overlay better on the building - but the whole centering thing probably needs a second look. The info might already be available without needing to manually specify it.
I still need to test downloaded/sharing maps.
And note we can't get it perfect for every map. Some previews are just incorrectly scaled (not our fault) - all the main ones shipped in YR seem OK, or at least within range.
CC: #775