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

Vehicle speed limiter not working correctly at low speeds #8615

Closed
GeorgeBAS opened this issue Oct 24, 2021 · 8 comments · Fixed by #8643
Closed

Vehicle speed limiter not working correctly at low speeds #8615

GeorgeBAS opened this issue Oct 24, 2021 · 8 comments · Fixed by #8643
Labels
Milestone

Comments

@GeorgeBAS
Copy link

Mods (complete and add to the following information):

  • Arma 3: 2.06
  • CBA: Latest stable
  • ACE3: 3.14 stable

Description:
With the new speed limiter, at low speed (around ~10km/h) vehicle speed sometimes dip well below the set speed causing the vehicle to stutter

Steps to reproduce:

  1. Open single player scenario
  2. Place Badger IFV (Haven't tested with other vehicles, but has been reported to be happening with the puma via Commy2 on Slack)
  3. Set speed limit to around ~10km/h
  4. Hold drive forward key

Expected behavior:
Speed should max out at ~10km/h

Where did the issue occur?

  • Dedicated / Editor (Singleplayer)

Screenshots:
In the attached video you can see evidence of the bug. Despite holding W, the vehicle stutters between two speeds and engine RPM jumps like crazy

https://www.youtube.com/watch?v=CkH0FBUMMNs

@veteran29
Copy link
Member

This might need BI Feedback tracker ticket, it looks like the PID controller used for the new command does not work well for small speeds.

cc: @dedmen

@dedmen
Copy link
Contributor

dedmen commented Oct 25, 2021

Its probably caused by the PID controller not being used at all.
When the speed difference is too high, the PID is not used and the engine instead goes to 100%/0% thrust.
I think I have done that percentage wise so its a smaller threshold at lower speeds, probably too small.

No need for FT ticket

@dedmen
Copy link
Contributor

dedmen commented Oct 28, 2021

Cannot reproduce.
https://youtu.be/6pPLvxujnis
RPM fluctuates a bit, but only very slightly.

Tested with the AMV-7 Marshall (Badger IFV) and the Slammer tank, the tank is basically bang on steady RPM, the Marshall fluctuates a bit but is still perfectly acceptable.

Tried both on latest dev build and 2.06 release.

I'm not trying to reproduce with ace though, ACE might still have some setVelocity mess stuff in there that could cause this maybe?

@dedmen
Copy link
Contributor

dedmen commented Oct 28, 2021

Actually I do have ACE 3.14
https://youtu.be/_eXnTcne62U
Hm, it only seems to happen at very specific speeds. I think its because its exactly at the threshold where it shifts up/down, so the RPM difference is caused by the auto shifter needing higher RPM for the lower gear, and lower RPM for the higher gear.
As soon as it switches down, you need to give more thrust, again get above the threshold and it switches up again, where you need lower thrust, drop below the threshold and it switches down again...

But this weird flickering I got at 15kmh, I cannot reproduce with this script

[] spawn {
vehicle player setCruiseControl [20, false];
sleep 10;

vehicle player setCruiseControl [15, false];
}

which is what I expected the ace speed limiter would do, does it still do a additional setVelocity if you are too high above target speed? That might mess things up when you are reducing speed limit to force slow yourself down.

@dedmen
Copy link
Contributor

dedmen commented Oct 28, 2021

Really weird.
When I set ACE speedlimit to 10 and drive, then CTRL+Mousewheel up to 15 I land at some extreme RPM stuttering.
Exactly same happens when I drive with limit at 20, and adjust it down to 15.

But when I use this

[] spawn {
vehicle player setCruiseControl [10, false];
sleep 5;
vehicle player setCruiseControl [15, false];
}

or this

[] spawn {
vehicle player setCruiseControl [20, false];
sleep 5;
vehicle player setCruiseControl [15, false];
}

it works just fine, what is ACE doing?

@veteran29
Copy link
Member

it works just fine, what is ACE doing?

It should execute setCruiseControl only once when there's new speed limit value...
https://github.com/acemod/ACE3/blob/master/addons/vehicles/functions/fnc_speedLimiter.sqf#L59-L60

weird.

@dedmen
Copy link
Contributor

dedmen commented Oct 28, 2021

Oh my fucking god.
You still call setCruiseControl every frame.

#8273 (comment)
#8273 (comment)

To quote myself

Don't do this!
setCruiseControl script command resets the thrust PID Controller.
If you reset it every frame you'll completely mess up the auto thrust by resetting the PID basically every simulation cycle.

Arma3Retail_DX11_x64_sFBxrb6Reg

@veteran29
Copy link
Member

veteran29 commented Oct 28, 2021

Oh my fucking god. You still call setCruiseControl every frame.

Oh well. I guess rounding the speed limit to full integers should fix the issue :D

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

Successfully merging a pull request may close this issue.

4 participants