News for hackers. Stuff that matters.
Re:A Simple Entity Component System (2019) by cloogshicer on Wednesday August 31, 2022 @05:16PM (#32668458)
Something I don't get about ECS: How do you handle interactions between systems, and especially side effects that can affect multiple systems?

Because of those, the systems can't really be considered truly independent, can they?

Doesn't this cause complexity to go through the roof?

Re:A Simple Entity Component System (2019) by Hemospectrum on Wednesday August 31, 2022 @07:29PM (#32669680)
Systems communicate via components. They can create empty "marker" components (and remove them again as needed) or, when applicable, put data in shared singleton data structures called "resources."
Re:A Simple Entity Component System (2019) by kvark on Wednesday August 31, 2022 @05:58PM (#32668887)
In some ECS in Rust (like Specs) there is a concept of a “resource” for this. System declare their use of resources, which allows the scheduler to order them.
Re:A Simple Entity Component System (2019) by linkdd on Wednesday August 31, 2022 @07:37PM (#32669748)
I like to have a message bus to send messages to queues and have systems consuming those queues.

The shared mutable reference to this message bus would be provided to each system requiring it. It's easily achievable in Rust with Bevy, or with Unity DOTS.

When I don't use Unity DOTS and simply good old MonoBehaviours, I call the message handlers as soon as the message is published instead.