Load X only after player has reached Y.

  • 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?

  • "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:

    scirra.com/forum/optimizing-a-game-for-mobile-platforms-your-tips_topic78778.html

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for the information, and for the correct definitions of the terms.

    Anybody else have something to add?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)