Tried to debug and increase fps but have failed all day . .

Get help using Construct 2

Post » Mon Jan 11, 2016 6:55 am

you said" Is opening the image in Construct's image editor and scaling down the image work as well as in an outside program? They both will reduce the number of pixels, right? Or does Construct save the original image somewhere or something."

i think what u miss understand is the memory usage of image sizes... lowering the image size or the sprite in the visual editor or when u place it in the layout that u see or prebuilt is not going to change the actually image weight... so what u need to do is ... if u exported as png jpg or whatever use the auto cut space out from image editor c2 has ... it will automatically adjust the image transparent parts which are known to heavy the image memory... 2nd thing re-scale the image upon import in c2 in the animation editor where u place ur frames... not only in the layout part ... cause if u only re-scale in the layout that wont change the actual image weight ... which the engine still has to resize from the high quality frame u use ... hope u understand..... i have a bit of work to do il upload a schematic later if ur interested...


try this... make the sprite frames in the object animation editor.. as small as possible then see if the app runs faster... if it doesn't then its something else u might missing cant really say if i dont see ur capx
Image
B
65
S
19
G
67
Posts: 1,310
Reputation: 42,040

Post » Mon Jan 11, 2016 12:51 pm

I reduced the size in the animation editor, not just in the layout (I mistakenly referred to it as image editor above) and always reduce as much white space as possible
ImageImageImage
B
35
S
19
G
11
Posts: 460
Reputation: 9,449

Post » Mon Jan 11, 2016 1:25 pm

One thing i noticed in my game was that optimising the event sheet gave me a lot of FPS boost. Here are some of the things i did that had most impact.

* If you have a lot of events, place them in groups and enable/disable the groups only when needed. The less events running at the same time the better.
* Using functions and "once when true" can save some CPU, as well as using "every X second" instead of having events run every tick.
* Use Sprite fonts instead of regular text object. Can do a big difference if you have a lot of text.
* Use the condition "Is On Screen" when possible, so the Event's won't pick stuff that is not on screen. Very useful in many cases.

In general. Try narrow down the event object picking with conditions as much as you can, and structure the event sheet so that you can turn off and turn on groups of events when needed.
Follow my progress on Twitter
or in this thread Archer Devlog
B
29
S
13
G
15
Posts: 844
Reputation: 10,662

Post » Mon Jan 11, 2016 2:00 pm

tunepunk wrote:One thing i noticed in my game was that optimising the event sheet gave me a lot of FPS boost. Here are some of the things i did that had most impact.

* If you have a lot of events, place them in groups and enable/disable the groups only when needed. The less events running at the same time the better.
* Using functions and "once when true" can save some CPU, as well as using "every X second" instead of having events run every tick.
* Use Sprite fonts instead of regular text object. Can do a big difference if you have a lot of text.
* Use the condition "Is On Screen" when possible, so the Event's won't pick stuff that is not on screen. Very useful in many cases.

In general. Try narrow down the event object picking with conditions as much as you can, and structure the event sheet so that you can turn off and turn on groups of events when needed.


Based on Ashley's Optimisation: Don't waste your time where he states only 10% is logic I followed his logic/events tips on there, similar to some you just mentioned, and then focused on image size.

I think a lot of the cpu is because I am using physics but I will still test out things in other areas to see if it helps.

Thanks for the tips! I will try those out and keep in mind for future projects.
ImageImageImage
B
35
S
19
G
11
Posts: 460
Reputation: 9,449

Post » Mon Jan 11, 2016 3:24 pm

gamecorpstudio wrote:.. if it doesn't then its something else u might missing cant really say if i dont see ur capx


I don't mind sharing capx but don't have enough rep to post link or send PM so not sure how...
ImageImageImage
B
35
S
19
G
11
Posts: 460
Reputation: 9,449

Post » Mon Jan 11, 2016 3:35 pm

badmoodtaylor wrote:
gamecorpstudio wrote:.. if it doesn't then its something else u might missing cant really say if i dont see ur capx


I don't mind sharing capx but don't have enough rep to post link or send PM so not sure how...


