Why my game is lagging ??

Get help using Construct 2

Post » Thu May 29, 2014 1:45 pm

I have created a small game where user have to park a car over a parking spot. I have used same layout for levels and used to create objects using events depending on level number. But after I play few levels (like 4-5), my game starts lagging. If I still go on playing, it lags by almost double. Where can be the problem ?
B
6
S
2
G
1
Posts: 77
Reputation: 708

Post » Thu May 29, 2014 2:00 pm

Without seeing it, who can say?

My suggestion would be to run it in Debug mode and check the number of objects being created, memory used, cpu used etc. It may give you a clue as to what is causing the slowdown.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,413
Reputation: 59,510

Post » Thu May 29, 2014 9:46 pm

hi,
try tips on performance tutorial ... and the best is to take look to your event sheet script
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Post » Fri May 30, 2014 9:46 am

Thanks guys... The thing I noticed that the lag is coming only on browser but not mobile browser.. Any guesses here??
I have made 2-3 games before this, but didn't faced this issue (they were very small games though).

@zenox98: Thanx.. So stupid I am, this slipped out of my mind completely, even though it was right in front of me.. thanx for reminding me of that.

@matrixreal: I have read that I am following it closely, Not even once I am using Every Tick event and so on.. Thanx for the comment..


Well, completely off-topic question here.. I am currently using Scale inner for scaling issue, But I just read somewhere that there is a tag called viewpoint in html5 which scale the game screen to mobile screen size, and hence no need of scale inner scaling. But it is not working in my project. Am I missing something ??
B
6
S
2
G
1
Posts: 77
Reputation: 708

Post » Fri May 30, 2014 11:21 am

yes the problem is when you use a lot of every tick

if you use set x to self.x or moving or set angle dont forget to add *60*dt it will help you a lot

and for scale ad view point , i wonder if you explain or give and exemple !!!
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Post » Fri May 30, 2014 11:51 am

Message: Raganork can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
@matrixreal: Thanx for the tip. I will keep that in mind.

About next point, my mistake, it is 'viewport' tag, and not 'viewpoint'..
I was searching the web for my issue and i found this tag. I posted the link below. It will help you understand better than I can.

https://developer.mozilla.org/en/docs/M ... t_meta_tag

EDIT: well, looks like I can't post link. If you could just search 'html5 viewport tag' in google, you will get more info. Above link is the first link from the search.
B
6
S
2
G
1
Posts: 77
Reputation: 708

Post » Fri May 30, 2014 3:35 pm

Raganork wrote:@matrixreal: Thanx for the tip. I will keep that in mind.

About next point, my mistake, it is 'viewport' tag, and not 'viewpoint'..
I was searching the web for my issue and i found this tag. I posted the link below. It will help you understand better than I can.

https://developer.mozilla.org/en/docs/M ... t_meta_tag

EDIT: well, looks like I can't post link. If you could just search 'html5 viewport tag' in google, you will get more info. Above link is the first link from the search.


if you use level system
i suggest to you to use different layout because on every start of new layout that will refresh memory and cpu usage
;)
B
46
S
16
G
8
Posts: 794
Reputation: 8,335


Return to How do I....?

Who is online

Users browsing this forum: bclikesyou, kellehk, ST314 and 25 guests