Tick-based Event Handling #3965
luanpotter
started this conversation in
V2 Ideas
Replies: 1 comment
|
Agree that we should do this, and as we discussed maybe everything doesn't necessarily need to be done in one pass, but grouping the events per tick we should definitely do. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I want to take the V2 opportunity to change when events are propagated.
We've had lots of issues in the past with how we async fire events to components that then try to edit the component tree outside of the correct boundaries. We current have a sort of component tree freeze, where components additions or removals are only executed in between game ticks.
We should consider doing the same thing for events. Flame listens for events async but only fire events in between every tick as part of the game loop. Essentially the game loop becomes:
repeat: tree modifications -> propagate events -> update(dt) -> render()
That way we guarantee everything is sync, much more deterministic, and avoid a whole category of bugs, without many drawbacks (other than the breaking refactor).
Thoughts?
All reactions