Entity Component Architecture

vladdeSV via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 26 12:55:30 PDT 2016


On Friday, 26 August 2016 at 16:34:26 UTC, MrSmith wrote:
> Your solution is basically OOP with composition used. It is 
> enough for convenience, but not enough for speed. Also memory 
> allocation for each component looks scary.
> Systems simply iterate over a all entities that have given set 
> of components.
> Check my solution API 
> https://gist.github.com/MrSmith33/e861a289d295ec4659a0
> I have query maker that iterates over smallest collection and 
> gets other components. Full code is here 
> https://github.com/MrSmith33/voxelman/tree/master/source/datadriven. WIP.
> Here is example of usage (single component used here though) 
> https://github.com/MrSmith33/voxelman/blob/master/plugins/test/entitytest/plugin.d

What I can conclude so far is my approach uses a lot of 
processing power. I did a test where I generated 10000 entities 
and it drained my CPU to 50%.

All feedback is appreciated. Thank you for your input :)


More information about the Digitalmars-d mailing list