Export as a single file .capx and host it on one of the free hosting sites provided by the likes of Google, Microsoft, Dropbox etc.

Place the 'publicly accessible' link here. To bypass posting restrictions, just add an unusual character in the URL, i.e..

Code: Select all
htt*p://*www.mysite.com/mygame.capx
If your vision so exceeds your ability, then look to something closer.
Moderator
B
126
S
29
G
73
Posts: 5,098
Reputation: 52,016

Post » Tue Jan 12, 2016 1:02 am

zenox98 wrote:
badmoodtaylor wrote:
gamecorpstudio wrote:.. if it doesn't then its something else u might missing cant really say if i dont see ur capx


I don't mind sharing capx but don't have enough rep to post link or send PM so not sure how...


Export as a single file .capx and host it on one of the free hosting sites provided by the likes of Google, Microsoft, Dropbox etc.

Place the 'publicly accessible' link here. To bypass posting restrictions, just add an unusual character in the URL, i.e..

Code: Select all
htt*p://*www.mysite.com/mygame.capx


Didn't want to get in trouble for bypassing their posting restrictions :? . . . but since I can blame it on someone else now here's the capx:

***https://www****.dropbox.***com/s/ukmxt5t93pj9j8o/Dempsey2SingleFile.capx?dl=0***

Maybe this is as good as it gets for projects containing physics elements - but if so then I will stay away with any physics behaviors when targeting mobiles.

@gamecorpstudio - if you want to take a look and let me know if you still think images are the problem or you see something else.

Anyone else that wants to take a look feel free.

Like I said before, my goal is to learn from this - so even if you see a problem that is only small please let me know so I don't repeat it on a larger scale in larger projects.

Thanks all!
ImageImageImage
B
35
S
19
G
11
Posts: 460
Reputation: 9,449

Post » Tue Jan 12, 2016 9:16 am

badmoodtaylor wrote:..........- if you want to take a look and let me know if you still think images are the problem or you see something else.


i did take a look inside... and i was pretty amazed by the fact the event sheet is pretty clean all events trigger once when is needed however .... i have tested it on a duo core older rig i have... and fps showed me 47-57 most of time didn't drop under 50 and cpu utilization was somewhere under 0.05%... but then when i started the debug mode...i barely hit 30 fps ... even if it wasn't necessary had no reason for it ... and cpu utilization blown to 50-70% ... thats something i never seen before doing in debug mode ... for sure is not ur event sheet but i guess something is up with the debug viewer...


u can lower the approx . download weight of the game by loading the sounds from a ftp server or preloading it (for preloading sounds all music or sounds have to be uploaded in the sounds folder) i prefer having smaller music loops to prevent audio breakage on intelxdk building or other mobile wrappers.


kinda thats it.. u had it all good from beginning the memory use being at 6.6mb its something i cant really say how u can lower it ... but again from my point of view for small games which c2 is meant to be used for... u had the optimization if i may say ... pretty darn right :P

keep it going for sure ul encounter other problems. but as for a optimization test u did good. just keep in mind when u build ur games ... the key for success is always optimization :D that 1% that u have to push defines the unexpected results ... have a great day hope it helped u ..
Image
B
65
S
19
G
67
Posts: 1,310
Reputation: 42,040

Post » Tue Jan 12, 2016 12:42 pm

gamecorpstudio wrote:i did take a look inside... ... have a great day hope it helped u ..


Thank you so much for taking a look at it and all the comments. I really do appreciate it. That's weird such a difference in debug mode - maybe difficult to track and report all the physics and physic joints.

Now I guess I can move on without feeling like I was missing something huge and gave up.

There are two image files that are HUGE after export even though I tried to resize. I may try resizing in GIMP and reloading completely because one is getting pixelated already but file size isn't small - feels glitchy.
ImageImageImage
B
35
S
19
G
11
Posts: 460
Reputation: 9,449

Previous

Return to How do I....?

Who is online

Users browsing this forum: mercuryus, Moordhuis, RetroSpock, TRMG and 9 guests