veeenu / eldenring-practice-tool

Elden Ring speedrunning practice tool
GNU Affero General Public License v3.0
226 stars 12 forks source link

fix angle #106

Closed fvlntn closed 3 months ago

fvlntn commented 3 months ago

seems to be working

Vinjul1704 commented 3 months ago

Thanks, looks like it's working. Tested on current patch with crabs and the frog people (or something) in liurnia, as well as soldiers in limgrave.

Might want to change how it's displayed, so instead of "12.34myangle 56.78enemynangle" it could be "Player angle: 12.34° | Enemy angle: 56.78°", but I would say that's up to John.

fvlntn commented 3 months ago

yeah, I didn't know about displaying, so just put that up for debug

veeenu commented 3 months ago

Thank you so much for your contribution! 🚀🚀🚀

I will be able to do a proper review in a few days, but the calculations make sense. I was trying to avoid conditionals but most likely they are totally fine.

I think a compass like visualization would work better, but we can do that in a separate PR.

fvlntn commented 3 months ago

I think you could avoid conditionals by using atan2 like you did and correcting the angle to be 0 at East and going anti-clockwise like in real maths. One more thing is correcting the division by position.z - z which could be zero so one more conditional to write.