A.I Blackboard concept in entt. #1237
-
hello,
So then it would be used like this the a.i components
Having to look into the key by string in a map seems pretty slow to me. The alternative would be to create the black board as a simple entity and add components to it that were represented before as key:value in the map.
And then instead, of bb.hasKey("PlayerPosition")), we would check as usual for that component. As far as I understood, the point of the blackboard is to have the key, value map to avoid having to create it as an entity that recieves components. The map is updated each frame with the blackboard set method. I was wondering if any one has thoughts about how to implement in entt this blackboard concept. Thx |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Have you considered the |
Beta Was this translation helpful? Give feedback.
-
okey, one last question. I have my blackboard struct working now and I am using entt::hashed_string.
all working fine. My only doubt is on how to cast into the proper type the value. I am using std::get<> like so
And it works fine. I am just a bit obsessed into writing fast code since the the black board can be accesses each frame. Thx |
Beta Was this translation helpful? Give feedback.
Have you considered the
hashed_string
class for your use case then?As far as I remember, the blackboard is a centralized element, it doens't make much sense to me to bind it to an entity. 🤔
That said, take this with a grain of salt. I should refresh my mind before giving meaningful details in this regard. 🙂