-
-
Notifications
You must be signed in to change notification settings - Fork 44
#470 track and expose input tick submissions #518
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
base: main
Are you sure you want to change the base?
Conversation
| return -1 | ||
|
|
||
| ## Get all root nodes that have submitted input | ||
| func get_input_submissions() -> Dictionary: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to keep this as a dictionary, or is it OK to expose an array of nodes that have inputs?
| ## Register that a node has submitted its input for a specific tick | ||
| func register_input_submission(root_node: Node, tick: int) -> void: | ||
| if not _input_submissions.has(root_node): | ||
| _input_submissions[root_node] = tick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dictionary never removes keys. I think for many games this won't be an issue, but if a game churns through lots of individual nodes, this could be an issue. It would be a nice to put an upper bound or similar on the dictionary size somehow.
Looping through all keys checking if the nodes are still valid could be too costly. Ideally RBS nodes would clean up after themselves. Would that break anything if we removed the input submission data once an RBS is destroyed?
Allows NetworkRollback to track and expose the latest tick for which each node with a RollbackSynchronizer has received input submissions.
Useful for scenarios where you need to ensure all input ticks are submitted before proceeding with actions that are difficult to reverse, such as character death, visual effects, or audio triggers.