-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Shared State for System Param #22885
Copy link
Copy link
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-ContentiousThere are nontrivial implications that should be thought throughThere are nontrivial implications that should be thought through
Type
Projects
Status
SME Triaged
What problem does this solve or what need does it fill?
Some system params may want to share their state if there are multiple instances of them in the same system.
What solution would you like?
There should be a way for system params to declare that it wants to share one instance of its state per system.
What alternative(s) have you considered?
A system param that wants this behavior can implement it on its own without general support for this from bevy itself.
Additional context
In the upcoming assets-as-entities there is an
AssetCommandsSystemParamthat wrapsCommands. If user-code has anAssetCommandsand aCommandsin the same system, the order of the commands will not be synced. The general push for things-as-entities will make this problem grow.A caveat of this is that
Commandswill have to be!Sendand!Syncor take a performance hit by locking a mutex each time a command is queued.