-
Notifications
You must be signed in to change notification settings - Fork 737
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
Vehicles - Utilize setCruiseControl
for speed limiter
#8273
Conversation
Kept setVelocity with a +2 to speed check to make vehicle slow down downhill and to slow it down when enabled.
setCruiseControl
for speed limiter
I don't know if you want to do it in this PR, but someway to have autoThrust as true to do actual cruise control would be nice to have at some point |
I can experiement with it in a nother pr. |
Changes to cruise control from today. |
the script reapply it if i am not mistaken. will check effects.
should not effect this pr |
speed limiter will apply brakes if you are too fast. |
The cruise control do not activly slow you down when your going down hill wich is the resoning why i kept the setVelocity as mentioned. I did not have the setVelocity breaker in the begining. But after testing were i manage go over ~20km/h of the speed limit. |
It should actively brake though. The first check is to limit the PID controller to a smaller range, outside of the range its manually controlled, inside its controlled by the PID. so if your limit is 50kmh if your speed delta is more than 20% (10kmh) above setpoint it will apply 50% brakes and force thrust to 0. I only did 50% brakes to make it a little smoother, maybe thats not sufficient for your downhill test. My main concern is the "exploit" where you just quickly mouse-wheel your speed down if you need to quickly stop to apply the "magic" brakes. Maybe the "magic" brake can be disabled if you just reduced speed via mouse wheel in the last 2-5 seconds? |
Okey I just tested, because the PID controller only controls thrust and not brakes (while you are within the 10kmh delta) you will go 60kmh downhill when speedlimit is set to 50 (testing on malden mountain) |
feel free to adjust |
Okey I fixed it. log bottom right Thrust, Brake, PID output Will be in next RC build this week. Maybe profiling branch if I do one |
Mission makers might want to limit the speed of certain vehicles for whatever reason, I think we should limit the max limiter speed to the value of the limit at the time of Speedlimiter activation. |
I'm against this. We often activate the speed limiter when not moving at all to have clear 5 km/h steps. Otherwise vehicles end up driving 43 and 47 km/h. And for players i dont see the benefit. One could just disable it, speed up and reenable it? |
Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
I am confused, are @veteran29's and @Zakant's comments even related? One seems to speak about upper-most value that can be restricted from a perspective of a mission maker, and another speaks of value when you activate. If I am not mistaken, what @Zakant is saying is actually how it works before this PR. You can still increase it by step. Someone explain? |
I think Zakant does not understand what I meant. His comment does not make sense to me. |
What I meant about respecting mission maker set limit is basically this... when speed limiter is engaged, outside of PFH: GVAR(maxSpeedLimit) = getCruiseControl _vehicle select 0;
if (GVAR(maxSpeedLimit) == 0) then {
GVAR(maxSpeedLimit) = 1e10;
}; inside the PFH: getCruiseControl _vehicle params ["_currentSpeedLimit"];
if (_currentSpeedLimit != GVAR(speedLimit)) then {
_vehicle setCruiseControl [GVAR(speedLimit) min GVAR(maxSpeedLimit), false];
}; I guess the limit should be enforced in the handler of the "increase limit" function instead of the PFH but this should explain what I've meant. |
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
@veteran29 Does that last sound ok? |
…Control' and 'acex-merge' into tac-3.14.0-pre acemod#8245 acemod#7565 acemod#8064 acemod#8273 acemod#8415
I guess it's ok for now, allowing to use the feature and restoring the mission set limit would be better but can be done in another PR. |
* Change speed limiter to utalize setCruiseControl Kept setVelocity with a +2 to speed check to make vehicle slow down downhill and to slow it down when enabled. * Update addons/vehicles/functions/fnc_speedLimiter.sqf Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> * Update addons/vehicles/functions/fnc_speedLimiter.sqf Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> * Update addons/vehicles/functions/fnc_speedLimiter.sqf Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/vehicles/functions/fnc_speedLimiter.sqf Co-authored-by: PabstMirror <pabstmirror@gmail.com> Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com>
When merged this pull request will:
Adjustments and code of note:
Kept setVelocity with a +2 to speed check to make vehicle slow down downhill and to slow it down when enabled.REQUIRE ARMA Version v2.06 >