• Welcome to PiBoSo Official Forum. Please login or sign up.
July 20, 2024, 09:15:50 AM


GP Bikes beta21c available! :)

Better rider lean tracking (custom curves)

Started by Vini, December 07, 2020, 05:21:24 PM

Previous topic - Next topic


December 07, 2020, 05:21:24 PM Last Edit: November 19, 2022, 11:08:45 AM by Vini
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 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.
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
JoystickGremlin 13.3 (Probably not necessary)

  • Install all the programs and drivers, restart PC if necessary. Properly set up and calibrate your VR/headtracking equipment.
  • Launch the vJoy configuration utility and disable all axes except X and Z (for Device 1).
  • Copy my OpenTrack config (GPB_CustomRiderTrack_Vin3.ini) to My Documents\opentrack-2.3.
  • Launch OpenTrack and make sure my profile is selected. If you are not using an Oculus device, change the input accordingly (probably Valve SteamVR).
  • Put on your headset, press F7 to start tracking and then A (on Xbox pad) to center the input. Make sure the squid properly follows your movements. You can remap these functions or invert axes in the OpenTrack options. Note: The center button needs to be easily accessible in VR (preferebly on your controller)!
  • Launch JoystickGremlin and GPB (in VR mode).
  • Go to settings and make sure auto rider lean and rider lean tracking are both disabled. Then remap rider F/B and L/R lean by moving the headset in the corresponding directions. This might take a few tries. Doublecheck with the input box at the bottom right. The game should show the virtual joystick as J1 Axis1 and J1 Axis2.
  • Keep the deadzones at 0 and linearity at 100%, these are adjusted through the OpenTrack mapping curves. You can enable smoothing if you like (I put everything at 100% except for F/B press 30%).
  • Bind VR Reset to some button on your gamepad. Once everything is tweaked properly, you should ideally be able to bind it to the OpenTrack center button.
  • Close GPB and open My Documents\PiBoSo\GP Bikes\profiles\ProfileName\calib.txt. It should show vJoy Device at the top. Replace the integer values inside the brackets with these:
    vJoy Device
    Do not recalibrate in GPB settings after this step!
  • Load up GPB VR and go to track. Switch to the second first person view and press Shift-C. Move the view as far back as possible with the arrow keys. For most bikes, you probably want to raise the view some as well. I attached my cockpit position file for the Ducati (copy to My Documents\PiBoSo\GP Bikes\profiles\ProfileName\cockpit).
  • Sit up straight in a neutral position and press the OpenTrack center as well as the GPB VR Reset button. For most bikes, you will have to move back a bit after that since the view is so far forward.
  • Start riding and hanging off. Switch to third person view or replay mode to observe the rider movements. Depending on the bike and its horizontal cockpit position, you may need to push the OpenTrack center button (rider lean) at a different position than the GPB VR reset button (view position). Either edit the OpenTrack center offset or move the horizontal cockpit position in-game to synchronize both buttons.
    You can also offset the vertical cockpit position simply by moving your head up or down when resetting the VR position. This might be necessary if a bike doesn't allow the view to be as high or low as you want.
  • Further finetuning is done through the OpenTrack mapping curves.

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!


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

GPBOC Live Streams: https://www.youtube.com/c/IASystemsComputerControls; i7 12700K 5.1GHz Z690 ASUS Strix Z690-A Mobo 32GB 3600MHz DDR4 RAM ASUS Strix RTX3080 OC 10GB DDR6X ASUS Ryujin 360 AOI Cooler ROG Thor 1200w PSU in ROG Helios Tower Case.


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.


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

GPBOC Live Streams: https://www.youtube.com/c/IASystemsComputerControls; i7 12700K 5.1GHz Z690 ASUS Strix Z690-A Mobo 32GB 3600MHz DDR4 RAM ASUS Strix RTX3080 OC 10GB DDR6X ASUS Ryujin 360 AOI Cooler ROG Thor 1200w PSU in ROG Helios Tower Case.


December 09, 2020, 01:53:13 PM #4 Last Edit: December 09, 2020, 10:41:55 PM by Vini
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.


...Updated the OpenTrack INI. The rider follows movements around the input edges better now.


December 31, 2020, 08:45:51 PM #6 Last Edit: January 01, 2021, 02:36:41 PM by Vini
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.