May 11 2018 - haptics, colliders, audio, beatsaber
New Office!
This month I moved into a new office in Manhattan and so far it's awesome. It's in a WeWork Labs and I've got a nice window with a view. Anyway, for whatever reason I've experienced a boost in creativity and productivity since I made the move. So, here's what I've been up to...
Blade Trail Mesh Collider
Prior to this update, all of the mesh cuts have been triggered by a box collider that roughly matches the dimensions of the blade which is not very large, so if it moves very fast there's a good chance that the collision will outrun the time-step between physics calculations which is roughly 11 milliseconds, but if something causes the frame rate to drop the time between Update events could be much larger resulting in more cuts missed. I'm testing a theory that a much larger collider that follows behind the blade could help reduce the number of missed cuts. At first I thought I would build a box collider that trails behind the blade but instead I opted to use the procedural mesh that I'm generating to represent the blade trail and it seems to be working but I still have some more testing to do.
Directional "Force Push"
Toss / Force Grab / Hold update
Previously the control scheme was designed to Force Grab and Hold by holding down a button on the right controller, and if you let go of the button the saber would be released from your hand. But I didn't like holding down the button all the time so I added a double-click hold feature which made it easier and more satisfying to swing the controller around. But what would happen is that I would need to double-click again to allow for the tossing and retrieving type of gameplay. So, what I did this time around was to eliminate the double-click. Now you pull the saber to your hand and it grabs it so you don't have to keep holding the button. But then to toss the saber you need to release the button while the controller is in motion for it to "let go". I think it will be more intuitive to work this way. Anyway, it makes for a much more active experience.
Audio updates
... including a sizzling sound when the blade drags across a surface and better "hit" sounds.Here's the latest capture which includes all of the updates described above:
Haptics!
And finally the addition of haptics! I spent a few days obsessing about haptics and I'm pretty happy with the results. I went a little crazy and even recorded the sound of the haptics using two lavalier mics taped to the vive touchpads:Here is a video which includes the haptics audio track:
The interesting thing about designing patterns with haptics is that it all revolves around a single function call which ostensibly does just one thing, it generates a pulse at a specified length up to 3999 microseconds. I'm using the SteamVR API by the way, I think the Oculus API has a different setup for haptics. So, to wrap my head around this I've been treating the pulse length as the "amplitude" and to generate a "frequency" I'm controlling the gap in between each pulse. Putting this together, you get a sort of "tone" or "note" and to make that tone more interesting you can insert gaps between each "note" as well as control the length of each note. So, as you can see, this can spiral out of control. Throw in some sine waves and you've got a lot of stuff to explore...
Comments
Post a Comment