PiBoSo Official Forum

General => Virtual Reality => Topic started by: Vini on December 07, 2020, 05:21:24 PM

Title: Better rider lean tracking (custom curves)
Post by: Vini on December 07, 2020, 05:21:24 PM
As promised, here is a tutorial on how to manually link the rider lean to your head movements in VR.
This allows for fully manual control over the rider (independent from throttle/brake/steer inputs) without the limited range of the default rider lean tracking mode.
My curves are optimized for relatively large movements so you actually have to get your knee out and lean onto it. I've been testing this configuration with Manu's (https://discord.gg/KHEmVeS) custom "Lorenzo No Leg" riding style (beta2) and the Pramac Ducati MotoGP19 bike (v1.4). I am using modern rider type 2. The OpenTrack center position and the GPB VR/view position are aligned/synchronized if you use the OpenTrack curve (GPB_CustomRiderTrack_Vin3.ini) with my Ducati cockpit position for FPV2 (MotoGP_2019_DUCATI_GP19_MDL2.ini), meaning you can use the same button for both centering/reset functions.
I recommend view mode 1 (locked to horizon, not bike) combined with the second first person view (stationary, independent from rider movements). This way you can keep the FPV1 cockpit settings for regular 2D onboard riding.
You will most likely have to adjust these curves slightly to fit your individual setup.

Tip: If the rider arms are obstructing your view, get the shortened 1P rider model from Manu's Discord (https://discord.gg/KHEmVeS).
With Manu's rider mod (beta2 for GPB beta19), you can copy look_l.anm and look_r.anm from the Marquez animations folder to the specific riding style you are using in order to get more accurate head/helmet movement tracking.
If you want to disable the wheelie stand-up animation, delete leaning standing.anm from the animations folder and (very important!) make sure to remove the corresponding line from gfx.cfg as well as changing the index of the following entries so that there are no gaps in the numbering. If you don't edit gfx.cfg, the heading animations will no longer work properly.

Required programs
OpenTrack 2.3.9 (https://mega.nz/file/oVswQAgA#cHqAj6JVAA0CdzPh_3IFi6lNhBgRPrpRcuyOKjEJVNc)
JoystickGremlin 13.3 (https://github.com/WhiteMagic/JoystickGremlin/releases/download/Release_13.3/Joystick.Gremlin.R13.3.msi) (Probably not necessary)
vJoy 2.1.9.1 (https://sourceforge.net/projects/vjoystick/files/Beta%202.x/2.1.9.1-160719/vJoySetup.exe/download)

Instructions

Advanced OpenTrack setup
Before you edit the curves, make sure you have Max translation set to the highest value for the X and Z axes (100cm). For finetuning, start tracking and move around while observing the curves. The horizontal axis is input, vertical is output (which gets send to GPB as a virtual joystick). If possible, have the game window open at the same time and observe the rider or check the input box in the GPB settings to cross-reference with the OpenTrack curves (I just recorded all the windows with OBS and checked everything afterwards). The max. output values (where the curves plateau) are set up to perfectly match up with the input range GPB is expecting for rider lean. You will only have to change this (shift the plateau vertically) if you change the center offset in OpenTrack.
You should keep the overall shape of the curves similar to mine. Especially with Manu's custom riding styles, most of the movements happen in the outer range, so you need more fine control there. This corresponds to a curve that rises steeply initially and then tapers out gradually near the max. values (similar to increasing linearity setting in GPB). For the X axis (L/R lean), you need a very steep rise in the beginning to get the knee out under braking, as well as an additional deadzone around the center/0 position to avoid the rider dancing around on the straight (that's why the curve looks like an S). The X axis should always have symmetric curves, while the Z axis likely requires assymetric curves (different behavior for forwards and backwards).

If you cannot move far enough to hit the plateau/max, shift the rightmost point in the curve to the left. Vice versa, if you want to have to move more, shift it to the right.

If you notice that the whole movement range is misaligned on the Z axis (F/B) and simply centering GPB and OpenTrack at different points doesn't work well, you need to edit the center offset in OpenTrack (under options\camera). Hopefully this will become unnecessary once GPB allows the cockpit position to moved further backwards for easy adjustment/synchronization between different bikes. In my curve, the Z offest is -40cm, which compensates for the cockpit position being so far to the front and the fact that you consequently need to move back some after setting the GPB VR/view position. This offset is why the Z axis has to be assymetric. So increasing the value (towards positive values) will move the rider lean center back towards the middle.
Once you've changed this value, you will have to open the GPB input settings and observe the OpenTrack curves while moving around. Shift the rightmost points in the OpenTrack Z curves vertically until you are just able to hit the outer edges of the input box with the little blue dot in the GPB settings. After that, adjust the curves horizontally until they fit your natural movement limits as described above (remember to press the center/reset buttons before doing this).
Never try to recalibrate the virtual joystick in GPB, it will mess up your whole setup!
Title: Re: Better rider lean tracking (custom curves)
Post by: doubledragoncc on December 08, 2020, 02:57:29 PM
WOW.....in depth stuff and thanks Vini

I just got my Reverb G2 and OMG is it so good in GPB in VR now but I have a body motion system that is fully body only and combined with VR and my sit on system its so dang good

Working on one that is not intergrated with my Hs3 but its not cheap at the mo lol

Will have to try your way once I get a break, maybe 2022 lol

Hope your doing good m8

DD
Title: Re: Better rider lean tracking (custom curves)
Post by: Vini on December 08, 2020, 05:15:43 PM
Sounds great. How is the framerate with that crazy resolution?
With "body motion system" you mean the tracking system or the seat unit?


Having a lot fun in VR so far but still need some practice.
It would feel really nice to have a handlebar or something to hold on to when hanging off the chair, even if it is just a dummy mount for regular joysticks and triggers.
Title: Re: Better rider lean tracking (custom curves)
Post by: doubledragoncc on December 09, 2020, 09:31:32 AM
Wireless Body motion unit is a chest harness and tracks actuall body movement sent to BU unit on handlebars as 2 analog axis for output along with controller outputs using only 1 USB cable

DD
Title: Re: Better rider lean tracking (custom curves)
Post by: Vini on December 09, 2020, 01:53:13 PM
Interesting. I thought about something similar while fiddling around with this setup.
For the moment, I think just using the VR headtracking is the much easier (or at least: cheaper) solution. The problem is that GPB only takes rider lean input as dual-axis. If the game was capable of taking positional data from multiple tracking points, you could put sensors all over your body and let the game map your movements 1-to-1 to the rider skeleton. This would completely bypass all of the preprogrammed animations but of course you'd need a ton of tracking points (at least one per joint or bone), possibly even a full suit.
Title: Re: Better rider lean tracking (custom curves)
Post by: Vini on December 09, 2020, 10:08:35 PM
...Updated the OpenTrack INI. The rider follows movements around the input edges better now.
Title: Re: Better rider lean tracking (custom curves)
Post by: Vini on December 31, 2020, 08:45:51 PM
Added new OpenTrack INI with even more F/B offset.
Not sure if something changed in beta19 or Manu's rider but this one works better now and gives proper full lean mid corner.

Changed the Pramac Duc Cockpit position for FPV2 to be higher.