una-xiv / umbra

Umbra XIV - Adds quality of life improvements to the game and consolidates common UI elements and actions into a single uniform interface.
GNU Affero General Public License v3.0
83 stars 30 forks source link

Fix: fixed marker direction rendering location. #3

Closed ArchiDog1998 closed 5 months ago

ArchiDog1998 commented 5 months ago

Some players may change the value 3rd Person Camera Angle or use the plugin Cammy to make their character not in the center of the screen.

This change mainly ensures that the Direction Render is more accurate in this situation.

haroldiedema commented 5 months ago

Are you sure about this change? There might still be something missing here.

The first part of this video shows a side offset of 0, when moving to -1 or 1 (halfway the video), the direction marker is off.

https://github.com/una-xiv/umbra/assets/567518/db5ed97a-10fc-48b2-8bb9-c77a5050a8cd

ArchiDog1998 commented 5 months ago

Hi, It seems there are some bugs. Please let me explain what the original issue is.

This is the diagram of the direction marker. The red rectangle means the screen, the yellow one means the screen with Radius, the green curve represents the curve that all direction markers make, the white dot represents the player and the red line with X dot is the case that the angle of the marker is 0.25 * Pi. image

For the original algorithm, in the case 3rd Person Camera Angle is high like me, it would be like this. I think this might be misleading.

image

The goal of this commit is to fix that, and this is the result of the new algorithm.

image

For some unusual situations:

image image

But yeah, there are some bugs. Sorry I didn't test a lot.

Please let me think again about how to solve this problem. It seems that my solution isn't good enought.

ArchiDog1998 commented 5 months ago

Hi, I think I made it with the similar direction-finding algrithm as before. Fixed the compatibility with UseCircularPositioning. And find a better way to calculate the angle for finding the position.

Original New
image image