1
General discussions / Re: [Video] Implementation of a component-based entity system in modern C++
« on: February 19, 2016, 05:25:06 pm »
Hi. Thanks for the reply.
I took a look at Maik Klein's solution and i find it quite interesting. It pretty much "solves" the problem I encountered previously which prevented me from looping over more than one array of component at a time (because of the reordering and indexes that don't match anymore from one array to the other).
His solution is roughly equivalent to using X number of "entity managers" rather than just one. Each one manages its components arrays.
Anyway I implemented something similar to Maik Klein on top of my previous experiment just from reading his blog post. He's using Hana. I kept using Niebler's Meta. Also from the start I was using the C++17 folding expressions which are awesome.
Something interesting (not sure it's that interesting though lol) is I have to access tuple elements by an index at runtime in some occasion. Basically the component group ID (tuple index) is stored in my handle type as a runtime member rather than a constant template parameter. Weird design choice maybe but I wanted to have the same type for all my handles.
This is just a brain dump of what I have done. It's mostly a pretext to get back to c++14/17 programming rather than a serious project: https://github.com/metagoto/rako
I took a look at Maik Klein's solution and i find it quite interesting. It pretty much "solves" the problem I encountered previously which prevented me from looping over more than one array of component at a time (because of the reordering and indexes that don't match anymore from one array to the other).
His solution is roughly equivalent to using X number of "entity managers" rather than just one. Each one manages its components arrays.
Anyway I implemented something similar to Maik Klein on top of my previous experiment just from reading his blog post. He's using Hana. I kept using Niebler's Meta. Also from the start I was using the C++17 folding expressions which are awesome.
Something interesting (not sure it's that interesting though lol) is I have to access tuple elements by an index at runtime in some occasion. Basically the component group ID (tuple index) is stored in my handle type as a runtime member rather than a constant template parameter. Weird design choice maybe but I wanted to have the same type for all my handles.
This is just a brain dump of what I have done. It's mostly a pretext to get back to c++14/17 programming rather than a serious project: https://github.com/metagoto/rako