GsDrunkestDriver / funkin-buttplug

Buttplug support for Friday Night Funkin'!
Other
24 stars 3 forks source link

Note based vibrations #6

Open GsDrunkestDriver opened 1 year ago

GsDrunkestDriver commented 1 year ago

What it says on the tin really, I'd like to get a system going where shit vibrates depending on whether you hit notes or not. My current idea is as follows:

Have a float named 'bpVibeIntensity' which'll store the current intensity that the device should be vibrating at, capped at 100 obviously. On note hit, have bpVibeIntensity increase a small amount, like 7% or so. Over time, bpVibeIntensity should be decaying, at a rate of like 3-6% per second, though tuning will be necessary to get a good balance. While that's happening, send vibration commands based off of bpVibeIntensity every 75ish ms. Will require tuning too.

This way, the vibrations should scale based off of the frequency of hit notes, leading to larger intensities on faster streams or jumps or chords or whatever. Might need to look into some fancy maths shit, as I'd like the intensity to decay faster if it's larger, otherwise a pattern that'd get a device to 100% intensity will take fucking ages to stop. Maybe look into how beat zooms are handled in playstate?

GsDrunkestDriver commented 1 year ago

After looking more into the beat zoom shit, lerping seems to be the best way to go. Will require some testing and tuning to get a ratio that's both smooth and decently fast, but it's definitely gonna be helpful.

GsDrunkestDriver commented 1 year ago

This'll be on hold until I figure out #7 as it should hopefully make this shit a lot less painful