Skip to main content
edited body
Source Link
kitta
  • 109
  • 3

I have a background in ECS by using C# Entitas. The library itself has a very nice feature which lets me able to query the entity with a specific value in the component.

For example, query an entity with the player component which has an id equal to 1.

However today I need to working on JS Ecsy ECS framework, And there is no way I could query the specific entity by providing a value I want.

What I could do is just iterate through all entities with a player component and filter out all player which isn't equal to 1.

So I want to have aboutknow how to deal with this kind of query.

I have a background in ECS by using C# Entitas. The library itself has a very nice feature which lets me able to query the entity with a specific value in the component.

For example, query an entity with the player component which has an id equal to 1.

However today I need to working on JS Ecsy ECS framework, And there is no way I could query the specific entity by providing a value I want.

What I could do is just iterate through all entities with a player component and filter out all player which isn't equal to 1.

So I want to have about how to deal with this kind of query.

I have a background in ECS by using C# Entitas. The library itself has a very nice feature which lets me able to query the entity with a specific value in the component.

For example, query an entity with the player component which has an id equal to 1.

However today I need to working on JS Ecsy ECS framework, And there is no way I could query the specific entity by providing a value I want.

What I could do is just iterate through all entities with a player component and filter out all player which isn't equal to 1.

So I want to know how to deal with this kind of query.

deleted 82 characters in body
Source Link
kitta
  • 109
  • 3

I have a background in ECS by using C# Entitas.

  The library itself has a very nice feature (EntityIndex) which lets me able to query the entity with a specific value in the component.

However when it's come to others ECS frameworks none of them have this EntityIndex feature.

So I want to have more ideas for patterns to deal with this problem, For example,

Want to query an entity with the player component which has an id equal to 1.


 

However today I need to working on JS Ecsy ECS framework, And there is no way I could query the specific entity by providing a value I want.

What I know we can manually index those data using Dictionary and store it in some central component orcould do is just iterate through all entities with a systemplayer component and filter out all player which isn't equal to 1.

But not sure if it's the general thingSo I want to do or it's my design flaw leadhave about how to deal with this situation..kind of query.

I have a background in ECS by using C# Entitas.

  The library itself has a very nice feature (EntityIndex) which lets me able to query the entity with a specific value in the component.

However when it's come to others ECS frameworks none of them have this EntityIndex feature.

So I want to have more ideas for patterns to deal with this problem, For example,

Want to query an entity with the player component which has an id equal to 1.


 

I know we can manually index those data using Dictionary and store it in some central component or a system.

But not sure if it's the general thing to do or it's my design flaw lead to this situation...

I have a background in ECS by using C# Entitas. The library itself has a very nice feature which lets me able to query the entity with a specific value in the component.

For example, query an entity with the player component which has an id equal to 1.

However today I need to working on JS Ecsy ECS framework, And there is no way I could query the specific entity by providing a value I want.

What I could do is just iterate through all entities with a player component and filter out all player which isn't equal to 1.

So I want to have about how to deal with this kind of query.

Source Link
kitta
  • 109
  • 3

ECS, How to query an entity with specific value?

I have a background in ECS by using C# Entitas.

The library itself has a very nice feature (EntityIndex) which lets me able to query the entity with a specific value in the component.

However when it's come to others ECS frameworks none of them have this EntityIndex feature.

So I want to have more ideas for patterns to deal with this problem, For example,

Want to query an entity with the player component which has an id equal to 1.


I know we can manually index those data using Dictionary and store it in some central component or a system.

But not sure if it's the general thing to do or it's my design flaw lead to this situation...