Physics and framerate issue

Discussion and feedback on Construct 2

Post » Thu Dec 15, 2011 8:22 pm

Hi

I have a game that has about 40 red sprites (48 x 48)no behaviours applied.

The frame rate is 59 fps.

I have an event that adds a new white sprite to the level when I click on screen.

The new white sprite is 48 x 48 with Physics applied.

As soon as I add the white sprite the framerate drops to, (and stays at) 26 fps.

Any ideas why this happens?




EDIT 1

After further testing, the problem is happening because the new sprite is a triangle shape with a triangular collision mask.......

If I change the shape to a square, the framerate stays at 59.


EDIT 2

Forget the above Edit1....i didnt have physics applied to the square.


The framerate drops as soon as i add any sprite(using physics) to the game.

chrisbrobs2011-12-15 21:15:37
B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Thu Dec 15, 2011 9:56 pm

Did you set Physiscs world stepping to Framerate independent?cesisco2011-12-15 21:57:36
B
33
S
11
G
9
Posts: 381
Reputation: 10,153

Post » Thu Dec 15, 2011 10:35 pm

[QUOTE=cesisco] Did you set Physiscs world stepping to Framerate independent?[/QUOTE]


To be honest, i wasn't aware of the setting...should I enable this?
B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Thu Dec 15, 2011 10:40 pm

I think Physics is the only behavior that isnt framerate independent by default, but i dont know if your framerate issue will be fixed with this.cesisco2011-12-15 22:41:10
B
33
S
11
G
9
Posts: 381
Reputation: 10,153

Post » Thu Dec 15, 2011 11:16 pm

[QUOTE=cesisco] I think Physics is the only behavior that isnt framerate independent by default, but i dont know if your framerate issue will be fixed with this.[/QUOTE]

Tried it....no change though.

Thanks anyway.
B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Fri Dec 16, 2011 12:42 am

Can you post a .capx? Also, what's your system spec? Physics can be pretty CPU intensive but it shouldn't be that bad.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478


Return to Construct 2 General

Who is online

Users browsing this forum: humanescape, Yahoo [Bot] and 6 guests