-
-
Notifications
You must be signed in to change notification settings - Fork 60
One-Off Inputs tutorial duplicates one-off input during lag #489
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
🐛 Description
The code for one-off inputs doesn't properly take into account the following paragraphs from the tutorial:
A different issue pops up when the game slows down a bit, and netfox needs to run multiple ticks in a single loop to catch up. Let's visualize this with a timeline, showing both the user input in real-time, and what netfox records as input:
To solve [this issue], one-off inputs can be buffered similarly to continuous inputs. The difference is that we reset the input value after it's gathered - this way, the input will be true for at most a single tick:
Steps to reproduce
Use a list to describe how to reproduce a bug, e.g.:
- Follow the tutorial for adding one-off inputs.
- Overload your game so
NetworkTimeticks multiple times at once.
Expected behavior
- Only the first tick should contain the one-off input.
Observed behavior
- All processed ticks contain the one-off input due to
_gatheronly being run once per loop.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working