[WIP] CamSmooth / Lock to Horizon

Discussion in 'Other' started by Lazza, Apr 1, 2018.

  1. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,388
    Likes Received:
    6,602
    Note: This is now superseded by the in-game option "Stabilize Horizon", which at the time of writing should be set to Low for maximum effect (very similar to this plugin, but better).

    Hi all, quick test plugin this one, just to see how it works.

    First: This won't work with VR!!!

    Ok, with that out of the way...

    I've been playing with low FOV recently and found that sometimes the camera moves around a bit more than I'd like, and it's more severe because I'm more zoomed in than I was before. There's been talk in the VR threads about lock to horizon and all that, and I know I've tried similar in games in the past, so I've played around a bit with a plugin to sort of do the same thing.

    https://www.dropbox.com/s/s66hkz833z8rduj/CamSmooth_v0_1.zip?dl=0

    What does it do?

    When active in rF2 it tilts/rolls the camera to largely remove the effects of the car bouncing around. If you imagine the camera is attached to the car, this plugin tries to remove that attachment.

    More technically, there are two parts to it:
    1. It tries to lock to horizon completely. If this was all it did, it means that when you're driving uphill you get a great view of the steering wheel, while downhill you just see the car ceiling. On cambered or banked tracks you'd see the car tilting around you, sort of like those stunt drivers going along on 2 wheels. It's actually kind of cool because it gives you a full impression of the slopes on a track. But I'm sidetracked.
    2. It then uses the very recent car orientation to tilt/roll the camera to match it. This means you don't get the effects described above, but you're left with a 'smoothed out' view, with the car bouncing around under you with jolts and bumps instead of your view bouncing and jolting.
    Why would I use it?

    Again, this is only for playing around. I hope before long rF2 will have a lock to horizon feature that does this better (see below for issues), but in the meantime this is a way to see what the concept is and how it works in practice.

    If you run low-FOV you may find it useful so your view doesn't shake around as much, especially on grass.

    It will be most noticeable if you turn off head movement and vibration in the settings. You can enable/disable it by toggling hardware plugins, if you're on grass it's pretty obvious what effect it has.

    Is it adjustable?

    No, I was thinking I could add something to slide between 'original' and 'full smoothing', but I don't know if it's worth the effort for something that doesn't work perfectly and will eventually be replaced by a game feature.

    Are there any issues?

    Yes :oops:
    • For this to work really well I would first need to make it completely eliminate camera movement, and then follow the car from there. In theory this is easy. In practice it's not. I tried a few things to reduce the shaking but couldn't work it out, so it's not perfect. In a way this slightly reduces the need for an adjustable setting as it doesn't feel completely static.
    • When exiting the car it doesn't reset the angle. So at the monitor the camera might be all out of whack. It should reset when you jump in the car again.
    • I've used 0.2s as a period to average out the car orientation. From my quick testing this has been a good compromise between reducing bumps but still reacting quite quickly to elevation and camber changes.
    • I've made it read the player.JSON file so it compensates for the "look up/down angle" and "look roll angle" settings, hopefully that works ok.
    • The plugin works by simulating varying amounts of Look Up / Look Down / Look Roll Left / Look Roll Right. I've set it up so it won't override these controls if you press them yourself (so you can look up/down with a key if you want). If you've changed your 'Glance Angle Rate' it could affect how well this plugin works.

    How do I install it?

    Up above is a .zip file with a single .dll file in it. Just put that dll in your rF2\Bin64\Plugins folder. I haven't bothered with a 32-bit version at this point.

    How do I get rid of it?

    Choose one of:
    • Go back to that Bin64\Plugins folder and delete CamSmooth.dll
    • Edit your CustomPluginVariables.JSON and set Enable to 0
    • In rF2 go to the Plugins/Difficulty settings screen and click on CamSmooth.dll. It should say Off (after restart). Restart rF2.
    • To temporarily disable, map and use the Toggle Hardware Plugins control in the game. This lets you quickly compare its effects by turning it off and on at will. Be aware you might also turn off other things this way.
    Comments, problems, opinions welcome below :D
     
    Last edited: Jul 28, 2018
    ericRacer, Corti, Flaux and 2 others like this.
  2. d0nd33

    d0nd33 Registered

    Joined:
    Dec 4, 2016
    Messages:
    107
    Likes Received:
    78
    Corti likes this.
  3. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,388
    Likes Received:
    6,602
    @d0nd33 Yeah, I've never used RHM but I gather a lot of people are using it to do similar. However in the long LTH thread a couple of people seemed to be aware of that plugin and were still hoping there'd be an explicit option in the game, which made me wonder if it didn't quite do what I was trying to do with this. So figured I'd throw it out there and see what happened :)

    I'm still using this myself as a quick and easy 'solution' to the overly bouncy view with low FOV. If it worked in VR I'd try to make it more flexible but we'll have to wait for the game to do that itself.
     
    Corti, lagg and d0nd33 like this.
  4. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,388
    Likes Received:
    6,602
    I was going to remove/retire this with the new Stabilize Horizon feature released, but I've just tested it and found it wasn't strong enough even on High. So despite the technical shortcomings of this plugin (jitter) I'll keep using it and leave it here.
     
    Corti likes this.
  5. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    7,484
    Likes Received:
    4,397
    the first post I saw about the Stabilize Horizion feature sounded like the settings were reversed. High did very little and low was more acceptable...although not as stable as the author hoped.
     
    Lazza likes this.
  6. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,388
    Likes Received:
    6,602
    Yep, I can see all those reports this morning. I did only try High. I'll give the other settings a go and see how they compare.
     
  7. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,388
    Likes Received:
    6,602
    Ok, can definitely confirm Low has more effect than High, and is very close to what I'd done with this plugin. And because it has no weird sync issues with the camera movement it's smoother, plus doesn't interfere with camera movement. Hurrah!
     
    woochoo likes this.

Share This Page