Map: zoomed-view symbols centred, 10x reveal and enemy range; progress screen on the menu background

- Megamap / TAB map zoomed view: heroes' markers and the other symbols
  (integer 200h centre immediates) follow the view's centre.
- Map reveal: the hero's reveal stamp scaled 10x (mods/mapreveal.cpp,
  docs/map-reveal.md); creatures on the zoomed map shown within 10x the
  sight range.
- Load / save progress screen drawn on the rock background across the full
  width, the picture blended over it (mods/loadingscreen.cpp); the classic
  1024x768 frame is gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-25 02:07:59 +02:00
1 parent 3f03228c29
commit b452558122
18 files changed
+435 -40

No files matched your search

+2
View File
@@ -101,6 +101,8 @@ widened instead, when the render size is applied (`PatchLayout`):
| view centre (zoom frame, centred image) | 0x6ca53f, 0x6ca637, 0x6ca645 | 0x200 | width / 2 |
| scroll centred on the hero; zoomed view; its quest markers | `[0x88e6fc]` (512.0) at 0x6c7bfe, 0x6cb27a, 0x6ccb7f, 0x6cf782 | 512 | own float |
| zoomed view: other markers at 768 − d (centre + 256) | `[0x890040]` (768.0) at 0x6ce156 | 768 | width / 2 + 256 |
| zoomed view: heroes' markers, 6 px quad at d + 509 / 515 (2026-10-25) | `[0x894780]` (509.0) at 0x6cf1bd, `[0x894778]` (515.0) at 0x6cf1dd | 512 ± 3 | centre ± 3 |
| zoomed view: other symbols (quad, icons, labels) as integers (2026-10-25) | mov / add reg, 200h at 0x6ced82, 0x6cedb0, 0x6cf47a, 0x6cf4ac, 0x6cf5e4 | 0x200 | centre, rewritten when it changes |
| dark band, right outer / inner edge | vertex immediates 0x6ca774, 0x6ca808 / 0x6ca7bc, 0x6ca84c | 1024 / 954 | width / width − 70 |
The frame is child statics of the window (vector at +0x78..+0x7c; measured:
+44
View File
@@ -0,0 +1,44 @@
# Map reveal (fog of war)
## Request (2026-10-25)
"Can we increase the base vision range (for map fog of war reveal) by x10 or
so?"
## Measured
- Each sector (64x64 tiles) keeps a 32x32 bit mask at +0x180 (128 bytes, one
bit per 2x2 tiles): `Sector_SetExplored` 0x622bf0, copied out by 0x622c60,
loaded from the save by 0x622c80 (0x606ae0). The zoomed map view turns it
into its fog texture (FOGOFWAR01.TGA, 0x639030).
- `World_SetExplored` 0x638f00 (thiscall on `*0xad14e0`, (tile x, tile y,
explored), ret 0xc) finds the tile's sector; tiles >= 0x2000 and sectors
that aren't loaded are ignored.
- `RevealAroundHero` 0x599730 (creature thiscall (tile x, tile y, sight), ret
0xc), called from about ten places in the creature code: only for the local
hero, only when its tile changed (last tile 0xad2384 / 0xad2388), it calls
`World_SetExplored` for every tile of a stamp centred on the hero. Sight 0:
the 29x29 circle at 0x88f5cc (radius 14 tiles). The callers choose 1 or 2
from the weather object (0x417e50: +0x9e0c set -> 2, 0x41ba90 true -> 1);
those use the 15x15 stamps at 0x88f328 + (sight - 1) * 225 (radius 7, 5;
a third one, radius 3, is unused).
## Mod (`mods/mapreveal.cpp`)
After the original revealed at a new tile, the same stamp scaled up 10x is
revealed too, one cell (2x2 tiles) at a time through `World_SetExplored`: by
day a circle of about 140 tiles radius, at night / in fog 70 / 50. About 15000
cells per tile step by day. Sectors beyond the loaded ones are not marked.
## Creatures on the map (2026-10-25)
"Enemies on the TAB map don't show unless in very short range." The zoomed
map view (0x6cc950, large map and TAB map) draws a creature off explored
ground, or a hostile one, only within a sight range of the hero: |dx| and |dy|
(world units, about 53.7 per tile) against a float at [esp+14h], 650 by
default (0x6ce677), 300 where 0x63d280 holds for the hero's area (0x6ce6b5),
350 when the weather object's 0x41ba40 is false (0x6ce6cf), plus a skill
(0x355, 0x570d90) and equipment bonuses. Out of range only the debug flag
0x182cdb8 & 2 shows them. The mod scales the three base values by 10 as well
(about 120 tiles by day). The view only lists creatures of the sectors around
the hero (25 entries at [esp+1ech]).
+18
View File
@@ -88,3 +88,21 @@ window's own pictures removed.
offset 0 while the menu showed. Now only while the menu frame is drawn
centred (it shifts the windows itself); otherwise dialogs are centred and
their full-layout dimming stretched, as in a game.
## Load / save progress screen (2026-10-25)
Request: the progress screen shown while loading / saving should use the
menu screens' background. The game's screen (`DxDriver7::LoadingScreen`
`0x6469d0`, thiscall (progress, text)) draws with GDI into the back buffer's
DC (surface +0xbc, GetDC vf 0x44 / ReleaseDC vf 0x68): the 1024x768 picture
(HBITMAP +0x200) at 0, 0, the bar (+0x204 / +0x208) and the text at y 700,
then Flip; it redraws only when the bar moves. Until now it was presented as
a 1024x768 "classic" frame scaled to the monitor.
`mods/loadingscreen.cpp`: before the game's drawing, `DrawBackground` across
the whole render width in a scene of its own (`DxDriver7` BeginScene
`0x646f50` / EndScene `0x646fd0`); the game's GDI drawing is moved to the
centred 1024 frame with `SetViewportOrgEx` on the back buffer's DC, caught in
`CreateCompatibleDC(hdc)` which the game calls right after getting it. Every
frame is now presented at the full render width (borderless.cpp has one
layout).
+11 -9
View File
@@ -234,15 +234,17 @@ repeatable ones (ids 2600..3599, cloned by Quest_End) and DQ_ dynamic quests;
which of them count for an area, and how the book groups by area, is still to
be measured.
## Megamap zoomed view: markers shifted (2026-10-25)
## Megamap: zoom not centred on the hero (2026-10-25)
Reported: on the M map, clicking a location to zoom in shows the markers on
the zoomed map wrong / shifted (megamap.cpp).
Reported: the zoomed view does not start centred on the hero. The game zooms
on the large map's zoom point +0xc0438 (the mouse position, updated while the
mouse is outside the zoom buttons +0xc0538; 0x6ca47b) plus the scroll. Open:
how the user zoomed (buttons / key / click); then zoom on the hero for
buttons and keys.
## Load / save progress screen: rock background (2026-10-25)
## Inventory drawn without its dark backgrounds (2026-10-25, intermittent)
Reported: the progress screen shown while loading / saving does not use the
rock-wall background of the other menu screens yet (hud::RenderMenuFrame,
docs/screens.md). The GDI progress screen is DxDriver7_LoadingScreen
0x6469d0 (1024x768, game/addresses.h); pictures PAK\loading0/1.bmp,
loadgame.bmp, savegame.bmp, LoadingUW00/01.bmp.
Reported twice: on opening the inventory the item list had no dark
background behind the grid, and the tab texts had an odd background colour.
Looks like render state (texture / blend / colour) left behind by an earlier
draw; not reproduced yet. To find out: what was open or shown just before.
+4 -3
View File
@@ -67,9 +67,10 @@ Elsewhere (unknown / UI, leave alone for now): `0x40694a`, `0x4ec036`,
| `0x006469d0` | loading screen: GDI BitBlt of bitmap + progress bar + text into the back buffer (fixed 1024x768) | render thread |
| `0x006a0c60` | video/intro playback (unexamined) | |
The widescreen mod gives the loading screen a 1024x768 D3D viewport (set at
`BeginScene` when the scene depth `+0x1d8` is 0) and the borderless mod
presents only that area, scaled to the monitor. The main menu thread renders
Since 2026-10-25 the loading screen uses the full render width too: the menu
background is drawn across it and the game's GDI drawing is centred
(mods/loadingscreen.cpp, docs/screens.md "Load / save progress screen"); the
1024x768 "classic" viewport and present are gone. The main menu thread renders
the full width since 2026-10-20: its 1024x768 frame is drawn centred on the
menu screens' background (docs/screens.md, "Main menu frame").