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

Issues with Brake bound with BrakeReal on the same button #14

Open
BigBang1112 opened this issue May 14, 2023 · 1 comment
Open

Issues with Brake bound with BrakeReal on the same button #14

BigBang1112 opened this issue May 14, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@BigBang1112
Copy link
Member

BigBang1112 commented May 14, 2023

Let's say analog button is bound to both digital and analog brake. This input set can be taken as an example:

Brake { Time = 0:15.790, Pressed = True }
BrakeReal { Time = 0:15.800, Value = -51339, NormalizedValue = -0.783371 }
BrakeReal { Time = 0:15.810, Value = -39482, NormalizedValue = -0.6024475 }
BrakeReal { Time = 0:15.820, Value = -28810, NormalizedValue = -0.4396057 }
BrakeReal { Time = 0:15.830, Value = -27625, NormalizedValue = -0.42152405 }
BrakeReal { Time = 0:15.840, Value = -31182, NormalizedValue = -0.47579956 }
BrakeReal { Time = 0:15.850, Value = -53710, NormalizedValue = -0.81954956 }
Brake { Time = 0:15.860, Pressed = False }
BrakeReal { Time = 0:15.860, Value = -65536, NormalizedValue = -1 }

Analog brake seems to be always after the digital brake (another example supports this theory). So when you have the same button bound on both analog and digital brakes, the "leaving" state is always gonna be from analog - this should maybe stay as it is, even if the digital brake looks nicer, up to debate. The same could potentially happen with Acceleration and other inputs, so it shouldn't be applied specifically to brake. The transition also isn't considered with AdjustToFPS set to true, which should be the primary focus to resolve.

Another example what can happen:

Brake { Time = 0:44.690, Pressed = True }
BrakeReal { Time = 0:44.690, Value = -62603, NormalizedValue = -0.955246 }
BrakeReal { Time = 0:44.700, Value = -52525, NormalizedValue = -0.8014679 }
BrakeReal { Time = 0:44.710, Value = -47189, NormalizedValue = -0.720047 }
BrakeReal { Time = 0:44.730, Value = -48375, NormalizedValue = -0.7381439 }
BrakeReal { Time = 0:44.740, Value = -57860, NormalizedValue = -0.88287354 }
Brake { Time = 0:44.750, Pressed = False }
BrakeReal { Time = 0:44.750, Value = -65536, NormalizedValue = -1 }

Here, the brake is pressed, also visually shows on the ghost, but is a 0-tick event? I don't know how to visualize that one. Perhaps always taking just the first event of the tick and ignoring the rest, like currently happening at the start of the run.

Generally speaking, it would be best to rewrite the input logic to know how to deal with same-tick inputs and such. Updates will be shared under this issue, everything should happen on a separate branch (to be made).

@BigBang1112
Copy link
Member Author

BigBang1112 commented Jun 8, 2023

A05_TPN.Ainol13(0'50''985).Ghost.Gbx.zip

This ghost is initiated with analog brake but AccelerateReal comes first? In this case it's like the second same-tick input is being used:

Steer { Time = -0:03.080, Value = -22098, NormalizedValue = -0.33718872 }
AccelerateReal { Time = -0:03.080, Value = -65536, NormalizedValue = -1 }
BrakeReal { Time = -0:03.080, Value = 65536, NormalizedValue = 1 }
FakeDontInverseAxis { Time = -0:03.080, Pressed = True }

Maybe just discard invalid values of within the same tick (negative in AccelerateReal and BrakeReal)? Because if same tick logic would be applied here, only Steer would apply.

@BigBang1112 BigBang1112 added the bug Something isn't working label Jun 8, 2023
@BigBang1112 BigBang1112 self-assigned this Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant