Virtuoel / Pehkui

Fabric/Forge/NeoForge/Quilt mod that allows for changing the size of any entity.
MIT License
91 stars 34 forks source link

Tweak vehicle height offset positioning #431

Closed chyzman closed 1 year ago

chyzman commented 1 year ago

Forgive me if I'm wrong, But isn't this a much better way of scaling HeightOffset? (It's not perfect but it's better I think)

Virtuoel commented 1 year ago

The goal with the existing impl is to offset downward from the top of the vehicle's hitbox, as opposed to a simpler impl like this offsetting upward from the bottom of the hitbox. From my testing, offsetting from the very top was not ideal, and from the bottom was way too low, so I just picked an arbitrary position a bit closer to the top so the player isn't offset too far up or too far down.

chyzman commented 1 year ago

the current impl is way off for both smaller/larger passenger and smaller/larger vehicle, the height is almost like the inverse of what it should be (larger passenger is lower instead of higher/larger vehicle means higher passenger instead of lower), my impl is closer to being correct, albeit still not the greatestâ„¢

Virtuoel commented 1 year ago

Hmm, maybe I'm misremembering. Still, I do agree that this is definitely one of the areas of the code I should revisit some time soon.

Virtuoel commented 1 year ago

Turns out my testing was all being done with shorter vehicles like boats and minecarts, and not with e.g. horses, so I was missing those scaled offset inaccuracies during my initial calculation design. Since updating my tests and after some tinkering, I've figured out some fixed calculations to better handle both shorter and taller vehicles as well as varied scales of both, which'll be in the next release whenever that happens.