tm-dashboard
tm-dashboard copied to clipboard
Going backwards makes input going forwards on MP4
When I go backwards, the inputs visualizer makes the forward inputs show instead of the backwards
In the example below, the speed viz is negative (meaning it's backwards) but the inputs show forwards
@Atheuz Perhaps you wanna look into this? (Otherwise I'll check it out later myself haha)
It looks to me that InputGasPedal is always positive, but when going in reverse the gear is 0.
The vehicle velocity itself has little to do with which inputs are pressed, so we can't really check gear value.
I'm not sure I completely understand that statement. What I meant to say was that during my observations in TM2 Stadium, the following occurred:
- I accelerated forwards by pressing ↑. I observed the up key highlighted on the dashboard
- I released the up key and applied the brake by pressing ↓. I observed the down key highlight as I slowed down.
- When the car stopped moving forward, the down arrow was no longer highlighted. I am still holding the down arrow on my keyboard.
- The car starts to move backward as I continue to hold my down arrow key. I observe that now the Up arrow key is highlighted on the dashboard.
My conclusions from this observation:
- Down arrow key applies both Reverse and Brake.
- Reverse and Brake are not the same thing.
Ah, yes you are right.
Braking at positive velocity:
Braking at negative velocity:
Note the InputIsBraking. That is the value that is used to set the backwards key: https://github.com/codecat/tm-dashboard/blob/master/Source/Pads/Keyboard.as#L20 Not really sure how to fix this.
From some experimentation, it appears to me that:
- if positive velocity:
- if inputIsBraking and inputGasPedal:
- up-key and down-key are both pressed
- if inputIsBraking and not inputGasPedal:
- down-key is pressed
- if inputGasPedal:
- up-key is pressed
- if inputIsBraking and inputGasPedal:
- if negative velocity:
- if inputIsBraking and inputGasPedal:
- up-key and down-key are both pressed
- if inputIsBraking and not inputGasPedal:
- up-key is pressed
- if inputGasPedal:
- down-key is pressed
- if inputIsBraking and inputGasPedal:
There seems to be a problematic edge-case near zero speed, which could be fixed if we could replace the car's linear velocity with the wheel's angular velocity for the above conditions. Unfortunately this also requires some threshhold value for mapping inputGasPedal to a bool value, since it changes smoothly.
This observation also predicts that the inversion of this bug would also appear: driving with negative velocity, and then braking with the up-key will be displayed as a down-input. From my testing, this is true (at speeds above when the wheels start spinning).