will too many families decrease performance on mobile?

Discussion and feedback on Construct 2

Post » Thu Sep 24, 2015 12:56 am

Hi, there

I found Family is very power, but I am wondering if I use too many families, it will decrease performance very much, or just a little?

please help, thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Thu Sep 24, 2015 3:30 am

In my experience, no. It's how you use them that matters.

Always test on your target device as you develop the game, from the start. Don't wait til much later and find out its too slow.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Thu Sep 24, 2015 12:16 pm

Families have no effect on performance by themselves, only the things you do with them matter. But the fact you ask means you should probably read Optimisation: don't waste your time
Scirra Founder
B
403
S
238
G
89
Posts: 24,660
Reputation: 196,167

Post » Thu Sep 24, 2015 3:25 pm

@Ashley

is the same true for functions, groups and global variables? Does their mere existance affect performance on some degree, ore just their use?
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Thu Sep 24, 2015 9:54 pm

@Silverforce @Ashley thanks, and Ashley thanks for the article, learned a lot
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Fri Sep 25, 2015 10:20 am

@Danwood - functions are just a definition of some work - the only thing they affect is memory usage by the size of them (example 1 function ~ 100bytes or more - depending on how big it is) - once they get used it could affect performance, but if you never use that function it only uses your memory waiting to be called. also depending on what is in that function you can have normal or horrible performance. functions should be used to do EXACTLY 1 job!

Code: Select all
example - "EnemyHealthCalculation" - enemy.hp = enemy.hp - someothervar.damage   
                                   - set enemy hpbar to some width
                - if hp <0  enemy destroy


and so on...

global variables are just a memory place that is used across the application - (therefore word "global") you can access it from any sheet. they just use memory and do nothing.
and groups... groups are run all the time, and events in them are run each tick / unless the group is disabled, or if that group contains functions.
functions are run "on function 'nameoffunction' ", non depending if they are in group or not. but group is just used to make your code cleaner - you put similar stuff in one group and close it when you don't use it :)
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,455

Post » Fri Sep 25, 2015 10:58 am

Danwood wrote:is the same true for functions, groups and global variables? Does their mere existance affect performance on some degree, ore just their use?

The entire engine is built with the philosophy that nothing has a performance impact unless you actually use it. Otherwise it would be nearly impossible to build large-scale games with decent performance.
Scirra Founder
B
403
S
238
G
89
Posts: 24,660
Reputation: 196,167

Post » Fri Sep 25, 2015 5:21 pm

@saiyadjin
@Ashley

Thanks guys, that's clear now. My team's working on a very large project with a massive event sheet, hundreds functions, families, variables etc. The main issue is the rendering, as Ash pointed out on the blog post, i was just curious if the mere scope of the game could also affect the performance, and that clears my doubts!
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Fri Sep 25, 2015 6:18 pm

why not split your stuff into more event sheets? having only one makes it hard to... organize
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,455


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests