Open johanhelsing opened 9 months ago
I was just about to make an issue about this, awesome timing!
This functionality would be very helpful in my game as the current ggrs
behavior causes a lot of mispredictions in the mentioned cases of one-off events (every input in my game). Currently I'm just using a patched version of ggrs
where I always assume the inputs are inactive.
I think that optionally providing a function for input predictions sounds great.
Is your feature request related to a problem? Please describe.
In some cases, it would be convenient to be able to send one-off events as part of the input struct:
However, when predicting, we would then get
fire_just_presed == true
repeatedly when predicting.Describe the solution you'd like
Instead of just copying the input struct, perhaps it would make sense to be able to inject a prediction function?
https://github.com/gschup/ggrs/blob/48aec70c45e5c18c5d95398c9c7623547492021b/src/input_queue.rs#L144
Describe alternatives you've considered
Handling just_pressed logic inside the ggrs advance frame step works as a workaround, but sometimes the events you get from game engines are one-offs (bevy ui button press events etc.), so it generates a lot of boilerplate
Additional context
https://discord.com/channels/844211600009199626/844211600009199629/1175361006717898763