fonnymunkey / RLCombat

A fork of Better Combat Rebirth for the modpack RLCraft
3 stars 1 forks source link

weapon swing sounds are mistimed #14

Open nemesis-vampy opened 2 weeks ago

nemesis-vampy commented 2 weeks ago

swing sounds seem to play after the player's swing has already finished instead of at the start of the swing. happens with all weapons (tested vanilla, spartan weaponry, and s&r parasites) and with both custom and vanilla animations.

fonnymunkey commented 2 weeks ago

The swing sounds are set to play at a certain % of the way through the animation, depending on the animation, such as; https://github.com/fonnymunkey/RLCombat/blob/master/src/main/java/bettercombat/mod/client/animation/AnimationChop.java#L64

However, that only determines the start of the sound playing, and I don't really have the ability to dynamically speed up/slow down the sound itself (afaik), which means with faster attacks results in the sound itself being too late, or slow attack having the sound being too early; I just tried to time it to be somewhat accurate with some default speed weapons.

I'm not the best with perfecting sound-based things, so I'd welcome any PRs if anyone would like to suggest improvements to the sound system, such as changing the sound timestamps on the animations, or adding new sound files.

Ideally, I think the solution to this would be, if its not possible to dynamically change the speed of the sound played, to just have multiple versions of the sound file to be played depending on the speed.