-
Member
Does the component list of entities change mid game ?
Are components added/removed from the entity midgame ? If not are their pointers the same until the area is changed ? I'm trying to see how I could cache the component pointers. What do you guys know about this ? Thanks
-
Originally Posted by
orenrevenge
Are components added/removed from the entity midgame ? If not are their pointers the same until the area is changed ? I'm trying to see how I could cache the component pointers. What do you guys know about this ? Thanks
They changes when entities are added/removed.
Entities are added when they come into the network bubble. Entities are removed when they go outside the network bubble.
So basically Component pointer address can change at any Frame if you are storing all the entities in a given map.
They remain static if you are only storing the entities that are in the Network bubble.
Last edited by GameHelper; 01-22-2022 at 04:13 PM.
If I did not reply to you, it mean the question you are asking is stupid.
-
Post Thanks / Like - 2 Thanks
-
Member
i see, so there is room for caching here, thanks for the info
what do you think about the new struct that hold the indices of the components, it used to be a std::list<std:: pair<const char*, int>> a few patches ago when I fiddled with poe, now its a custom struct made of an array of a 64 bit mask and 8 pointers. im not sure why they are using this struct, maybe there is some meaning behind the mask that makes querying for components faster ?
-
Originally Posted by
orenrevenge
i see, so there is room for caching here, thanks for the info
what do you think about the new struct that hold the indices of the components, it used to be a std::list<std:: pair<const char*, int>> a few patches ago when I fiddled with poe, now its a custom struct made of an array of a 64 bit mask and 8 pointers. im not sure why they are using this struct, maybe there is some meaning behind the mask that makes querying for components faster ?
yeah they changed the data structure to a custom one. if you need help in reading that data structure properly you can look at this code ExileApi/Entity.cs at 69fe22fdea222a41d65b0c1ff642793661447f71 . Queuete/ExileApi . GitHub.
However, with respect to cache, this is not important, it's just another data structure to read and get the data from.
So, are you storing all the entities in a given Map/Area or just the entities which are in the network bubble?
If I did not reply to you, it mean the question you are asking is stupid.