MachineMuse / MachineMusePowersuits

Minecraft mod, take 2
236 stars 105 forks source link

Kinetic generator jumping #896

Closed ghost closed 5 years ago

ghost commented 5 years ago

If the kinetic generator is set anything above the bare minimum, it causes momentum loss that is disproportionate to the amount of power generated, and is not in line with the movement resistance indicated.

Forge: 2800 Powersuits: 0.7.0.029 Numina: 1.10.0

default config

eyeonus commented 5 years ago

I'm not saying you have to do this, but you said the right way is with the speed modifier, and this is a very, very easy way to have both modules do their thing the "right way", which won't break either module and is compatible with anything else that also messes with the speed modifier.

ghost commented 5 years ago

no offense to anyone, but this seems like it's turned into something akin to two old people bickering//debating something xD

eyeonus commented 5 years ago

You could also have a ModuleManager.computeModularProperty(item, OLD_SPRINT_SPEED_MULTIPLIER) instead if that's easier.

lehjr commented 5 years ago

The fix is already (mostly) implemented in the last commit. It does need some fine tuning to get the speed penalty right for the kinetic generator, but it didn't require any additional tags or much extra code.

eyeonus commented 5 years ago

Well, two mathematicians, or two programmers, taking about how to solve a problem, are pretty much guaranteed to have a debate, and this is a conversation involving BOTH, so twice as likely. :)

eyeonus commented 5 years ago

https://github.com/MachineMuse/MachineMusePowersuits/blob/c14989f57a632b7c6575c02446c437b100aeb9c0/src/main/java/net/machinemuse/powersuits/event/MovementManager.java#L58

Pretty sure that should be multiplier *= 1 - movementResistance; .

If you want the max resistance to make the player move at half speed, then it should be *=

If, however, you want the player to move half a unit slower, then it should be as is.

It's the difference between (assuming max sprint boost is 20x) max sprint boost with max resistance applied making the speed be 19.5 (-=) vs. 10 (*=).

lehjr commented 5 years ago

The multiplier can be zero and anything above zero is a speed boost.

eyeonus commented 5 years ago

I'm not talking about the multiplier. I'm talking about the resistance.

eyeonus commented 5 years ago

Do you want the resistance to slow the player down by 0 - 0.5 units, which is how you have it now, or do you want the resistance to slow the player down by 0 - 50%?

Also, the way you have it now, if the speed modifier doesn't exist yet, and the speed boost is less than or equal to the resistance, which would result in a modifier of 0 or less, the speed modifier isn't added so the slow down that should be happening doesn't: https://github.com/MachineMuse/MachineMusePowersuits/blob/c14989f57a632b7c6575c02446c437b100aeb9c0/src/main/java/net/machinemuse/powersuits/event/MovementManager.java#L75-L77

lehjr commented 5 years ago

The intended operation is that the player base speed should be reduced by 50%. Anyway, I did some debugging and figured out the math for how the attribute modifier should work (it's just added to the player's base speed of 0.1 + 0.3 if sprinting). I should have a new build up later today.

lehjr commented 5 years ago

The speed is now fixed. The walking/sprint assist sliders finally set the the speed as intended.

lehjr commented 5 years ago

Fixed in alpha 30

ghost commented 5 years ago

Can confirm fixed. I also see that the sprint assist no longer equates to "fly across the map assist".