window size and optimization

Discussion and feedback on Construct 2

Post » Fri Feb 07, 2014 5:24 pm

@Ronval - This is my understanding of it, there could be misinformation.

If you use the low quality scaling, it will decrease GPU load and increase overall performance to a comparable level to if you were using all the assets at that lower resolution, even if the assets have extra pixel information in the editor layout. But you will still have the RAM commitments for the original size of those assets.

For example, if your layout is 320x480, you can still have assets in your game that are 512x512, bigger than the layout itself. These assets with higher resolutions see use when using the hi quality full screen scaling, but use the same RAM regardless of render mode.

When you use hi quality scaling, it takes your 320x480 layout and scales it up to fit and render at a resolution of the device. So if you are running it on an iPad it will render at 768x1024 and on a 3GS it still renders at 320x480 because that's the native screen size. So while 512x512 is overkill for an asset on 320x480, that extra pixel information is used when scaled to fullscreen in hi quality.

Since the aspect ratio of the game is the same scaling from 320x480 to 768x1024, what IS changing along with the resolution is the ppi (pixels per inch) or how close together the pixels are. Retina displays have very high DPI displays, meaning that even though the iPhone 5S isn't much larger of a phone than the iPhone 3GS(163ppi), it has a much higher resolution (1136 x 640 pixel (326ppi), higher than the iPad2 (132ppi)!) so a game rendered at 320x480 will look great on 3GS, and pixelated on the iPhone 5S. That said, the 3GS looks more pixelated overall than the iPhone 5S due to lower ppi, because the pixels are larger.

However including higher resolution assets comes at the cost of RAM; each 256x256 square of pixels you have uses 0.25MB of RAM when loaded in the game. Meaning a 512x512 square uses 1MB by itself! This is what vtrix means when you should do both to save texture space, to modify the resolution of the original assets in the game to more closely match the intended resolution (ONLY IF USING LO QUALITY AND NOT GOING BACK) so you could potentially achieve the same effect with a 64x64 px sprite on lo quality as a 512x512 px sprite.

If you run lo quality, your game always renders at 320x480 resolution and then scales those pixels existing at the 320x480 resolution to fit the device's resolution of 768x1024. So you aren't filling each pixel with it's own unique color information, you are kind of stretching one pixel's color into like 9 pixels of information, causing it to look artifacted and pixelated.



I kind of got off a few tangents here, so if anything is unclear let me know and I'll try to explain further.Sigmag2014-02-07 22:30:12
ImageImageImage
B
16
S
3
Posts: 45
Reputation: 2,188

Post » Fri Feb 07, 2014 6:16 pm

I will do some tests then see how much the FPS drops using high quality vs low quality. I want the game to run well but I also want it to look nice. Me and my business partner spent a good amount of time on the art so it would be nice if it looked decent. @sigmag Thank you so much for the explanation. Its people like you that make this community awesome. @ashley Thanks a lot as well for your input really appreciate it. Maybe you can add this info to the optimization tutorial that you wrote. I never found any posts with this info when using the search and can be very useful to others who want to squeeze some more performance out of their game just a suggestion :)
B
8
S
2
G
1
Posts: 64
Reputation: 1,340

Post » Fri Feb 07, 2014 6:35 pm

Don't confuse draw calls with GPU work. "Draw calls" as is meant by the profiler means the CPU overhead of telling the GPU what to do. Even in low-quality fullscreen mode there are probably identical draw calls, because all that's changed is the size it's rendered at, not the number of things to render. The smaller render surface in low-quality mode decreases the GPU work necessary to complete the draw calls issued by the CPU, because there are fewer pixels. So it only improves performance if the game is GPU-bottlenecked.Ashley2014-02-07 18:36:27
Scirra Founder
B
402
S
238
G
89
Posts: 24,644
Reputation: 196,095

Post » Fri Feb 07, 2014 10:41 pm

Can you guys explain why there is also a boost in FPS when going from scale outer to letter box scale? I have been making the levels at the new resolution and there was an increase of 6fps. Initially it was at 9 with the new resolution it climbed to 15fps. By changing full screen browser from scale outer to letter box scale it doubled and is steady between 28-30 FPS. Why is there such a big difference? by the way im testing it on an iphone 4 and an ipad 1st generation.
B
8
S
2
G
1
Posts: 64
Reputation: 1,340

Post » Fri Feb 07, 2014 10:51 pm

@ronval - Glad I could help! I recommend reading these 3 links by Ashley for further information, they can save you a good deal of frustration down the road.

Supporting multiple screen sizes
Remember not to waste your memory
Performance Tips

And one possible explanation without knowing any further information about your game, is that scale outer can and will render your game beyond the layout size whereas letterbox renders your game at layout size. So maybe extra GPU/CPU work relating to that?


@Ashley - Good to know! Thanks for the clarification.
ImageImageImage
B
16
S
3
Posts: 45
Reputation: 2,188

Post » Fri Feb 07, 2014 10:59 pm

ya I went through those long time ago thanks :)I just wanted to understand how the system works out of curiosity
B
8
S
2
G
1
Posts: 64
Reputation: 1,340

Post » Mon Mar 03, 2014 5:23 pm

All I know is when testing my application on a Mac the game runs at 30fps when full screen, but at 60fps when I have a smaller window!

I don't understand this! Surely there must be a way to get it to run at 60fps at full screen!
B
8
S
1
Posts: 16
Reputation: 1,188

Post » Mon Mar 03, 2014 7:34 pm

@HenerzH - don't post the same question in multiple threads. Also, please have more patience, getting a response often isn't immediate. Wait at least a few hours.
Moderator
B
95
S
34
G
33
Posts: 3,007
Reputation: 27,876

Post » Mon Mar 03, 2014 8:11 pm

Wow thanks for the help, I'm desperately trying to find an answer.
B
8
S
1
Posts: 16
Reputation: 1,188

Post » Mon Mar 03, 2014 8:14 pm

I didn't know if some threads weren't being used anymore. This is so frustrating because in the manual it clearly says Window Size makes no difference to performance, but it evidently does. If I had used a small window size from the beginning the game would have run fine on the MAC.
I don't know why it works like this, it shouldn't increase the resolution to have it full screen. If you have a small window full screen, the resolution still looks just as good but it runs the game much better, even though the actual game objects are the same resolution in both situations!
B
8
S
1
Posts: 16
Reputation: 1,188

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests