ckosmic / SliceDetails

A Beat Saber mod that lets you view your average cuts per-angle per-grid position in the pause menu and completion screen.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arrow pointing wrong direction

yoeyyutch opened this issue · comments

I noticed that one of the arrows on the result screen seem to be pointing in the wrong direction. I've only noticed it for noteGridPosition: (0,1) i.e. (left lane, middle row) and only on the left direction tile for both red and blue. Sorry if my description is kind of awkward. It should be pretty obvious in the screenshot.
OculusScreenshot1638113432

I tried looking through your code to figure it out, but to no avail. You really did a nice job on this though. I've been tinkering around with this concept for quite some time but never got this far. It's almost exactly what I imagined mine would be (if I ever finished it.) Thank you very much for your effort!

commented

Made a quick test map that slices through each direction (dot included), for each grid location, for both hands, and they all registered correctly.

It sure is a mystery why this issue is almost entirely confined to left direction notes in the left lane.
I've got some leads (more like hope) in solving it thanks to your code and Zenject helping me to revive my old dead mod. I can use that to analyze some note stats on a more granular level. I'll keep you posted if I come up with something.

it seems to go haywire when I vary my swing angle. I attached the stats in case you want to try plugging numbers into your angle averaging calculations. Mirrored the map and the arrow was correct when i varied swing angle on the right. interesting. back to,the game
SDtest_01.txt
OculusScreenshot1643343437
OculusScreenshot1643344952

I found the problem.
Line 54 in NoteRecorder:
float cutAngle = Mathf.Atan2(cutDirection.y, cutDirection.x) * Mathf.Rad2Deg + 90.0f;
It bounces between +180 and -180 when a vector points left (i.e. when x is negative and y approaches zero).

Awesome, and I'm able to reproduce it as well. I'll take a look at this.

Okay, this issue has been fixed in 556efff. Thanks for your help

I put in a pull request to simplify the angle averages. No more trig functions!
That was my first pull request I've attempted. And I thought to myself, maybe I should test this out. So I did and the arrows were pointing every which way, but it was actually a simple fix in NoteUI.

I wasn't sure whether I should comment out the code I changed or if I should delete it. I commented it out this time but I'm curious to know what you prefer or what is generally preferred among seasoned programmers.