mercredi 15 mars 2023

Alternative to dictionary

I am trying to create a behaviour tree, following a guide (found Here) which to be honest is pretty average architecture wise in my opinion.

In each node he has a dictionary<string, object>() which stores potentially useful data for behaviour management for the whole tree, which can be iterated over up the tree (his iterations are incorrect I believe)

Anyway - any suggestions for not using strings as keys? Which from my, admittedly limited, knowledge is fairly bad practice. In fact, the whole 'generic data' dictionary thing seems like it isn't great. I understand they used it because the whole system is meant to be incredibly scalable.

My immediate thought was using Enums, but that seems like it could get out of hand very quickly if the tree gets large. If there isn't any logical alternative for the keys, is there another logical data structure to use instead of the dictionary... or suggestions for a better article on behaviour tree architecture which avoids this issue.

Aucun commentaire:

Enregistrer un commentaire