Families and performance

Discussion and feedback on Construct 2

Post » Thu Jun 04, 2015 8:23 am

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! :)
Black Bobby The Hole Greenlit with 303 votes.
B
36
S
8
G
1
Posts: 163
Reputation: 3,029

Post » Thu Jun 04, 2015 9:44 am

It probably does not make any difference either way, but if you doubt that, you can find out yourself.
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,746

Post » Thu Jun 04, 2015 11:49 am

I'll take your word for it for the moment @Ashley :)

If I had enough time I would have tried to see if there's any performance gain/loss on a crappy device I got.

Thanks
Black Bobby The Hole Greenlit with 303 votes.
B
36
S
8
G
1
Posts: 163
Reputation: 3,029


Return to Construct 2 General

Who is online

Users browsing this forum: mihirolover and 2 guests