Sign in to follow this  
pinebanana

C++ Entity System

Recommended Posts

pinebanana    479
After many hours of confusion on how I should implement my [url="https://bitbucket.org/miguelishawt/anax-entity-system"]Entity System[/url]; it has finally been completed (at like 4 in the morning) [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]. This framework is based of the Java Entity System, Artemis, however it's a bit different with the way it is implemented, but you will find similarities. Unfortunately it is not entirely complete, I believe the only thing left to do is the SceneDirector, however, that's not really a required class in the framework, it's more of an add-on to help you manage Scene* objects.

*If you are familiar with the Artemis framework, a Scene is a World.

[u][size=5][b]Features:[/b][/size][/u]
- Unlimited component-types
- Fast retrieval of components
- Creation of components, entity-systems and entity-managers through a string

If you are going to try this framework out, please submit ANY bugs and feel free to add suggestions. I have put [url="https://bitbucket.org/miguelishawt/anax-entity-system/issues?status=new&status=open"]issues[/url] in my [url="https://bitbucket.org/miguelishawt/anax-entity-system"]BitBucket[/url] repo available for the public, so please [url="https://bitbucket.org/miguelishawt/anax-entity-system/issues/new"]submit[/url] bugs/suggestions there. There are no known bugs at the moment, I have resolved them.

[b]NOTE:[/b]
If you are unsure what an Entity System is, I recommend reading this basic tutorial and preferably a blog, such as [url="http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/"]this[/url] one, before reading the tutorial, which describes what one is.

[b][size=5]EDIT:[/size][/b] Moved to tutorial to the public wiki on BitBucket, [url="https://bitbucket.org/miguelishawt/anax-entity-system/wiki/Home"]here[/url]. Edited by pinebanana

Share this post


Link to post
Share on other sites
BeerNutts    4400
Good job, I know you enjoyed working on it. It has a lot of similarities to my [url="https://github.com/Beernutts/Escape-System"]Escape System[/url] Entity System, but it also has some differences, including some improvements.

The 1st thing I noticed that bothered me a little was the Macro requirement. As minor as it is, I couldn't help but frown when I saw it.

I haven't been able to look through it all, but it looks good so far. Have you used it extensively? When designing the Escape System, and using a test program, it seemed to all work fine. However, when I put it into an actual game, I found some other issues that had to be ironed out (which, honestly, I don't think I've uploaded to github)

Share this post


Link to post
Share on other sites
pinebanana    479
[quote name='superman3275' timestamp='1355678803' post='5011311']
Looks awesome! I've BookMarked this page, I'll probably use it in my next project.
[/quote]

Thanks, although I may have some minor changes when I get around to it :)


[quote name='BeerNutts' timestamp='1355676429' post='5011298']
Good job, I know you enjoyed working on it. It has a lot of similarities to my [url="https://github.com/Beernutts/Escape-System"]Escape System[/url] Entity System, but it also has some differences, including some improvements.

The 1st thing I noticed that bothered me a little was the Macro requirement. As minor as it is, I couldn't help but frown when I saw it.
[/quote]

Thanks, and yeah... I would prefer not to use macros, but in order to have unlimited component types, it is required (without using hash-maps). Also, I placed them to serialise the components/systems/managers.

[quote name='BeerNutts' timestamp='1355676429' post='5011298']
I haven't been able to look through it all, but it looks good so far. Have you used it extensively? When designing the Escape System, and using a test program, it seemed to all work fine. However, when I put it into an actual game, I found some other issues that had to be ironed out (which, honestly, I don't think I've uploaded to github)
[/quote]
I have tested it, but I don't believe all of it's features, and I have not tested the performance of it. There is probably a lot of optimizations I will do, but I still have yet to make a game with it, which will be soon. Currently I'm just a tad busy with other things :C. Thanks again.

Share this post


Link to post
Share on other sites
wqking    761
Very interesting and good stuff.
One question, do we want to couple entity/component with scene?
I think an entity component system is an independent system which can be used freely without coupling to scene.

Share this post


Link to post
Share on other sites
BeerNutts    4400
[quote name='wqking' timestamp='1355726430' post='5011560']
Very interesting and good stuff.
One question, do we want to couple entity/component with scene?
I think an entity component system is an independent system which can be used freely without coupling to scene.
[/quote]

In this System, a Scene is a specific world where the Entity lives, it's not a Scene in the rendering sense. An Entity has to be active within a Scene, but it can be moved from Scene to Scene if you are using multiple Scene (which probably isn't common).

Share this post


Link to post
Share on other sites
pinebanana    479
Very interesting and good stuff.
One question, do we want to couple entity/component with scene?
I think an entity component system is an independent system which can be used freely without coupling to scene.

A tutorial on the wiki is up (it is not entirely completed, but most of the basics are there)

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