Maphack: real wall transparency via a second layered window#174
Draft
imm0r wants to merge 1 commit into
Draft
Conversation
In labyrinth-style map layouts the maphack draws many wall outlines in a small area, and every border pixel is fully opaque (colour-key rendering has no per-pixel alpha) — real in-game enemies underneath become hard to see. The one global window alpha is no fix because it also dims the radar dots and labels. Exploit the one real transparency the model offers: a whole layered window has its own LWA_ALPHA. RadarOverlay now owns a second click-through layered window (_Ml* helpers) kept directly below the radar window in the topmost band; when the new wall alpha g_mapHackAlpha is < 255, the map layers (wall borders + unexplored wash) render into that window's own back-buffer — same scroll cache, same HUD/loot-label clip exclusions — and genuinely alpha-blend with the game underneath, while dots/labels on the radar window keep full opacity. At the default alpha 255 the layers draw into the radar back-buffer exactly as before (zero extra cost), and any window/buffer creation failure falls back to the classic path. The layer window hides on any frame that did not use it and follows radar hide/teardown. Wiring: [Radar] mapHackAlpha persistence, SetMapHackAlpha bridge case, mapHackAlpha header key, and a "Wall opacity" slider in Config -> Overlay -> Map Hack (hidden for the GGPK source, which it does not affect). Co-Authored-By: Claude Opus 4.8 <[email protected]>
4 tasks
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
In labyrinth-style map layouts (many nested narrow corridors) the memory maphack draws so many wall outlines in a small screen area that real in-game enemies underneath become hard to see. Every border pixel is fully opaque, because the radar overlay uses colour-key transparency (
LWA_COLORKEY+ one globalLWA_ALPHA) — there is no per-pixel alpha, and lowering the one global alpha would also dim the radar dots and labels.This PR adds the one form of real transparency the model does offer: per-layer alpha via a second layered window.
RadarOverlaynow owns a second click-through layered window kept directly below the radar window in the topmost band. When the new wall alpha (g_mapHackAlpha, 20–255) is below 255, the map layers (wall borders + unexplored wash) render into that window's own back-buffer and genuinely alpha-blend with the game underneath — enemies stay visible through dense wall clusters — while dots, labels and paths on the radar window keep full opacity. At the default 255 nothing changes: the layers draw into the radar back-buffer exactly as before (zero extra cost), and any window/buffer creation failure falls back to the classic path.Changes
ahk/RadarOverlay.ahk— new_Ml*helpers (lazily created layer window, back-buffer, present/hide/destroy); the large-map layer draw routes into the layer window wheng_mapHackAlpha < 255;_DrawMapLayersCached/_DrawMapLayersDirectgained an optional target-DC parameter (shared scroll cache untouched); HUD + loot-label clip exclusions are collected per frame and applied to both destinations;_FinishFramehides the layer window on any frame that did not use it;Hide()override + destructor cover teardown.InGameStateMonitor.ahk— seedg_mapHackAlpha := 255; version bump to 0.45.13.299.ahk/ConfigManager.ahk— persist[Radar] mapHackAlpha(clamped 20–255).ahk/BridgeDispatch.ahk— newSetMapHackAlphabridge case.ahk/WebViewBridge.ahk—mapHackAlphain the header push.ui/index.html— "↳ Wall opacity" slider under Config → Overlay → Map Hack (liveoninput, % bubble, activeElement guard on header sync); hidden while the maphack source is "ggpk" (the slider only affects the memory overlay).CLAUDE.md/README.md— feature documentation + version sync.Test plan
node --checkon the extracted inline UI script;<div>balance unchanged vs. HEAD; CRLF preserved inBridgeDispatch.ahk/WebViewBridge.ahk.Notes for the reviewer
SetWindowPosinsertAfter=radar); inserting after a topmost window keeps the layer in the topmost band.🤖 Generated with Claude Code
https://claude.ai/code/session_013UCQfY5KTNcmggpfapfciC
Generated by Claude Code