You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What problem does this solve or what need does it fill?
Currently the Mutated, Added and Changed flags are cleared at the end of each frame. This means that they can only be observed by systems that are scheduled after the change. It is also impossible AFAIK for two systems to both detect each other's changes.
While the upcoming upgrade in scheduling will make it easier to order systems, it would still be useful to have a reliable variant of these flags for cases where same-frame detection is not required (or even as a prototyping tool).
(Of course the naming is subject to debate).
When a component is added/mutated, the JUST_X are set. At the end of the frame, the struct would be updated with: (flags & 0b00001010) >> 1 instead of being cleared. The following query transformers would exist:
JustAdded<T>, JustMutated<T> and JustChanged<T> as the instantaneous but unreliable versions (the current existing flags)
Added<T>, Mutated<T> and Changed<T> as reliable but next-frame versions
What alternative(s) have you considered?
We could keep the current state as is, and require to either order system correctly or use events.
Additional context
The memory footprint would not change since ComponentFlags is a u8 already. It would be slightly more expensive to update flags at the of the frame, and querying Changed would require and additional bit mask. Thus I expect the performance impact to be very low. I plan to implement and benchmark it.
The text was updated successfully, but these errors were encountered:
What problem does this solve or what need does it fill?
Currently the Mutated, Added and Changed flags are cleared at the end of each frame. This means that they can only be observed by systems that are scheduled after the change. It is also impossible AFAIK for two systems to both detect each other's changes.
While the upcoming upgrade in scheduling will make it easier to order systems, it would still be useful to have a reliable variant of these flags for cases where same-frame detection is not required (or even as a prototyping tool).
What solution would you like?
We could change the
ComponentFlags
from:to:
(Of course the naming is subject to debate).
When a component is added/mutated, the JUST_X are set. At the end of the frame, the struct would be updated with:
(flags & 0b00001010) >> 1
instead of being cleared. The following query transformers would exist:JustAdded<T>
,JustMutated<T>
andJustChanged<T>
as the instantaneous but unreliable versions (the current existing flags)Added<T>
,Mutated<T>
andChanged<T>
as reliable but next-frame versionsWhat alternative(s) have you considered?
We could keep the current state as is, and require to either order system correctly or use events.
Additional context
The memory footprint would not change since
ComponentFlags
is au8
already. It would be slightly more expensive to update flags at the of the frame, and queryingChanged
would require and additional bit mask. Thus I expect the performance impact to be very low. I plan to implement and benchmark it.The text was updated successfully, but these errors were encountered: