How do I avoid this problem: my game gets slower and slower

Get help using Construct 2

Post » Sun Jan 18, 2015 10:40 am

I uploaded my files to a free webhosting to test it. At the computer (PC) runs normal but online, it starts to get slower as the person plays, reaching the point where everything is so slow that the player can't barely move.
Yes I used the "destroy outside layout" for every item that can go outside the layout, and still it gets slower.
I also pasted outside the layout the items that I want to appear, like the buttons when the platform is mobile. I pasted those outside the window.
I've followed other advices, trying to reduce transparencies and else. Not sure what else could be causing this. Maybe it has something to do with the timer?
should I remove it, or maybe set times as delta time? not sure how or if that would help.
I'd appreciate any help.
B
3
Posts: 10
Reputation: 197

Post » Sun Jan 18, 2015 10:55 am

What does the browser console say?

Have you ran your program in debug? Is there a cascade on number of objects being created?

Many reasons this could happen, but without providing a .capx or a link to the exported project, it will be difficult to offer meaningful help.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,489
Reputation: 59,764

Post » Sun Jan 18, 2015 1:48 pm

Run in debug. See what's bloating.

It might be good for all of us if you find out.
B
5
S
2
Posts: 3
Reputation: 781

Post » Sun Jan 18, 2015 1:57 pm

infinite loop?
"If you want to move a mountain tomorrow, you should start by lifting stones today."
B
64
S
14
G
2
Posts: 292
Reputation: 6,678

Post » Sun Jan 18, 2015 4:48 pm

Every tick and loops can "eat" performance.
Image
B
16
S
7
Posts: 126
Reputation: 1,920

Post » Mon Jan 19, 2015 9:21 am

Message: jabk is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
thank you very much for the tips, I will check them out. My game is at it's just the first 3 levels but the first one runs fine in the PC, but very slow in the web. Will try to check what you suggest. Thanks a lot for your advices.
B
3
Posts: 10
Reputation: 197

Post » Mon Jan 19, 2015 10:19 am

it says I can't post the link :(
but I solved the problem! thanks to your advices, the debug showed me that it was creating the buttons hundreds/thousands times because I specified:

system -- is on mobile device (event) -- system: create object leftbutton on layer HUD at (600,414)
system -- X is no mobile device --- destroy

so with these lines it was creating, and creating, and creating and creating the same button and when I checked the debug window it was showing 1, 50, 400, 1000 items for the same button. How can I publish the link here so you can see how the game is running so fine now? :)
B
3
Posts: 10
Reputation: 197

Post » Mon Jan 19, 2015 10:44 am

To publish a link, just put a space or 2 between the url parts, or possible use the 'code' tag.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,489
Reputation: 59,764

Post » Tue Jan 20, 2015 6:25 am

Thanks zenox98 my link is www dot digram dot net / juego
B
3
Posts: 10
Reputation: 197

Post » Tue Jan 20, 2015 6:26 am

I'm making a platform game, mario bros style. I'd be glad if you decide to play with it, it's just the first 3 levels (I have worked hard on it since I'm making the design and all, and fixing all problems that arise) but so far it's working as it should.
B
3
Posts: 10
Reputation: 197

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 26 guests