Skip to content

Conversation

@albertok
Copy link
Contributor

@albertok albertok commented Oct 17, 2025

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.

image

return -1

## Get all root nodes that have submitted input
func get_input_submissions() -> Dictionary:
Copy link
Contributor

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
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants