-->
Every now and then, Bevy users would ask for a simple helper: give me a way to mark a component on an entity as “read-only” so library authors could uphold invariants tied to the value of a public component. Unfortunately, there was a gaping hole: you could simply remove the component, mutate it and then reinsert it.
But… wait. That reinsertion would trigger “lifecycle hooks”, a new feature that automatically respond to components’ insertion and removal. Suddenly, this broken little helper was a powerful tool for ensuring global correctness. In this talk, I’ll cover Bevy’s automatically parallel Entity-Component-System (ECS) data flow, why parallelism can make maintaining invariants hard, and how we’re using “immutable components” to finally implement error-resistant relationships and indexes.
Alice leads and coordinates Bevy’s bubbling open source community as they build the next generation of game engine in Rust!