In a free time I develop a pet project using Entities and
I've already mentioned The Hot Path Show here a few times promising to share my notes with insights from it. Even thought the videos are pretty long I find them very valuable as it always features the developer of Entities or the developer of a game made with DOTS and they share a lot of tips that might not be so obvious from the docs.
Here are my notes from the episode 3:
- ECB is slow, replaying the commands has a performance hit
- Dont use ECB all the time, default to use the main thread.
- If you see that parallelization is needed, then try to use native collections to gather entities and then perform the modification after the job
- Only if all the above is not working then use ECB
- Enableable components do not cause a not structural change
- EntityManager + EntityQuery is fast
- This is an example of fast entities destroying, since all of them in a one chunk
state.EntityManager.DestroyEntity(SystemAPI.QueryBuilder().WithAll<T>().Build());
- Dont use EntityQueryBuilder as its not burstable
I'd recommend you to check the show yourself, Since I am somewhat familiar with DOTS and Entities already, I might have missed some more basic advice. Would be great if anyone watching that shares the missed tips in the comments.
Drop a 🔥if you want more of similar recaps of videos and conference talks.
https://www.youtube.com/watch?v=bXR7EYacusI
#ecs #dots