FPS falling badly Match 3 block-based puzzle

Discussion and feedback on Construct 2

Post » Tue Dec 31, 2013 12:07 am

Hi guys.. I need help as i am new to Construct 2. I downloaded the Match-3 game tutorial from:

http://gamedevelopment.tutsplus.com/series/make-a-match-3-game-in-construct-2--gamedev-12721

I opened the project in Construct 2 r155 and started it with chrome in debug mode and I found out that the tutorial is very well explaind but the framerate is falling badly as the Blocks are created on canvas.

I would be good to know whats going wrong and how to fix this.

While i am not using dropbox and either don't know how to upload here is the link to the capx direct.

http://gamedevelopment.tutsplus.com/tutorials/make-a-match-3-game-in-construct-2-chaining-and-game-overs--gamedev-9571
B
4
S
1
Posts: 12
Reputation: 401

Post » Tue Dec 31, 2013 3:31 am

My suggestion. When I was working on RexRainbow's base for another person. I found that for every match the system would generate 2000 blocks. I suggest turning on the debug and watching for the sprite count.

If that is the problem search where the sprite generation is and then check the conditions.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Tue Dec 31, 2013 11:33 am

@jayderyu thanks for the quick response but if i were that good i would have not posted it in forum. I have created groups to check in debug profiler and the problem is where sprites are generated "Create Blocks" on runtime.

As a learner i don't know how to fix this. Amazing part is that there are not many sprits generated. I made a test where i created more then 2000 sprits on canvas at runtime with animations etc. and the framrate was 40 to 50.
B
4
S
1
Posts: 12
Reputation: 401

Post » Tue Dec 31, 2013 5:39 pm

Match3-FindActiveFix.capx

The problem is that he's calling FindMatches() (almost) every tick, even if nothing has changed from the last time the call was made. FindMatches() is a very expensive operation, so you only want to call it when something changes.

I've added a FindActive flag to minimize the number of FindMatches() called. Do a search for FindActive, to see what was changed.

I've added a FPS display to show that it stays mostly at 60fps.
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Tue Dec 31, 2013 7:33 pm

@blackhornet you are genius. Thank you very much for the quick help.
B
4
S
1
Posts: 12
Reputation: 401

Post » Wed Jan 08, 2014 11:01 am

There is a bug - if you drag blocks faster some of them just stuck
B
109
S
6
G
6
Posts: 14
Reputation: 7,332


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests