How do I improve performance for obstacle spawnings

Get help using Construct 2

Post » Sat Mar 26, 2016 1:02 pm

Hi guys,

I am currently working on an endless runner in which I have a set of obstacles that get created randomly outside of the screen while running.
The obstacles are tilemaps and are placed in a separate layout.
Now the game runs quite smooth on mobiles, but with every obstacle that spawns I experience a small lag. Summed up for every obstacle
that spawns it results in a laggy experience.

I tried the following to solve this problem:
1.) I tried to place all the obstacles inside the main layout. I was expecting the Loader Layout to preload all of them so that spawning an obstacle
doesnt create a lag anymore. However, the result was a drastic constant frame drop to about 5 fps.
2.) Tried to preload the obstacle layout from the layout loader and jump into the main layout after completion. However, when a layout it changed, all preloaded images get removed from memory again. This also means that with every new game session, all obstacles need to be loaded again.

Happy for every input...
B
7
S
1
Posts: 41
Reputation: 525

Post » Mon Mar 28, 2016 4:22 am

are you destroying the obstacles that are already out of the window?, even if you can´t see them, the engine is still calculating position and collisions, that might be causing your slowdown
Image
B
57
S
13
G
6
Posts: 271
Reputation: 12,103

Post » Mon Mar 28, 2016 1:49 pm

yea im destroying them. its not a slowdown that gets worse while im playing. I can definitely
tell that it is caused by loading an obstacle
B
7
S
1
Posts: 41
Reputation: 525


Return to How do I....?

Who is online

Users browsing this forum: el3um4s, TylerJS and 9 guests