Hello. I’m starting to learn ecs approach. I have a problem with making a voxel engine in ecs style.
First problem:
I want to have entities called chunks(not ecs chunks - When I refer to chunk I mean entity with voxel component on it) on which I will have position component and VoxelsComponent. But my first problem is with VoxelComponent. How can I store array in it? I know the limitations on IComponentData and I know why it should have fixed bittable size but if I want create array with predefined const size this should be possible. If I know size at the compile time int[16] should be no different than 16 ints. How can I achive this?
Second problem:
Chunk entities are not independant of eachother. In most parts they are but for rendering purposes I need to access neighbours chunks(for face culling). What is the best approach for it? Iterating over all chunks and checking their positions seems as not very optimized way to do it. Storing entities in dictionary <position,chunk> would work but if I understand correctly this defeats the purpose of ecs and linear memory access. Theoreticaly if I have 16x16 chunks iterating over all of them should not be that much of a bottleneck but for 128x128 it starts to be unefficient.
I’m new to the ecs concept so if I don’t see something obvious I apologize