Greetings
I have a project with a lot of different sprites. I'm making a point and click adventure game. The estimated number of interactable objects is around 500-1000.
Now my question for debate would be regarding Families and how they affect performance.
I would like to use several families, all holding the all the objects.
One family for the localized description, let's say "ObjectsDescriptionFamily" which would hold instance variables of the sort "ObjectsDescriptionFamily_EN" , "ObjectsDescriptionFamily_FR", etc, for all the languages that my game will support.
Then I would have a family with the object's positions, like InitialPos_X, InitialPos_Y, CurrentPos_X, CurrentPos_Y, etc
And the list would continue.
What would be the performance difference between using let's say 5 families holding all the objects but certain instance variables each rather than 1 family holding all the objects with all the instance variables?
Would the game perform better if I would drastically reduce the number of instance variables and replace them with global variables?
Like instead of having Object_0001.ObjectsDescriptionFamily_EN = "description string" I would have it pointing to Object_0001Desc_EN_globalVariable, and this variable would hold "description string". The global variable part would help with organizing the project much better.
I'm eagerly awaiting your thoughts on these 2 matters: 5 families vs 1 and family vs global variable
Cheerio!