Repository navigation
feat(map): add in-game territory map backed by Wynncraft API - #66
Merged
Merged
Conversation
… WebP->NativeImage copy
…nd harden bounds/texture
…R, and compass ping
…ed camera, shrink small tags
…r-1 cutoff to Fit
This was referenced Dec 1, 2026
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.
Summary
Adds an in-game interactive Territory Map screen (
TerritoryMapScreen) modeled after EdenWeb's territory map, fetching data directly from the Wynncraft API with zero EdenBot WebSocket changes (mod_versionremains1.6.6).Data Sources & Client-Side Tower Estimation
TerritoryMapService): Fetcheshttps://api.wynncraft.com/v3/guild/list/territorydirectly usingTlsPolicy.newHttpClientBuilder()with a 15s TTL cache, single-flight coalescing, 4 MiB response cap, HTTP429Retry-After/ error backoff, 10-minute post-close warm background polling + single pre-warm on Wynncraft join, and stale snapshot fallback.https://athena.wynntils.com/cache/get/territoryListin parallel (5m TTL, independent failure backoff) for registered guild colors, falling back toTerritoryMapData.hashedRgbwhen unavailable.TerritoryMapService): Fetcheshttps://api.wynncraft.com/v3/guild/seasons+/v3/leaderboards/guildSeason<N>?resultLimit=25on a 5-minute TTL (with 60s error backoff and last-good fallback).TerritoryTowerEstimator): PortsEdenWeb/lib/wynn/tower.tsusing a rolling 8-snapshot buffer to solve global resource-tick phase and estimate tower levels & economy bonuses (TOWER STATS (<active routes>)).TerritoryMapTexture+TerritoryMapTiles):wynncraft_map_overview.jpg(1152×1661,446 KB, replacing the2.0 MBWebP) pre-decoded off-thread on WynncraftJOIN(prewarmOverview()) and always rendered underneath so fresh opens never show a black terrain flash (~7.6 MBVRAM atFit).Main *andRealm of Light, parsed/validated fromReference/maps.json) streamed only when zoomed in (camScale >= 0.45f) for tiles intersecting the viewport.<gameDir>/wynntils/cache/dataStaticMapsand<gameDir>/wynntils/cache/maps/<md5>.pngread-only with MD5 verification before falling back to<gameDir>/config/edenmod/cache/maps/and CDN (cdn.wynntils.com/static/) -> GitHub mirror (raw.githubusercontent.com/Wynntils/Static-Storage).MAX_GPU_TILES = 8LRU cache while open; both Tier-0 and Tier-1 textures release cleanly on disconnect and after 10 minutes idle (releaseNow()).TerritoryMapData): Drops malformed territories outside[-100_000, 100_000]before spatial grid insertion.Features & Gating
J(key.edenmod.open_territory_map, tap-to-toggle),/eden map, and"Territory Map"button inEdenMenuScreen.MAP_MARGIN = 14,FRAME_THICKNESS = 4) leaving surrounding gameplay visible (isPauseScreen() == false, transparent background), plus Wynntils-style WASD movement pass-through while unfocused.DEFAULT_PLAYER_ZOOM = 0.75f) when no camera is saved yet and player is inside map bounds, then restores the player's last saved pan/zoom across reopens — including after visiting out-of-bounds areas (e.g. raids/housing/lobby) and returning (saveCameraOnCloseprevents out-of-bounds fallbackfitAllfrom overwriting the saved camera, andcenterOnPlayer()ignores out-of-bounds clicks; only account changes clear saved camera).TAG_SCALES:1.0->0.85->0.7->0.55) on tight territories before dropping the label.STORAGE/PER HOURresource progress bars with compact formatting (400k,16.8k) and+gen/—.20pxhigh; expands upward on click withTerritoriesandSeason <N> SRtabs, rank, color swatch, value, green+lead/tied, season countdown, and click-to-spotlight).Emeralds,Ore,Wood,Fish,Crops+2xbadges), Wynntils-style cycling tier filters (Def&Tres, Left/Right/Shift/Ctrl/Middle, cycling cleanly toOFF),+/-zoom shortcuts,16x16player skin head cursor, cooldown perimeter drains,Shift + Right-Click->/gu territory <name>, andMiddle-Click/Compassbutton ->/compass <worldX> <worldZ>with an orb pickup ping sound.mod.isFullMember().AttackTimerMenuWarBoard attack borders & countdowns are shown only to full members.Verification
.\gradlew.bat build --console=plain:BUILD SUCCESSFUL(spotlessApply,compileJava,compileGametestJava,spotlessCheck,check,remapJar,test,build).build/test-results/test/*.xml): 83 suites, 546 tests, 0 failures, 0 errors, 4 skipped (unrelated upstream tests), includingTerritoryMapDataTest(9 passed) andTerritoryTowerEstimatorTest(2 passed).git diff --name-only upstream/master -- gradle.properties src/tel/eden/mod/net/ test/tel/eden/mod/net/is empty.