Skip to content

Most efficient way to determine which components an entity possesses? #1060

Answered by skypjack
Net5F asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, keeping the list of components for each entity has its pros and cons and the right approach really depends on the final use.
For example, in a game on which I've worked in the past we only tracked components on addition. The final list can contain false positives but the solution doesn't hurt performance if you have many creations/deletions.
Also, when it comes to sharing data between client and server, you don't even want to send all components most of the time. As a trivial example, a flyweight-like handle for a renderable object or an input listener tag aren't of interest in this context probably.
I'd probably flip the problem on its head then and send only the components of inte…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Net5F
Comment options

@skypjack
Comment options

Answer selected by Net5F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question open question
2 participants