Low FPS at Start of Game

Discussion and feedback on Construct 2

Post » Wed Oct 17, 2012 8:56 am

I've noticed that when I first run a project, the FPS drops pretty low for the first few seconds, and then it gets back to 59-60 FPS. There aren't that many events running "At Start of Layout".

I have quite a few objects which are not in use yet, so I just drag them off screen and select the "Destroy outside layout" behaviour. Could this be part of the problem, or does this happen often in larger / complex games?
B
7
S
1
G
1
Posts: 37
Reputation: 1,128

Post » Wed Oct 17, 2012 12:36 pm

Check "project setting" and looking for "use loader layout" set it to "No".

If use loader layout set to "yes" , it's mean your project load the first layout and script, start the game and continuous loading another layout, it's reason FPS drop for a few second. If user layout set to "no", the whole project will be loaded and start game.farsmile902012-10-17 12:38:27
B
50
S
12
G
7
Posts: 259
Reputation: 10,371

Post » Wed Oct 17, 2012 1:21 pm

Just checked it, the "Use Loader Layout" is set to no. There are a few events and computations at the start of the layout, but when these reoccur after the initial lag, there doesn't seem to be a problem.
B
7
S
1
G
1
Posts: 37
Reputation: 1,128

Post » Wed Oct 17, 2012 1:32 pm

This kind of behavior is pretty normal: in the first few seconds, the browser will be compiling javascript and optimising everything for maximum performance, which takes a lot of CPU time and slows down the game. Once it's done everything should run smoothly. All you can really do about this is try to make the player spend the first few seconds on a menu screen so all the optimisation happens when performance isn't essential.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Wed Oct 17, 2012 2:44 pm

Thanks for the answer Ashley. Does this occur whenever a new layout is loaded, or only just after the initial load?
B
7
S
1
G
1
Posts: 37
Reputation: 1,128

Post » Wed Oct 17, 2012 3:17 pm

@Len - it should only happen at the beginning of the entire game. The code is already optimised when switching layout so it should not be doing any extra work there.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Thu Oct 18, 2012 12:46 am

Sweet, thanks again.
B
7
S
1
G
1
Posts: 37
Reputation: 1,128


Return to Construct 2 General

Who is online

Users browsing this forum: DTernes and 1 guest