Load X only after player has reached Y.

Get help using Construct 2

Post » Fri Nov 01, 2013 5:36 am

I tried to search this topic but
I am not sure the exact terminology, so
if there is a better technical
phrase to use, please let me know.

Question:
Does the entire game need to be loaded/rendered/unzipped at the start?

Extreme example,
What if there are 500 levels to a game,
can it be 'coded' so only the first 5 levels
are loaded/rendered/unzipped and then only if and when a player
reaches the higher levels will a few more levels
be loaded/rendered?

So basically
can it be 'coded' to unzip only certain levels of the game and wait to unzip other levels until after the player is involved and engaged in your game?producermark112013-11-01 05:57:24
B
35
S
10
G
4
Posts: 250
Reputation: 7,938

Post » Fri Nov 01, 2013 9:42 am

"Does the entire game need to be loaded/rendered/unzipped at the start?"
This is a funny question, i'll give you that. Loading stuff into memory, rendering it and decompressing it is not the same thing, all of these processes are handled differently.

tl;dr - most of this is automatic, you don't have to do anything

>> Decompressing - well, first thing you get is loading the assets before the game starts, as far as i'm concerned, not everything is loaded in the memory instantly, but rather simply downloaded and saved (or perhaps merely checked for consistency/file presence in offline aps). Either way, this is automatical, therefore you can't really affect this process. It becomes longer with increased level/asset count, so you should watch out for this.

>> Loading into memory - the assets you use are loaded into the memory upon opening a layer, and they are cleared from memory once you switch a layer. This is true for most of the objects in your game, but i believe that sounds are loaded into memory only once they're needed for playback, so there might be a delay before a longer sound starts playing. If needed, you can preload sounds, though, so they play instantly upon request.

>> Rendering - this is done for each frame by the gpu (if present, otherwise rendering takes place through software, pretty slow) in either canvas2d or webgl mode. The difference between loading things into memory and rendering is that no object off-screen is rendered, therefore less time is consumed on this process - this allows for you to create large levels without impacting the performance too much, as long as there aren't too many off-screen calculations taking place (e.g. running physics for objects off-screen, even when not required) or just too many objects in general.

Of course, this is just what i've read, therefore the information could be outdated or inaccurate. Members of C2 - if you are reading this, CORRECT ME, OR CONFIRM WHAT I'VE SAID (don't just leave me in the dark on this)!!!

Shameless plug for my performance thread that got buried:
http://www.scirra.com/forum/optimizing-a-game-for-mobile-platforms-your-tips_topic78778.htmlStiivais2013-11-01 09:43:08
B
10
S
1
Posts: 163
Reputation: 1,436

Post » Fri Nov 01, 2013 10:11 am

Thanks for the information, and for the correct definitions of the terms.
Anybody else have something to add?producermark112013-11-01 10:11:38
B
35
S
10
G
4
Posts: 250
Reputation: 7,938


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests