Sign in to follow this  
Gureen Ryuu

Any good C++ Component Entity framework?

Recommended Posts

Hello all! (Skip to the bold if you want to get straight to my question :) )

 

I've been dabbling in the different technologies available out there to use. 

 

I tried Unity and component based design, managing to get a little guy up and running around a map with basic pathfinding. I really loved how easy it was to program using components, but I wanted a bit more control and something more 2D friendly, so I went with LibGDX.

 

I looked around and found 2 good frameworks for Java, which are Artemis and Apollo. I didn't like Artemis much, so I went with Apollo, which I loved. I managed to integrate it with Box2D and get a little guy running around bouncing balls. Great!

 

 

But since I want to try out most of the options, there is still C++/SFML that I haven't tried yet. Coming from a Java/C# background, I've always wanted to get my hands dirty with C++. But then, after some looking around, I noticed there aren't any Component-Based frameworks for me to use. There's a somewhat done porting of Artemis, but, aside from not being completely finished, I didn't quite like Artemis even in Java. I found Apollo's approach much more.. logical.

 

 

So, my question is, are there any good Component/Entity frameworks for C++ that I can use that are similar to Artemis, or preferably, Apollo

Share this post


Link to post
Share on other sites

I recently went through the same situation of deciding which component framework to use in C++!

 

I found three: Artemis, Cistron and Coment. I narrowed those three down to wither Artemis or Ciston. To make my final choice I built a hello-world style program in each library, and ended up choosing Artemis. Here is a brief writeup about each one:

 

Cistron (https://code.google.com/p/cistron/)

 

This one appears to be the closest to apollo, so you might like it. Logic is contained inside the components themselves, and components can communicate by broadcasting messages.

 

It was last updated 2 years ago, but it works well. Watch the slides to see a good explanation of how it works.

 

Artemis-Cpp (https://github.com/vinova/Artemis-Cpp)

 

I love the Artemis system, where game components are completely separate from the logic.

 

Coment (https://github.com/Biracun/Coment)

 

Also based on Artemis, but supports adding your own custom "Manager" classes, and setting your own global variables. These would be very useful for including a physics engine in your game. In fact, I may just change to Coment solely because of this (although I still need to test Coment. I havent used it yet, while I have used the other two).

 

When I was deciding previously on whether to use this or Artemis-Cpp, I was scared off by the following line:

 

 

Note that pointers to components may become invalidated when an entity is added, as their memory may be reallocated to make space for new entities.

 

However, now that I am reading it again, I realise this won't affect me as I don't store any pointers to components at all (only entities, which are ok).

 

How I made my decision

 

In order to choose, I decided on a simple game situation I wanted to test, and built a project using each of the frameworks (Artemis and Cistron, I did not try Coment).

 

In my case I wanted to see how difficult it was to link 2 entities together: A proximity sensor which deletes an object when the player comes within range. This was important in my case, but you may need something else.

 

Lastly, feel free to ask me any more questions! Thinking of clever ways to use components has had me excited for weeks so far! I can also send you my test projects if you're interested.

Edited by robertdodd

Share this post


Link to post
Share on other sites

Thank you both for your replies!

 

I was thinking about implementing Apollo, however my C++ is very, very rusty. I forgot many things, as I'm discovering, so I don't know if I have the C++ Fu to port a framework like that..

 

@robert

Thank you for the suggestions! As I mentioned, not very into Artemis, so I will skip that and probably Coment too.

 

It's a shame that Cistron isn't being updated. I hope it's fully functional, as I will be trying it today after work! Yes, the example you mentioned is one I'm very much worried about as it will involve not just component communication but entity communication.

 

If anyone else has any recommendation, please let me know! smile.png

Edited by Gureen Ryuu

Share this post


Link to post
Share on other sites

ENTITY X. X makes everything sound so cool cool.png

 

I see yours is based on Artemis, so I might pass it too.. Not sure if Entity X is the same. I kind of skimmed through the github info. I will be trying it and Cistron in the weekend, since right now I'm remove the rust from my C++ skills. ><

Share this post


Link to post
Share on other sites

@BeerNuts

Thank you for mentioning EntityX.

 

It uses the same system as Artemis, with separate logic and data, but it also has the "messaging" system of Cistron. I'm having trouble compiling it though.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this