Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some dashboard animations for some input sources do not update smoothly #3230

Open
MarkROR opened this issue Feb 16, 2025 · 5 comments
Open

Comments

@MarkROR
Copy link
Contributor

MarkROR commented Feb 16, 2025

It's as if their update rate is very low, or it only updates once the value changes a certain amount (around 0.2) - it's a problem with scale, translate and when you represent the value as text. They also can get stuck and show the wrong value to the nearest 0.2.

Not a problem with integers, but for input sources that use floats (accelerator, brake, etc), it's just not usable.

Animations for rotate and lamp seem to work smoothly (rotate is still a bit choppy but fully acceptable)

Included is a video of the issue. All the bars use the accelerator input source.

input-sources-lag.mp4

Also included is a test vehicle, it'll show up as # GUI TEST - DEBUG DASH 2 in the vehicle selector.

0. GUI TEST - DEBUG DASH 2.zip

You will need some sort of analog input device to test - using throttle modifier keys does not provide any detail to show the issue.

@ohlidalp
Copy link
Member

ohlidalp commented Mar 4, 2025

I whipped up a test script by modifying a demo of inputs.setEventSimulatedValue() script function. Unzip it into Documents\My Games\Rigs of Rods\scripts and use loadscript setEventSimulatedValue_accelTest.as in ingame console.
Image
setEventSimulatedValue_accelTest.zip

The culprit are these intentionally inserted update skips: https://github.com/RigsOfRods/rigs-of-rods/blame/0.4.7.0/source/main/gui/DashBoardManager.cpp#L260 - I looked into history but they've been there from the beginning (11 years). Beats me why, but it's simple to change.

@MarkROR
Copy link
Contributor Author

MarkROR commented Mar 5, 2025

That is so cool, being able to do analog input with the script, works great, shows the issue

It makes me wonder if those update skips are there for a reason, perhaps updating too often resulted in a drop in performance?

Something doesn't seem right, though - if these skips have been present for 11 years, then how was the old dashboard (0.37-ish) able to move the "pedals" smoothly? (as opposed to the 4-5 steps we get) did it use a different input source, or?

@ohlidalp
Copy link
Member

ohlidalp commented Mar 5, 2025

The old truck dash used OGRE overlays :)

@MarkROR
Copy link
Contributor Author

MarkROR commented Mar 6, 2025

Ah, right, yeah

Yeah, now I see that we perform these "has this value changed enough that it's worth updating what's on screen" checks for evey animation type, and I see that for rotate it's 0.02f, but for series, scale and translate and textformat it's 0.2f

I guess we could try, I don't know enough to be able to tell whether it'll have any negative performance impact though, I also don't know how to measure something like that reliably

@ohlidalp
Copy link
Member

ohlidalp commented Mar 7, 2025

Poke me over weekend to do a draft PR with them removed or made tweakable via cvar. I'm curious and if the reason is performance, I will start looking for an alternative solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants