Recently I keep getting this error and force me to move out some components as another entity which is quite annoying. Will mega chunk feature coming soon so I no longer need to fix this error anymore?
ArgumentException: System.InvalidOperationException: Entity archetype component data is too large. Previous archetype size per instance {archetype->InstanceSizeWithOverhead} bytes. Attempting to add component size {componentInstanceSize} bytes. Maximum chunk size {chunkDataSize}.
And you use all these components together in the same job ? or have combination of job that basically make all component relevant to each others ?
If not, splitting it in multiple entity based on the set of component that are used in conjonction in job is probably a more performant approach even though it’s like you said more annoying to manage.
Eventually some games will evolve into things so big that although there is no one job that uses enough components to fill a chunk, there could be enough jobs that uses different parts of the same entity that fills a whole archetype.
Excuse my terrible paint drawing but it should explain what I mean much easier than I can put into words.
I have no idea just how many components you need to fill a chunk archetype, and maybe you can totally avoid such situations with better architecture planning, but I guess it is bound to happen once you implement enough features, especially for entitles like the player character.
So although very niche, and probably less than 10~ entities in any game would need, there existing a special chunk that just lets you put whenever many components you need could work, even though it opens the doors to terrible architectures
Another solution is to use another entity to hold some of the components then have a reference of it in the main entity. You can easily find the referenced entity using ComponentDataFromEntity.