[Performance Question] Rendering on mobile

Discussion and feedback on Construct 2

Post » Tue Apr 15, 2014 2:53 pm

@Ashley Is difficult to implement culling objects as when the objects are offscreen, then get destroyed, otherwise when a player is on specificed position according to scroll, recreate objects with current instance variables?
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Tue Apr 15, 2014 3:03 pm

@Joannesalfa - no, the only problem is image memory, and all images for the layout are loaded at the start of the layout. We can't really load images half-way through a layout, because it will pause the game (e.g. for 500ms while the image is decompressed and sent to the GPU) making the game very jumpy.
Scirra Founder
B
399
S
236
G
89
Posts: 24,530
Reputation: 195,402

Post » Tue Apr 15, 2014 6:06 pm

So if we want to use big images, don't care about slight pauses, but care about memory usage (say, if we're making a hidden object game, point and click or RPG), we either use a separate layout or "load image from URL"?
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Tue Apr 15, 2014 6:57 pm

I would strongly recommend you simply do not use big images. As the blog post mentioned, professionally-designed games don't do that.
Scirra Founder
B
399
S
236
G
89
Posts: 24,530
Reputation: 195,402

Post » Tue Apr 15, 2014 7:20 pm

Ashley wrote:I would strongly recommend you simply do not use big images. As the blog post mentioned, professionally-designed games don't do that.


Is it possible to replace sprite image using ajax on mobile with the technology that we are using?

[email protected] Also, it's a bit off topic, but what's the average load of the images in the background on desktops? Cheers
Last edited by megatronx on Tue Apr 15, 2014 9:06 pm, edited 1 time in total.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
91
S
30
G
22
Posts: 1,985
Reputation: 20,149

Post » Tue Apr 15, 2014 8:54 pm

Ashley wrote:@Joannesalfa - no, the only problem is image memory, and all images for the layout are loaded at the start of the layout. We can't really load images half-way through a layout, because it will pause the game (e.g. for 500ms while the image is decompressed and sent to the GPU) making the game very jumpy.


@Ashley Pause the game for 500 ms is not big deal until if it breaks the game. In that case the AAA game is called Skyrim rarely pauses the game like max. 15 seconds.

I would consider to use composition to design levels, I hope it would decrease memory usage, I'm curious so what happens when memory usage is on limit?
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Wed Apr 16, 2014 4:01 am

Fimbul wrote:So if we want to use big images, don't care about slight pauses, but care about memory usage (say, if we're making a hidden object game, point and click or RPG), we either use a separate layout or "load image from URL"?


You can use big images, it just eats up your quota for memory much faster. Using individual smaller object sprites to form a scene is more useful in that you can re-use them in different forms and combinations to make varied scenery but at a smaller memory footprint.

As for the image sizes and breaking them up, you wont save much on memory breaking one large image into quadrants etc. But certain images if you do it smarter, you can save a lot of memory.

Let's say you want to drawl a line, it's 1200 pixels long and 20 pixels tall. You think because the sprite is small, it wont use much memory but its false. Into texture, such a sprite will occupy 2048 x 2048 texture memory or 16MB of ram. Why? Because its too wide (1200px) for the next texture down, 1024 x 1024 so it has to go into the next texture size up, by power of 2. These are optimizations you have to do when you work with mobiles. Never have an image like that, since its wasting so much ram.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Wed Apr 16, 2014 2:35 pm

But surely there are scenarios where a big image has to be used, and you cannot compose, right?
Visual novels, for instance, are full of huge backgrounds, and even the characters can be huge. I mean look at this thing:
Image
It's immediately obvious that the background cannot be "composed".
Surely as long as we only have one big background per scene, we're fine?

Keep in mind performance isn't all that critical in that sort of game, the developer would be much more concerned with battery drain, music smoothness and text drawing.

So my guess is that since construct 2 doesn't redraw when nothing on the screen has changed, the framerate would be kept high. The only problem is that people like to implement that "typewriter effect" on the text, so it might count as constant redrawing - @Ashley would c2 be smart enough to only redraw the bottom half of the screen?
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Wed Apr 16, 2014 2:42 pm

Fimbul
There is no problem witha game like that. honestly you can probably get away with 5FPS and the user probably won't notice. :D

Canvas and WebGL rendering doesn't work like that. You can't just draw on the bottom part of the screen and then hope to leave the top half. Techniques like that exists 20 years ago, but today rendering is just done whole screen. it's easier.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,038

Post » Wed Apr 16, 2014 2:44 pm

The problem is, if I'm getting 5fps in a mobile, that means the device is doing a ton of work.

True, the user probably doesn't care, but his battery will notice for sure. Especially since this is a visual novel, so it's supposed to be experienced in long stretches.

Also, just throwing this out there, if the most frequent bottleneck on mobiles is fill rate, why not limit the redrawing to only the parts that change? Yes it's impossible in some types of games, and yes you get a bigger hit on the CPU, but on the other hand the GPU will have less work to do.
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests