Need help with frame rate in mobile.

Get help using Construct 2

Post » Fri May 09, 2014 10:30 pm

Hi there guys!

Well, I finally got an Android device, so I was very excited in porting my creations for mobile, but I am facing a lot of trouble with the frame rate :(

The game I am trying to port is Penguin Slide! (I uploaded it on Scirra Arcade. If you want to take a look: http://www.scirra.com/arcade/action/12443/penguin-slide)


I used the Infinite Runner demo as a reference for some coding and asset design decisions, but I already changed some properties and file sizes (which caused some undesired changes on the game visuals, such as the thin ice texture)

- changed the background, that was a huge tile with the same size from the screen (480x640). it was divided into the thin ice and the snow borders (3 tiles, 64x64px)

- set Collision to 'No' to every object, except the penguin. The ice blocks and the popsicles only have it turned on while on screen.

- pixel rounding, WebGL to On, Sampling to Point, Clear Background to No and every layout's all layers' transparent to Yes


Now I am taking a look at the code. I am using some 'Every Tick' events, and using timescale as well. If they are directly responsible for the game running so slow, I don't know, but since they are key elements to the game, I don't know how to recreate this mechanic in another way.

Could you guys give me a hand and take a look at the code? I am trying everything but I am not getting much progress.


Thanks in advance, fellows!
You do not have the required permissions to view the files attached to this post.
Last edited by pcfernandesjr on Sat May 10, 2014 2:45 pm, edited 2 times in total.
B
12
S
6
G
3
Posts: 101
Reputation: 3,930

Post » Sat May 10, 2014 12:49 pm

Anyone? :(
B
12
S
6
G
3
Posts: 101
Reputation: 3,930

Post » Sat May 10, 2014 2:06 pm

What does your debug read in terms of collision count. I'm sure you can make the game without the need for collision checks. Try using the overlapping event and disable collisions for everything. The particles object is known to reduce fps count. Test test test in debug.

Honestly it's easier to read an event sheet from a capx file. You can pm the capx if you want, i have some free time atm :)
B
16
S
4
Posts: 138
Reputation: 1,454

Post » Sat May 10, 2014 2:41 pm

Pandy wrote:What does your debug read in terms of collision count. I'm sure you can make the game without the need for collision checks. Try using the overlapping event and disable collisions for everything. The particles object is known to reduce fps count. Test test test in debug.

Honestly it's easier to read an event sheet from a capx file. You can pm the capx if you want, i have some free time atm :)


Edited the topic with the .capx


Thanks man!
B
12
S
6
G
3
Posts: 101
Reputation: 3,930

Post » Sat May 10, 2014 4:37 pm

Here you go.

I have completely removed the need for collisions in your game. I added events where you compare positions for the penguins and the block and Popsicle. Added comments so you can get an idea how i did it.

You seem to have a snow hitbox items which i don't know what it's used for. I left it as it is but it had collisions enabled and it will effect performance.

You can definitely improve more by yourself. Check the forums, tutorials, destroy objects that are not needed on screen, reduce the particle numbers in your particle object if you can it's a known performance downer

If you can add a blue outline to the score text, makes it easier to read :D

Get back with how much better fps you get :)
You do not have the required permissions to view the files attached to this post.
B
16
S
4
Posts: 138
Reputation: 1,454

Post » Sat May 10, 2014 4:52 pm

Thanks Pandy! I'll study the changes you did to the code.


Do you think that it is necessary to replace the every tick events with anything else?

I've been testing using like this

every second => add (block.bullet.speed*0.6)*dt

instead of the current every tick event, but it doesn't work. the idea was creating a equation that could make the proportional amount of checks but every 1 second instead of 60 times a second
B
12
S
6
G
3
Posts: 101
Reputation: 3,930

Post » Sat May 10, 2014 6:15 pm

Ha sorry but i'll need more time to understand how all those variables play together. You can keep trying new ways and testing. That's the best way to learn.

If the game works as it is i wouldn't really bother with trying to optimize the event sheets. The performance gains you'll get is really negligible compared to the gains you'll get from removing unnecessary events, objects, collisions etc.

If you are gonna use cocoonjs, export the project with version 1.4.7 rather than their 2.0.0 beta. Performance is definitely better in the older version.

If the game works as it should at 60 fps on mobile, publish it and then iron out your event sheet for future updates.
B
16
S
4
Posts: 138
Reputation: 1,454

Post » Sat May 10, 2014 11:13 pm

Hey, I liked your game. Simple but fun.
B
20
S
5
G
1
Posts: 102
Reputation: 1,706

Post » Sun May 11, 2014 11:19 pm

Pandy wrote:Ha sorry but i'll need more time to understand how all those variables play together. You can keep trying new ways and testing. That's the best way to learn.

If the game works as it is i wouldn't really bother with trying to optimize the event sheets. The performance gains you'll get is really negligible compared to the gains you'll get from removing unnecessary events, objects, collisions etc.

If you are gonna use cocoonjs, export the project with version 1.4.7 rather than their 2.0.0 beta. Performance is definitely better in the older version.

If the game works as it should at 60 fps on mobile, publish it and then iron out your event sheet for future updates.


Pandy, your solution gave a huge improvement to the frame rate. I couldn't get less than 30 fps and that is great!


But, there is something weird ocurring only on mobile. Sometimes the penguin just passes through the popsicles/ice blocks, without anything happening.


That is really weird, I spent the whole Sunday trying to figuring out what is happening, but no success until now :(


Enigmatico711 wrote:Hey, I liked your game. Simple but fun.


Thanks man, I have hope that I will be able to port it to mobile. But it's being really hard. I wonder how must be design bigger games with C2 for mobile. ;/
B
12
S
6
G
3
Posts: 101
Reputation: 3,930

Post » Mon May 12, 2014 2:57 am

I think i`ll give up. I`m really frustrated with this.
B
12
S
6
G
3
Posts: 101
Reputation: 3,930

Next

Return to How do I....?

Who is online

Users browsing this forum: ezgaming420, Yahoo [Bot] and 9 guests