FAQ
Should you use this?
No. I can't guarantee I'll support this long term yet. It's also thoroughly untested. If you want to look at the source it's available here : https://gitlab.com/tertle/com.bovinelabs.core/-/tree/virtual/BovineLabs.Core.Extensions/Chunks
No guarantees it's in a state that won't instantly crash your Unity though.
Why did you implement it then?
I've been thinking about this concept for a long time. I was going to bed the other night and it just clicked, I wrote down a bunch of notes, woke up the next day and implemented the core concept in 2 hours. (This is how most of my interesting system development happens. Months of planning, minutes to implement.)
Should Unity implement something similar?
Not anytime soon. I'm not advocating for anything. It's simply an idea I've had in my head for ages for pushing performance to the next level for how I design dots architecture.
It'd be a big task to ensure safety for their standards and I haven't even confirmed if there are enough performance benefits to offset overhead.
Maybe somethig like this would be cool to research post 1.0 or further in the future?
How did you do this without editing the entities package?
A very good understanding how things work and a bunch of replicated code.
For example I now have TypeManagerEx, Virtual variations of Handles/Lookups etcs. I am limiting methods within these to make it easier to maintain.
There are definitely performance and safety benefits to this if I edited the package.
Gotchas
So many. As I am not modifying entities package
- Structural changes can break data layout and it will only be fixed next initialization update
- You can't query components across chunks
- You can't use code gen jobs on components across chunks
Honestly I suspect no one but myself unless you spend a bunch of time working out why this is good will really reap the benefits.
Performance benefits (or downsides)?
Tests coming soon~