Fix max rollback and lockstep handling #88
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NB: This builds on PR #82 so we better merge that one first to make this diff easier to review. (is Github working on stacked diff support yet?)
This fixes several issues that (I am fairly certain) came from merging #79:
NULL_FRAMEcorrectly? In any case I think this new structure makes it a lot easier to reason about.I have tested manually with 2 and 3 player example games, with lockstep mode and 8 frames of prediction and with sparse saving on and off. In a previous version of these fixes (those on the main branch of my personal fork) I also did a lot of testing with high latency and such to verify the "rollback when at limit of prediction window" fix, but in the name of full disclosure, I haven't done that with this branch specifically (I have a smallish test harness that makes it easy to do that testing with my game and my ggrs fork).
Anyway, based on that testing, everything seems to work.. but this is fiddly stuff so 🤞. I am at least pretty confident that it's more reliable than what's in
maincurrently :)