NSSTC / sim-ecs

Batteries included TypeScript ECS
https://nsstc.github.io/sim-ecs/
Mozilla Public License 2.0
84 stars 12 forks source link

The system dispatching is not component-query aware #12

Closed minecrawler closed 4 years ago

minecrawler commented 4 years ago

At the moment, any two systems without system-dependencies may run in parallel, even when both access the same components in WRITE mode. While for simple use-cases this may not be an issue, it is a hard to debug problem.

One solution may be that before dispatching systems, they are ordered. For world.dispatch() there wouldn't be a big benefit, however pre-scheduling dependencies like that will remove one conditional from world.run() for an added benefit.

minecrawler commented 4 years ago

This should already be fixed, by now. While the grouping algorithm still is very bad, it should at least not allow systems which access the same components be run in parallel.