From 25257e15171c6a0a2c08f3639376f92f91b640aa Mon Sep 17 00:00:00 2001 From: Boki Date: Fri, 13 Feb 2026 16:08:51 -0500 Subject: [PATCH] minimap mostly done --- src/Poe2Trade.Navigation/NavigationTypes.cs | 2 +- src/Poe2Trade.Navigation/WorldMap.cs | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Poe2Trade.Navigation/NavigationTypes.cs b/src/Poe2Trade.Navigation/NavigationTypes.cs index 5b1fcf5..9cddf5d 100644 --- a/src/Poe2Trade.Navigation/NavigationTypes.cs +++ b/src/Poe2Trade.Navigation/NavigationTypes.cs @@ -74,7 +74,7 @@ public class MinimapConfig // Wall detection: target #A2AEE5 (blue-lavender structure lines) // HSV(115, 75, 229) — blue hue, low-medium saturation, bright - public Scalar WallLoHSV { get; set; } = new(100, 25, 190); + public Scalar WallLoHSV { get; set; } = new(110, 25, 190); public Scalar WallHiHSV { get; set; } = new(136, 120, 255); // Connected components: minimum area to keep (kills speckle) diff --git a/src/Poe2Trade.Navigation/WorldMap.cs b/src/Poe2Trade.Navigation/WorldMap.cs index bfb8271..f69ed2a 100644 --- a/src/Poe2Trade.Navigation/WorldMap.cs +++ b/src/Poe2Trade.Navigation/WorldMap.cs @@ -241,11 +241,21 @@ public class WorldMap : IDisposable dstRoi.Set(row, col, (byte)MapCell.Explored); // lost confidence → demote } - // Mark fog on canvas: only overwrite Unknown (fog is soft data) + // Mark fog on canvas: only in a ring between ExploredRadius and ExploredRadius+5 + var fogInner2 = _config.ExploredRadius * _config.ExploredRadius; + var fogOuter = _config.ExploredRadius + 5; + var fogOuter2 = fogOuter * fogOuter; + for (var row = 0; row < h; row++) for (var col = 0; col < w; col++) { if (srcRoi.At(row, col) != (byte)MapCell.Fog) continue; + + var fx = srcX + col - halfSize; + var fy = srcY + row - halfSize; + var dist2 = fx * fx + fy * fy; + if (dist2 < fogInner2 || dist2 > fogOuter2) continue; + if (dstRoi.At(row, col) == (byte)MapCell.Unknown) dstRoi.Set(row, col, (byte)MapCell.Fog); } @@ -392,8 +402,7 @@ public class WorldMap : IDisposable colored.Set(r, c, new Vec3b(104, 64, 31)); else if (v == (byte)MapCell.Wall) colored.Set(r, c, new Vec3b(26, 45, 61)); - else if (v == (byte)MapCell.Fog) - colored.Set(r, c, new Vec3b(180, 140, 70)); // light blue + // Fog not rendered — too noisy from spell effects bleeding through overlay } var px = cx - x0;