-
-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Tags: Revenge #169
Comments
Personal opinions from my own experiments and projects. A "singleton component" is something ive allways used, a lot of times. I tended to use the tag feature before, but when it got deleted i just implemented my own. The usage of singleton components is very common when you want "engine-wide" globals. I have a GameTimeComponent, wich holds pause state, delta time, and other similar values, and then i use it everywhere. I also use singleton components to store System related data, like an acceleration structure. This lets me have multiple different systems that affect the same acceleration structure, or query it to do physics. Very useful to have all your "system state" in components like this, and keep the systems themselves stateless. It allows you to store the ecs state into a file, or resume things, or have a system that caches it later, or debug menus... I think a possible implementation is just to go with that singleton entity, as its barely a couple lines of code, and even lets you have multiple of the same "singleton", if you create a new entity and assign that component, as the singleton entity will still appear in Views. |
To me, the name tag sounds essentially like what EnTT’s labels are. A singleton component is useful, but please don’t call it tag 😝 I also like he idea of sharing a component betweeen multiple entities (groups of entities sharing components, not a singleton component), but it’s already easy to do this by having components store a handle or id for some shared resource, so EnTT doesn’t need anything here. I do think the tag concept is a useful one to support and I’d welcome its return. But with that said, I haven’t found them necessary either because I already use handles to a resource system and service locator to access that, and then tag my entities with label components as necessary, or store entity ids in systems state where I would have selected by tag before, although tags do let you to add other components in a view. |
I like the idea of singletons being tied to the registry mainly because |
Added a note the to the TODO list. Not sure I'll reintroduce them with |
More than once I've been asked to reintroduce tags in
v3
.However, the previous implementation had some design flaws and problems and I don't want to restore it.
The purpose of this issue is to discuss common uses and requirements (ie should tags be assigned to entities or not?), then try to find an implementation that works and makes sense.
I'd like also to understand if it's something that most of the users want back or not, so please add at least a 👍 to the issue if you want to see tags also in
v3
but you don't want to participate to the discussion.Thanks.
The text was updated successfully, but these errors were encountered: