ScriptPlayer icon indicating copy to clipboard operation
ScriptPlayer copied to clipboard

Request: Vibration conversion mode - "Use Acceleration"

Open UchihaPhantom opened this issue 2 years ago • 5 comments

Since "Use speed" already exists I suppose calculating acceleration would not be much of an issue, and I feel like it could enhance the possibilities greatly.

UchihaPhantom avatar Jun 30 '22 07:06 UchihaPhantom

Could you explain a bit what you mean by that?

FredTungsten avatar Jun 30 '22 16:06 FredTungsten

Sure. Script is basically a time-position graph. If we calculate the first derivative of this and we get the time-velocity graph, that's what we already have in the "use speed" setting. If we calculate the derivative of that (or just a second derivative of the script, position-graph, itself) we get the time-acceleration graph, which is what I'm suggesting :) (All derivatives are processed for absolute values, because in the case of vibration we don't care about the "sense" of either vector)

Now, I have not seen the source code and I expect there might not be direct graph-based arithmetic happening there, but I think it'd be possible to kind-of wing this by calculating the vibration value for position[i] based on max(abs(position[i]-position[i-1], abs(position[i]-position[i+1])) if you'll excuse my haphazard pseudocode :P

UchihaPhantom avatar Jun 30 '22 17:06 UchihaPhantom

That doesn't sound very practical - the speed between two points in a funscript is constant, and the derivative of a constant is always 0. The "time-acceleration graph" of a funscript would be always 0 except when the speed changes (instantly) between two points, then it's infinite for an infinitely short time.

What would you expect the vibration to be like for these simple scripts?

image image

FredTungsten avatar Jun 30 '22 17:06 FredTungsten

Hm yeah fair, the direct derivative would equal to zero and would require some fuzzy padding.

Now to answer the example, vaguely like this: image EDIT: Provided a more hardware-accurate sawblade graph

UchihaPhantom avatar Jun 30 '22 18:06 UchihaPhantom

This looks more like a ... "proximity mode" I guess I would call it. Looks almost doable, but I'm not sure if it's still practical with all those newer scripts that got a lot if intermediate positions. Also, vibration speeds are calculated between two points (no previous positions available) and it would create edge-cases for the first and last positions in the script (something I really don't like)

I'll see what I can do, no promises though

FredTungsten avatar Jun 30 '22 18:06 FredTungsten