Description
What problem does this solve or what need does it fill?
Commands are currently applied one at a time, in system graph order, and within that in the order they were sent within systems (FIFO). This causes some problems:
- Chained
EntityCommands
create useless temporary archetypes #5074 - Confusing interactions between despawning entities and other operations like in Command execution order does not always match system execution order in the case of ambiguous systems #10122 or Configurable error handling in commands #2004.
- Suboptimal performance, as we are violating the basic principles of data-oriented design
What solution would you like?
Automatically batch adjacent similar commands together.
What alternative(s) have you considered?
We could also reorder commands to reduce surprising errors and confusing interactions. A sample ordering might be:
- Spawn
- Insert
- Remove
- Despawn
This would avoid a large number of spurious failures without needing explicit command error handling or system ordering. I'm unsure if that should be done as part of this work, or even at all however.
Additional context
@maniwani has been investigating this, and thinks we should remove the general purpose Deferred
system parameter to reduce the risk of unbatchable operations. I'm personally less convinced: wouldn't those arguments similarly apply to any custom commands?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status