Jump to content
  • Advertisement
Thomas Izzo

What games items belong outside of the ECS model?

Recommended Posts

Hi there,

I'm curious how some of you differentiate between ECS implementation and non-ECS implementation. For example, in my ECS implemented I have a render system that models all of my visible components. However, there are things that I draw to the screen that I wouldn't describe as "entities" it would seem odd for an ECS system to draw these (e.g. background image, user-interface icons, etc.). But at the same time, it would seem that certain user interface items would need access to component information. 

I'm curious how you differentiate between tasks that should fall within ECS and tasks that fall outside of it (e.g. should a pop-up window be considered an "entity"?).

I'm also curious how your ECS "update" function falls within your overall game loop.

 

Share this post


Link to post
Share on other sites
Advertisement

This post is absolutely just my personal opinion and personal experience working on projects of my own, and may not be in keeping with standard or best practice or what's done in widely-used frameworks that use ECS or other types of entity-component system.

This doesn't mean much (it's just anecdotal), but I've always handled everything within the entity-component system and haven't encountered any disadvantages with that approach (I haven't specifically implemented an ECS system though, so maybe there are considerations there that I'm not aware of). To me, trying to separate out certain things seems redundant and like it could lead to duplication of effort and introduce the additional burden of facilitating communication between the entity-component system and other systems.

Also, for what it's worth, I think with Unity's old 'game object' system, pretty much everything went through that system. I don't remember there being separate consideration for certain types of things. (I'm not familiar with Unity's new ECS system though. Maybe things are different with it than with the 'game object' system.)

Maybe you could start by asking, what possible benefits do you see in handling certain types of things (e.g. backgrounds and UI elements, to use your examples) outside the entity-component system? And/or, conversely, what possible disadvantages do you see in handling such things within the entity-component system? The answers to these questions might shed some light on the issue for you.

To address some things specifically:

Quote

However, there are things that I draw to the screen that I wouldn't describe as "entities" it would seem odd for an ECS system to draw these (e.g. background image, user-interface icons, etc.).

Personally it doesn't seem odd for an entity-component system to draw such things - it seems natural. Also, it sounds like maybe you might be reading too much into the word 'entity'. In this context, I'd interpret it just to mean 'thing', which is pretty all-inclusive.

Quote

But at the same time, it would seem that certain user interface items would need access to component information.

This seems like a hint that there may not be much if anything to be gained by handling such things separately.

Quote

I'm curious how you differentiate between tasks that should fall within ECS and tasks that fall outside of it (e.g. should a pop-up window be considered an "entity"?).

Something like an in-game pop-up window certainly seems like an entity to me, and I've treated such things as entities in my own projects. Again though, I've typically treated everything as an entity, with no exceptions.

Since discussion of topics related to entity-component systems can sometimes become contentious, let me reiterate that these are just my opinions and initial thoughts in response to what you posted. Maybe I'm completely off base and others will provide better feedback than I have here.

Edited by Zakwayda

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!