Sometime ago, I was on the lookout for a Typescript ECS that I could integrate with Babylon.js. I couldn’t find something that I liked so I decided to write my own.
My main focus was to squeeze as much performance as possible from using TypedArrays and minimizing cache misses.
I have build an Archetypal ECS based on the SOA ( Struct of Arrays ) approach that integrates pretty well with Babylon.js. I was just reminded that it was sitting there so I decided to open source it for the community.
You can find the repo here : GitHub - Null0924/BabylonECS . There is a small documentation in the readme and some tests files where you can see how to operate the ECS.
Thanks for the feedback. I haven’t tried it on a large-scale setup ( multiple entities updating ) where ECS’s would thrive to be fair. I have started porting some old projects to it but nothing concluded as of yet.
I can setup a small demo if there is enough interest though.
I believe the real value is in the way it structures projects rather than performance.
Of course, it’s better with an ECS than without one, also in terms of performance but, we won’t see a huge boost I’m afraid.
I really like it’s design. Seems like it’s more intuitive than what I have done.
I focused on keeping data tightly together through the use of sparse sets and retrieving components through bitwise operators for increased speed.