NewGenerationAlms / NgaShareableCode

Code that I, Nga, will share
1 stars 0 forks source link

headarmswing - Better explanation for arm swing speed and maxmovement speed interaction #2

Closed Pondruk closed 4 months ago

Pondruk commented 4 months ago

It is clear that "needed arm movement" and movement speed (for both jogging and sprinting) are interconnected, yet I feel it would be useful to have a little explanation on the mod's Thunderstore page about HOW they interact with each other. For instance: to me it looks like the jogging's speed is divided by the needed arm movement, as setting the latter to decimal values makes the jogging's felt speed skyrocket significally. Perhaps an explanation about how these 2 values interact with each other could be beneficial for custom tweaking said values.

NewGenerationAlms commented 4 months ago

It's a bit hard to explain in Thunderstore, since giving that much detail would be equivalent to just pasting what the code is.
But the reason it feels they're connected is because there's a third "confounding" variable (impetus), which is your actual controller's angular/movement speed, which is divided by needed arm movement (to get a >100% multiplier) which is then applied to the job speed:

float jogSpeed = JogSpeedCap.Value;
float jogMinTrig = JogMinHand.Value;
if (impetus > jogMinTrig) {
    // Sets jog speed scaled up by proportion to min trigger val. 
    float jogScaleUp = impetus/jogMinTrig;
    float final_speed = jogSpeed * jogScaleUp;

Then in order to fix your issue (of using decimal value needed arm movement) you'd have to modify the other config var "Angular Hand Vel Mult" and Lin Mult too.

You are correct that if I were abiding to best game design practices I should handle these vars differently. Specifically, they shouldn't be shown to the player at all, they should've been hidden and instead I should've provided "presets" and simplified variables. But per my signature below I no longer have that much time, so I just provide an initial default preset, and give as much control to let people toy with it :/

These last mods I've been publishing have less user-instructions as I have less time to dedicate to modding and they're mainly to augment my gameplay to my personal preferences. I post the code here so others can copy it and make spinoffs if they like :)

Pondruk commented 4 months ago

And that's exactly why I wanted some more info about how everything was tied together. I can't Unity unfortunately, I can try to read your code and make sense of it over the span of quite some time, but this answer would already be more than enough, so thank you for clarifying.

I'd also like to use this occasion to thank you kindly for your work and for sharing it: I use quite some of your mods and they have improved my experience so much that I could NEVER go back to play without them. Twin Stick arm swinger was one of the few things missing, as I find it way more immersive (and I now also have a reason to actually simulate a jogging/running motion while holding a gun). I have just managed to find a config set that feels almost perfect for me, and I finally had a proper test run in Supply Raid, and OH BOY it's a whole new experience. So again, thank you very much, know that for everything you make in your spare time and share with the H3VR community, the community will appreciate and thank you. ^^