Skip to content

Refactored input batching and input submission#307

Merged
elementbound merged 19 commits intofoxssake:mainfrom
TheYellowArchitect:input-refactor
Jan 31, 2025
Merged

Refactored input batching and input submission#307
elementbound merged 19 commits intofoxssake:mainfrom
TheYellowArchitect:input-refactor

Conversation

@TheYellowArchitect
Copy link
Copy Markdown
Contributor

@TheYellowArchitect TheYellowArchitect commented Oct 16, 2024

It has been the established convention for all _states and _ticks and basically property dictionaries to be in the format of [tick][property]
Input batching/redundancy is the only property dictionary which instead works with [property][tick].

With this PR, it now works like the rest ([tick][property]) and it should be easier to read, and also improves performance as well because inputs are cached in _batched_inputs_to_broadcast

@TheYellowArchitect
Copy link
Copy Markdown
Contributor Author

This and the other PR are ready (I tested them locally)

var local_input = PropertySnapshot.extract(_record_input_property_entries)
_inputs[NetworkTime.tick] = local_input

if (_batched_inputs_to_broadcast.size() == NetworkRollback.input_redundancy):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not confident we should add input batching, especially as part of this PR.

for picked_tick in inputs:
sanitized[picked_tick] = _sanitize_by_authority(inputs[picked_tick], sender)

if sanitized.size() > 0:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure leaving this check as-is is sensible, as the variable's meaning has been changed.

@elementbound elementbound merged commit 926250a into foxssake:main Jan 31, 2025
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