-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Input prediction #321
Comments
P.S. You have no idea how hyped I am for this. It is the conclusion to all rollback - basically a full simulation running as if 0 ms. The only real problem with input prediction once it works, is the correction causing visual artifacts or being too snappy, but with input decay and tickinterpolator (and screen latency), it shouldn't be ever a problem, so I'm glad you brought up input decay, its a great technique |
Splitting
It's been a long time coming 😄 |
✨ Description
Currently, RollbackSynchronizer doesn't simulate nodes it doesn't have input for. Once the input arrives, the game state is rolled back and the node is simulated.
It would be useful to be able to predict node behavior even if the input is missing, by predicting inputs.
Continues #54
Use case
Games could implement various input prediction mechanisms, instead of always relying on skipping simulation on missing inputs.
One common solution is input decay, where input values are weakened as the input ages. Something similar also works for racing games, where on missing inputs, the game assumes the player slowly lets go of the throttle.
Implementation notes
Rollback synchronizer should expose the following data during rollback:
has_input()
- Do we have input for the current tick?get_input_tick()
- Which tick are we taking input from? Value differs from current tick ifhas_input()
is false.get_input_age()
- How old is the input data we're using? In ticks.Games can use the above to implement their own input prediction mechanism however they'd like. To ease input prediction implementations, RollbackSynchronizer may expose a signal that's emitted after applying state and input for a given tick, but before simulating the tick. This way, input nodes can apply input prediction in their own code and expose data as necessary.
Nodes should still be able to opt-out of simulation if they determine that they can't predict anything with the current input. RollbackSynchronizer should provide a mechanism for this, e.g. by exposing a
skip_recording(node)
. This would enable nodes to do the following:To avoid breaking games during a version upgrade, input prediction should be opt-in. A flag to toggle input prediction should be included either as a property of RollbackSynchronizer, or as a project setting.
Distribution
netfox core
The text was updated successfully, but these errors were encountered: