How do I figure out whats causing lag?

Get help using Construct 2

Post » Tue Feb 10, 2015 7:44 pm

Hello all!

I have spent 2 roughly years working on my project and i have noticed just recently (now that im almost finished :cry: ) that it is now starting to stutter lag here and there within the game, and then it would fade out. whats even more baffling is that if i reboot the game the problem doesn't seem to occur anymore.

at the moment i have 60 layouts with over 9300 events and 100's of objects of course.

each layout has roughly 100 to at most 300 objects

and i highly doubt its my PC its on a higher end. and everytime i try debugging the problem never occurs, only in standard preview and on node webkit.

any thoughts and suggestions would be so appreciated right now!!!
B
5
S
1
Posts: 88
Reputation: 653

Post » Tue Feb 10, 2015 7:51 pm

That's was a lot of events and layouts, which ofc doesn't make it easier :D

But some obvious things to check. Is number of collisions, amount of objects being created running wild due to a bug. A bit harder to track is unnecessary updating of objects.

Think that's the best I can come up with, Its not easy to help debug such a big game :D
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Tue Feb 10, 2015 10:39 pm

Also check for redundancy, if things are getting run every tick that doesn't have to. I think Next Penelope is the same or beyond that in objects and stuff going on and runs smoothly. First before cutting back objects. Check to make sure there are things that could be condensed. When viewing some people event sheets I see them do things multiple times that could of been done in one run through.
B
23
S
4
G
2
Posts: 364
Reputation: 2,392

Post » Wed Feb 11, 2015 7:24 am

Thanks guys for the help, i'll give those a shot and hope for the best! =]
B
5
S
1
Posts: 88
Reputation: 653

Post » Wed Feb 11, 2015 8:08 am

@AngelRave also test in other browser the latest versions of Chrome/NodeWebkit you have a bug the causes lag/stutter/jittering it you search the forums (chrome issues) you can find threads about it
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Wed Feb 11, 2015 8:43 am

AngelRave wrote:Hello all!

I have spent 2 roughly years working on my project and i have noticed just recently (now that im almost finished :cry: ) that it is now starting to stutter lag here and there within the game, and then it would fade out. whats even more baffling is that if i reboot the game the problem doesn't seem to occur anymore.

at the moment i have 60 layouts with over 9300 events and 100's of objects of course.

each layout has roughly 100 to at most 300 objects

and i highly doubt its my PC its on a higher end. and everytime i try debugging the problem never occurs, only in standard preview and on node webkit.

any thoughts and suggestions would be so appreciated right now!!!



well one potential problem that can cause lagging or fps draining, is your cache that got to big , u may have a save condition that those automatically save everything in the scene so as many actors info etc u have in that scene the bigger the cache will be and the slower ur pc /browser will perform, if ur fps rate is to low under 40 i bet it is or around 40 , in order to increase it, try not using everytick on text objects, that will dramatically reduce ur fps if u have everytick text objects updates , like score, life , points , etc, maybe u want to move them to update when a mob is killed or something else happens.

another good way of increasing ur fps ..(dont use webgl effects) try keep ur game as much 'native" as possible, and at 100+objects on screen shouldnt bee so much dramatical fps drop , maybe u have some saving , tick event u miss out, if ur pc still lags after u close ur browser is that ur cache in ur computer maybe full try erase ur temp folder , prefetch, and the temp from c:/users/urusername/appdata/and check all folders there for temp <--- this is where all ur info cache files are saved and over saved and i think ur hdd might be having a huge temp file since u working on that thing for 2 years i bet thats ur issue


and since u have alot of actors and enemys with animations try compresing ur png files, jpeg files as much as possible, bigger sized file reduced in file is first loaded in original size so if u have a 1000x1000 background but u need to cover only 860x640 then id create it exactly at that size, if ur png files are big then the loading time will be big and performance and fps rate will drop alot, made a game a long time back , and as simple and dumb can sound the compresion png , and the everytick text object usage , turns out that they actually matter ... alot... i did a debug mode run and did exactly those steps on a huge game im talking about rpg type, and from 36 fps rate i had went up at almost 56-60 u having the last part of project to cover up thats called "optimization" so do that and try again :) if its not this problems then i dont have no ideea maybe recheck ur codes something that keeps ur engine running to much or builds to much stuff in background, also try updating ur graphic drivers/.flash /shockwave/java/ and do a pc defragmentation :) and a possible pc virus scan


P.s if ur using custom plugins, that are in progress and not completed and u added them in a old version of construct and then u updated construct 2 u might have a issue on that part also, try reinstall c2 clean out and also the plugins check for their last version, hope it helped you
B
75
S
22
G
68
Posts: 1,336
Reputation: 43,269

Post » Fri Feb 20, 2015 7:11 am

I found out what was the problem!
as it turned out i had a
EveryTick Set listener object. once that was removed the lag was completely gone! thanks everyone for the tips and help!
B
5
S
1
Posts: 88
Reputation: 653


Return to How do I....?

Who is online

Users browsing this forum: namaewayukidesu, Yahoo [Bot] and 7 guests