Data 'ponents

Published May 06, 2013
Advertisement
I've been working (slowly) on the Unity-like Component System that backs my current game project. As time goes on, it's becoming less and less like Unity.

So I was thinking over the "tagging" system I added last time and quickly came to a couple of realisations.

1) Having a "string" based tag is limiting, what I really want is an object-based tag that would let me attach arbitrary data to the entity
2) Following on from this, I realised that this was akin to having a data-component

Now I'm thinking of splitting up my component system into DataComponents and BehaviourComponents. The key difference is that DataComponents would be just pure data attached to the GameObject. Behaviours are more like they are now, with a Start/Update method - I would also look more into beefing up the message passing so that the primary route to inter-object communication is via async messaging.

Why would I do this? The reason at the moment is very much down to the fact that I have a bunch of data associated with a component that I need to share between a couple of others. The way I'm doing it at the moment is to have components reference each other to grab the shared data. This feels bad. I could either consolidate them into one to try something new.

I'm thinking of doing the data component way.
Previous Entry Articles submitted
Next Entry Ocyphaps
0 likes 4 comments

Comments

Juliean

Have you also considered using seperate systems atop of purely data based components, like in EntityX? I find that most convinient, and it decouples the whole thing to an extent where communication and dependency between entities, components and systems are reduced to the absolut minimum. You wouldn't even need a messaging system for the base functionallity that way. I don't know what your requirements are, but I'd say you can give it a look, if you havn't already ;)

May 06, 2013 08:45 PM
evolutional

Well, it basically looks like I'm on the way to recreating EntityX. I started with "let's recreate Unity's system".

May 06, 2013 09:30 PM
Juliean

Yeah, I know what you're talking about. I started out with a behaviour-component based approach as featured in that one gamastura articel, and ended up with my own implementation of EntityX.

May 06, 2013 09:46 PM
evolutional

Thanks for the tip though. EntityX looks like a nice system to work with.

May 07, 2013 07:42 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement