Skip to content

Add a basic minimap subsystem#396

Open
septavios wants to merge 13 commits into
vE5li:mainfrom
septavios:feature/minimap-pr-local
Open

Add a basic minimap subsystem#396
septavios wants to merge 13 commits into
vE5li:mainfrom
septavios:feature/minimap-pr-local

Conversation

@septavios
Copy link
Copy Markdown

@septavios septavios commented Apr 6, 2026

Summary

  • adds an initial in-game minimap implementation
  • splits minimap logic into dedicated modules for generation, projection, markers, and rendering
  • stores minimap state separately from the window implementation
  • opens the minimap automatically in-game and allows toggling it from the UI
  • uses a generated fallback texture derived from map tile data
  • renders the local player and visible entities on the minimap
  • supports zooming in the minimap window

Notes

  • this implementation uses generated map imagery
  • marker rendering is still basic
  • no quest, NPC, or warp overlay data yet
  • no packet-driven minimap markers yet

Testing:

  • Tested on mac m3 pro.

In game screenshot
image
image

Validation

  • cargo check --release
  • cargo clippy --release --no-deps

@eleriaqueen
Copy link
Copy Markdown
Contributor

eleriaqueen commented Apr 7, 2026

Hi, I tested the PR in game and player direction arrow/indicator on the map is flipped.
Edit: The minimap itself might be flipped ? (See this screenshoot where minimap and actual buildings don't match at all)
Screenshot_20260407_141545

@septavios
Copy link
Copy Markdown
Author

Hi, I tested the PR in game and player direction arrow/indicator on the map is flipped. Edit: The minimap itself might be flipped ? (See this screenshoot where minimap and actual buildings don't match at all) Screenshot_20260407_141545

image image

Hi, thanks for testing, ya this is a bug. will fix it.
attached is my local test with the new fix.

Copy link
Copy Markdown
Author

@septavios septavios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

56bcce6 (“Fix minimap generated texture Y-axis flip”)

Copy link
Copy Markdown
Author

@septavios septavios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a fix for the minimap flip: the generated minimap texture Y axis was inverted vs tile/world coordinates. New commit: 56bcce6. Please retest: minimap orientation + player arrow should now match the world.

@septavios septavios marked this pull request as draft April 7, 2026 13:51
@septavios
Copy link
Copy Markdown
Author

image
  • Improved Player Marker (Dynamic Arrow):
  • Replaced the text-based arrow fallback with a crisp, dynamically rendering SDF texture ( arrow_right.png ).
  • Adjusted the SDF rendering bounds to stretch the arrow into a sharp, clear pointer shape.
  • Re-colored the player marker to Bright Yellow for high contrast against the minimap terrain.

@septavios septavios marked this pull request as ready for review April 7, 2026 16:00
@eleriaqueen
Copy link
Copy Markdown
Contributor

eleriaqueen commented Apr 8, 2026

Can't compile.
Screenshot_20260408_043127

Changing code to this (adding rotation: 0.0,) gets it to compile, but the "arrow" shape does not loog good, it is a bit too big, and does not point in the player's direction (it points in a slightly off direction):

 self.instructions.borrow_mut().push(RectangleInstruction::Sdf {
          screen_position,
          screen_size,
          color,
          texture_position: Vector2::new(0.0, 0.0),
          texture_size: Vector2::new(1.0, 1.0),
          texture: texture.clone(),
          rotation: 0.0,
});
Screenshot_20260408_045127

Otherwise the map part of the minimap looks fine now. It is no longer flipped.
Thank you for your efforts so far.

@septavios
Copy link
Copy Markdown
Author

Fixed in the latest commit.

Summary:

  • Added the missing rotation field for RectangleInstruction::Sdf, which resolves the compile error.
  • Removed the minimap arrow’s incorrect camera-based rotation adjustment.
  • Corrected the player arrow rotation so it points in the proper direction on the now-unflipped minimap.
  • Tuned the arrow size/shape and added a darker arrowhead overlay to make the tip direction clearer.
  • Please test again when you get a chance — especially cardinal directions and diagonals on the minimap.
image image image

@eleriaqueen
Copy link
Copy Markdown
Contributor

eleriaqueen commented Apr 8, 2026

Hey thanks for the update and for your work.
I'm not the maintainer of the repo btw so take my mind with a grain of salt but I'm gonna be honest and say the representation of the character's orientation (the "arrow") in your PR currently doesn't look good.
Its orientation is still a bit confusing (It doesn't look like a "real" rotation of your triangle shape ?), I don't think I know the right terms neither in English nor in my native language to explain the issue(s).

I would appreciate if someone else could maybe chime-in and give their thoughts ?

That being said:
The very first PRs might have looked slightly funny because you were using unicode characters or something but they had one key benefit which was that the shape of that arrow looked "correct".
It wasn't visible enough, not thick enough, maybe also not the right colour but when I managed to see the indicator on the minimap it was clear as day where it pointed.

Here is an ingame screenshot for people who don't want / can't run Korangar with the changes.

Screenshot_20260408_215931

@eleriaqueen
Copy link
Copy Markdown
Contributor

eleriaqueen commented Apr 8, 2026

I threw this together quickly to try and hopefully illustrate the confusion of my brain trying to "read" the direction indicator. This might also be just a "me problem", again take with a grain of salt.
korangar-direction-indicator-confusion

@septavios
Copy link
Copy Markdown
Author

I threw this together quickly to try and hopefully illustrate the confusion of my brain trying to "read" the direction indicator. This might also be just a "me problem", again take with a grain of salt. korangar-direction-indicator-confusion

The dark spot means its heading for Direction 2.
if the currently direction implementation is not that useful, maybe can just a round icon just to indicate the player position minimap.

Alternative is revert to the arrow using uncode if its better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants