Question about optimisation for smartphones

Get help using Construct 2

Post » Fri Dec 11, 2015 3:45 pm

If I will create all objects of my game behind some "loading" layout on game startup, whether they will be stored in the memory after?
Because "saving to memory" process causes a FPS drop, and I want to avoid it during the game.
B
39
S
16
G
6
Posts: 238
Reputation: 7,885

Post » Fri Dec 11, 2015 6:26 pm

Which saving to memory process are you referring to ?
B
44
S
14
G
60
Posts: 1,795
Reputation: 36,388

Post » Fri Dec 11, 2015 6:49 pm

plinkie wrote:Which saving to memory process are you referring to ?


I meant the moment when something is created for the first time in particular gaming session.
For example, your hero has got in some room, then a figurative enemy spawned and caused FPS drop, but after this, every next enemy spawns without any trouble.
He is "loaded to memory" in some kind. Am I right?
B
39
S
16
G
6
Posts: 238
Reputation: 7,885

Post » Fri Dec 11, 2015 7:02 pm

Yes that's correct. I believe each object loads into memory on a layout but once you leave that layout it is unloaded from memory, therefore you only need to load the relevant objects for that layout at any time.

Loading all the game assets in your game on an initial layout won't work as they won't be there on the new layout. When you leave the layout you don't have to worry about any other objects being left behind unloaded, it is done automatically I think.

The fact that there is a noticeable FPS drop on an object being created but not for future instances of that object seems like a problem with the object.

You could try: leaving the enemy object on the layout view; when it is preloaded on moving to the layout during the game, does the FPS spike occur? Or is it just when the enemy is created/spawned?
B
44
S
14
G
60
Posts: 1,795
Reputation: 36,388

Post » Fri Dec 11, 2015 7:10 pm

plinkie wrote:Yes that's correct. I believe each object loads into memory on a layout but once you leave that layout it is unloaded from memory, therefore you only need to load the relevant objects for that layout at any time.

Loading all the game assets in your game on an initial layout won't work as they won't be there on the new layout. When you leave the layout you don't have to worry about any other objects being left behind unloaded, it is done automatically I think.

The fact that there is a noticeable FPS drop on an object being created but not for future instances of that object seems like a problem with the object.

You could try: leaving the enemy object on the layout view; when it is preloaded on moving to the layout during the game, does the FPS spike occur? Or is it just when the enemy is created/spawned?


I dont have any enemies in my game, that was just for example :D

I just wanted to know how this memory manipulation things works, thanks alot for your answer!
B
39
S
16
G
6
Posts: 238
Reputation: 7,885

Post » Fri Dec 11, 2015 7:13 pm

Ah I see, no problem.

I just had a brief look at the manual and it looks like the information is mostly here: https://www.scirra.com/manual/183/memory-usage

:)
B
44
S
14
G
60
Posts: 1,795
Reputation: 36,388

Post » Fri Dec 11, 2015 7:35 pm

plinkie wrote:Ah I see, no problem.

I just had a brief look at the manual and it looks like the information is mostly here: https://www.scirra.com/manual/183/memory-usage

:)


Thanks for the link, very usefull one. Shame on me, I didn't use the search.
B
39
S
16
G
6
Posts: 238
Reputation: 7,885


Return to How do I....?

Who is online

Users browsing this forum: Jazz813, KIDofGOD and 2 guests