You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way (or plans) to implement one to many weak references between entities, in ideally world I just want to tell that some entity belongs to another one, so I can query specific components from related entities
Pseudo code
world.ref(EntityID1, (EntityID2, EntityID3));
...
ComponentsView.filter_by_ref(EntityID1).for_each(|component|{
// component from EntityID2 or EntityID3 if they exists
}) ;
Preamble:
I tried to implement attributes system in my game (int, str, dex, hp, mana etc...)
The problem: Every entity can have only one component of type, but I need to have multiple attribute of same type (since they come from different sources). So I can't use components.
This means that I need to implement attributes as separate entities. Since every unit in my game will have more than 5 attributes, I can't simple iterate over all attributes and find which one relate to main hero when I want to calculate something.
I red part about parent-child relation, but I don't want to add parent component for each attribute, and create parent child hierarchy for each component type
Is there a way or plans to implement one to many weak references between entities
The text was updated successfully, but these errors were encountered:
No there is no plan for something like this at the moment.
Obligatory link to bevy's relations, an automated way to have entities reference other entities allowing all kinds of patterns.
I red part about parent-child relation, but I don't want to add parent component for each attribute, and create parent child hierarchy for each component type
At work we use an "indexing pattern".
You'd have an attribute hierarchy (or re-use an already existing hierarchy maybe?). When the hierarchy or BonusAttribute changes you update the Attribute component using all BonusAttribute affecting it.
Is there a way (or plans) to implement one to many weak references between entities, in ideally world I just want to tell that some entity belongs to another one, so I can query specific components from related entities
Pseudo code
Preamble:
I tried to implement attributes system in my game (int, str, dex, hp, mana etc...)
The problem: Every entity can have only one component of type, but I need to have multiple attribute of same type (since they come from different sources). So I can't use components.
This means that I need to implement attributes as separate entities. Since every unit in my game will have more than 5 attributes, I can't simple iterate over all attributes and find which one relate to main hero when I want to calculate something.
I red part about parent-child relation, but I don't want to add parent component for each attribute, and create parent child hierarchy for each component type
Is there a way or plans to implement one to many weak references between entities
The text was updated successfully, but these errors were encountered: