How do I increase the frame rate ?

Get help using Construct 2

Post » Tue Feb 16, 2016 9:46 am

So I have something beautifully coded (which I have removed in the attached CAPX), but it is just ridiculously slow.

As it stands, it shows it uses 75-95% of the CPU (according to the debug window)

Any idea where I have stuffed this up ?

Slow CAPX File
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Tue Feb 16, 2016 9:52 am

Don't use the inspect tab to measure your cpu usage. Use the profile tab or use cpuutilisation as expression in a textfield. The inspect-tab has a high cpu usage if there are many objects by itself.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Feb 16, 2016 9:53 am

Remember that the debug window is artifically high due to the work it is doing. Use the Profile tab.

Regardless, I'm seeing around 5% in debug and <1% in Profile tab.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,415
Reputation: 59,516

Post » Tue Feb 16, 2016 11:16 am

@zenox98 Really ? 'cause here's the full CAPX and it is as slow as a dog on both my PC and mobile.

Link
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Tue Feb 16, 2016 1:26 pm

Ah. Well this is a different kettle of fish.

Check and you will see after several seconds, collisions increases steadily. I stopped it after it got to performing over 10000 collision checks every 60th of a second, which is really bad.

Look at the profile tab also to see where where most of the time is spent.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,415
Reputation: 59,516

Post » Tue Feb 16, 2016 1:50 pm

@zenox98 did you miss a zero in the amount of collision checks per second?

@emoaeden
1. the scoring took a huge amount of cpu-time. Try to disable the scoring group and you will see it.

2. I have up to 6000 collision checks per tick, that would be up to 360.000 collisions checks every second with 60 FPS. There has to be a problem with your collision checks.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Feb 16, 2016 1:58 pm

It starts for me at around 5000/tick but just steadily increases. As I said, I stopped it at over 10000/tick. If a game's collisions steadily increase like that then it has a major problem with the code.

Edit: Double checked and it is doing what I have posted, for me at least.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,415
Reputation: 59,516

Post » Tue Feb 16, 2016 2:10 pm

Ahh, sorry @zenox98 I read it wrong. I read every second, not every 60th of a second. That is even higher what I observed.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Tue Feb 16, 2016 8:36 pm

You guys are awesome ! Yep that is indeed the issue. I think it's 'cause I'm calling a function which calls another function, which then calls itself. :o
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Wed Feb 17, 2016 3:53 pm

Infinite recursion is a terrible thing to behold.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dop2000, eleanorawesome, RODInteractive, Yahoo [Bot] and 37 guests