#ECS Cellular Automata
1 messages · Page 1 of 1 (latest)
If it works and meets your requirements, can it be the wrong approach? 🙂
Looks cool btw
the problem is that i have to create separate arrays for components, and this cancels the ability to use Entities.Foreach
This is only day 3 of learning ECS, so there are a lot of things I just don't understand...
well you shouldn't use entities foreach ever as it's deprecated
so i hope you mean ijobentity
well you're not storing your voxels as individual entities so you've passed the first pitfall at least
I could be wrong, but Entities.Foreach is just a wrapper over IJobEntity. In any case, I only use IJobEntity, but I have the same problem with it.
I think this is my mistake, due to which I may be losing performance....
no EFE is the old way of iterating entities before source generation was added
EFE causes slow iteration times and will be removed in the 2.0/entities for all update
IJobEntity and EFE both produce IJobChunk jobs
Is there a significant performance difference between IJobEntity and IJobParallelFor?
well one iterates arbitrary data (usually a native array)
one iterates entities
different tools
I understand the difference in terms of behavioral logic. I am interested in the difference in execution speed. Roughly speaking, if you make a million components and a million entities with a component and pass them through IJobParallelFor and IJobEntity, which one will be faster?
well to use ijobfor on components you would have to first copy them all to an array
and if you make chagnes, then copy them back to entities
thats never going ot be remotely as fast as just working on the entity data directly
It should probably be mentioned that when you have an IJobEntity you can use ScheduleParallel to have it be scheduled in parallel. This will automatically parallelize it per chunk.
You might want to look at some of the submissions to the Dots Community Challenge #1 which had the game of life as the theme. I think most people ended up making entities that stored chunks of array-data on them directly, without the use of native-arrays.