How heavy is platform behaviour FPS wise?

Get help using Construct 2

Post » Thu Jun 06, 2013 4:13 pm

hello,

I started new project for mobiles, its simple sidescroller shooter.
and I'm getting very slow fps with enemies, I know its my fault because I managed to run other games with solid 60FPS with C2.

before I go to deep into debuging events, I wanted to ask for general advice, if I'm taking wrong approach.

Here is what I have
1. I have enemies with Platformer Controller attached, they have 2 animations with in total probably 36 sprites size of 64x128.

Should I avoid using platformer behavior for enemies?

2. they consist of several parts, and have container, is that OK?

3. They are placed statically on map, should I spawn them on demand? (e.i when player is near) I don't know how construct loads them.

Cheers
-Hellwalker
B
24
S
7
G
3
Posts: 138
Reputation: 2,795

Post » Thu Jun 06, 2013 4:15 pm

4. I'm using both solid and platform on enemies, could that cause problems?
B
24
S
7
G
3
Posts: 138
Reputation: 2,795

Post » Thu Jun 06, 2013 5:09 pm

See performance tips. Usually poor performance is caused by rendering, and not events or behaviors.
Scirra Founder
B
378
S
220
G
84
Posts: 23,871
Reputation: 188,237

Post » Thu Jun 06, 2013 6:39 pm

Hm I got interesting Results.
I guess my problem is closer to area of collision checks.
(without zombies fps is solid 60)
hellwalker2013-06-06 18:42:17
B
24
S
7
G
3
Posts: 138
Reputation: 2,795

Post » Fri Jun 07, 2013 11:33 am

Ok, yep having many Platformer Behavior Objects seems to drastically lower Framerate. bellow 30 fps

I have 7 Objects and basically this is only code attached to them.


Zombies have Platformer and Solid on Them.


Tested Platforms, Ipad 3 and Amazon Kindle Fire, Exported via cocoonJS
B
24
S
7
G
3
Posts: 138
Reputation: 2,795

Post » Fri Jun 07, 2013 3:23 pm

platform is a complicated behavior probably calculating stuff the zombies don't need...

Personally I would custom build the enemy movement using x,y and dt or bullet behavior modified...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Fri Jun 07, 2013 9:28 pm

its very handy, as it can detect walls, ground. Has Animation Triggers and so on.

But yeah, I moved on to manually creating movement with set x and dt.
Its interesting though on PC I get perfect framerate and on several devices I have available, FPS reduction was same on each of them, when Ipad 3 is supposed to be much more powerful then android phone I had available.
hellwalker2013-06-07 21:30:01
B
24
S
7
G
3
Posts: 138
Reputation: 2,795

Post » Fri Jun 07, 2013 10:21 pm

For these types of issues, I like to just right-click and disable whole chunks of code. Then I know exactly what is causing the performance issues.
B
53
S
14
G
13
Posts: 818
Reputation: 17,424

Post » Fri Jun 07, 2013 11:46 pm

hmmm, you put platformed & solid on your zombies?

I can't say this for sure. I really can't. But i remember fiddling around with Solid and another controlling behaviour. I ended up with the object colliding with itself.

Also be careful with how your working with collision checking. Collision checking can use a ton of power if not used carefully. You might want another criteria on that.

Every 0.2 seconds
-> Is zombie colliding
-> Is zombie on screen

you could be right that maybe it is the platformer being power hungry, but it might be just how it's being used.
B
88
S
18
G
9
Posts: 2,455
Reputation: 14,928

Post » Sat Jun 08, 2013 6:46 am

I tried empty scene with no events at all and platformer behavior on 64x128 sprite with collision set to bounding box. if i remember correctly FPS was 30~40 for 7 characters on screen.

When i disabled solid in any of tests I got max 3~4 fps boost.

there was something wrong with my events, as it was taking away around 20 FPS, but platformer was taking extra 30.

I was on a deadline and decided to go with simpler solution, but I'm curious to nail down the problem. it could be lot of things, c2, cocoon compiling, cocoon launcher, and most likely me :D
B
24
S
7
G
3
Posts: 138
Reputation: 2,795

Next

Return to How do I....?

Who is online

Users browsing this forum: cgsammu, GabrielBalas, LukeNecklace, omnipaws, SoldjahBoy, Trimeister and 10 guests