How do I Optimize my mobile game

Get help using Construct 2

Post » Sat Jul 15, 2017 7:05 pm

1 - Open up my game for better understanding - Follow game link:https://mega.nz/#!8ehkxDhQ!feFEgy-4MAo_bonoIAKK3oWsT2YhJ-DaxuKEM51Hq_4
2 - The problem is that the "container" function creates many unnecessary sprites when the "enemy" object is created.
3 - Is there any way to make the sprite "MetalGear" be created and destroyed the moment the bullet passes near the enemy?
Sorry for the translation :( Portugues / Ingles. If you do not understand, let me know if I write the post again.
B
21
S
2
Posts: 43
Reputation: 947

Post » Sun Jul 16, 2017 3:02 am

@Governador

What was wrong with the >>>set "MetalGear" invisible and visible? I think that set up you had was better for performance than create/destroy.


Anyway here is a capx changed to create/destroy see if that helps you: to open the capx you need the latest beta of construct 2
https://www.dropbox.com/s/zhcadzjhc4izbrl/Alert%21Alert%21.capx?dl=0
B
38
S
22
G
49
Posts: 205
Reputation: 28,493

Post » Sun Jul 16, 2017 3:16 pm

tarek2 wrote:@Governador

What was wrong with the >>>set "MetalGear" invisible and visible? I think that set up you had was better for performance than create/destroy.


Anyway here is a capx changed to create/destroy see if that helps you: to open the capx you need the latest beta of construct 2
https://www.dropbox.com/s/zhcadzjhc4izbrl/Alert%21Alert%21.capx?dl=0

Perfect was what I was looking for! The reason I'm opting for this path is because I've looked at an Ashley article that says invisible objects does not make the project more optimized. My game has many enemies and it would get very heavy each enemy to generate a sprite "MetalGear". There would be 30 "enemies" + 30 sprites "MetalGear" totaling 60 sprites: / It would be too heavy for a mobile game. I'll soon send you my playstore link here. Thank you saved my project: 3
B
21
S
2
Posts: 43
Reputation: 947

Post » Sun Jul 16, 2017 7:31 pm

@Governador cool I'm glad it helped you

I see what you mean, just a quick note Construct2 will render only the sprites that are on the screen, the ones that are off the screen will not affect performance, example you had 5 enemies on the screen and only those enemies + 5 "MetalGear" will count for performance, the only time you will notice the effect of performance from all the sprites together is when you first load the layout "at the start of layout" as it has to load all the sprites into the memory but after that only counts the sprites that are on the screen. but hey as I'm not an expert I could be wrong and perhaps you picked the right path :D
B
38
S
22
G
49
Posts: 205
Reputation: 28,493

Post » Sun Jul 16, 2017 11:21 pm

All i can think of.
https://www.dropbox.com/s/it7wlbenq74sd ... .capx?dl=0

Yet, it is not that much faster.
So lets take it in overdrive, there is only one way to know performance, measure.

Mine with to much moving objects.
https://www.dropbox.com/s/o28830v2hzpo7 ... .capx?dl=0

Yours with to much moving objects.
https://www.dropbox.com/s/qee816u14cn18 ... .capx?dl=0

Yes now there is some difference.
Conclusion: You really have to do weird things to bring performance (in a simple game) on its knees.

Or, your solution is not that bad.
B
33
S
18
G
27
Posts: 2,431
Reputation: 20,326


Return to How do I....?

Who is online

Users browsing this forum: Apollo14, MaujDeveloper, totoe and 5 guests