Not loading entire game in one go possible?

0 favourites
  • 15 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Hi.

    I am curious if it is possible not to load the entire game in one go?

    As i understand HTML5 loads every single object in one go. Meaning that if 50 objects are used on level one, another 50 on level 2 and another 50 on level 3 it just loads all 3 levels into memory with all 150 objects.

    But as we all know sometimes you dont want to clog the memory with 150 objects, but instead just load the 50 you will be using on that level.

    So the question is if it is possible at all to trick the system into only loading level per level as opposed to the entire game.

    Or am i misunderstanding how HTML5 loads objects?

  • Click where you want to put break. Right click and hit toggle breakpoint. Now run in debug mode. and it will run up till that point.

  • Same question here. DUTOIT I think Ldk was reffering to normal gameplay, not testing or previewing in debugger.

  • As far as I know, When the webGL renderer is used (and the browser supports memory management), it does it automatically for you.

    In cases the memory management isn't supproted well, or in cases the WebGL isn't supported, this feature won't work, and everything will be loaded into memory.

    However the game is in both cases totally downloaded (except for sounds file)

    PS:What I say could be somewhat incorrect, as it is based on my personnal interpretation of it.

  • rozpustelnik

    Oh, so you want to load objects (images on a per level basis?)

    Use external image files

    [quote:7wz3xlup]If your project has a lot of large detailed images which add a lot to the download size, you can make your game load quicker by adding them as project files instead. That way they won't need to be downloaded before the game starts running. You can then load them at runtime using Sprite or Tiled Background's Load image from URL actions - just enter the name of the image as the URL, e.g. "mylargeimage.jpg". You know they've loaded when the On image URL loaded trigger fires as well. This means you can request large images on the start of each layout that needs them, and show some kind of "Please wait..." message until they've loaded.

    The last part is important. Create a fake or real loading screen while images download for that level.

  • DUTOIT Thanks. I was wondering about applications installed locally on drive (I don't care about the desktops, but mobiles). I plan to port my game on tablets in the future, and my game will be gfx heavy, so it would be nice to load images level by level...

  • Ldk

    You entire browser game is downloaded at the start. But once its downloaded, it will already load layout by layout. It will not load all your assets into ram/vram.

    Only CocoonJS does that because it has no memory management. Chrome and Intel XDK does per layout loading of assets.

    You can easily verify this with a memory tool or widgets.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • DUTOIT

    Cool thank you for the feedback. Cleared up all my concerns.

    Cheers

  • rozpustelnik

    If the platform allows assets are loaded and released on a layout by lay out basis.

    CocoonJS and Ejecta do not support the advanced memory management of JS. However full browsers do, so Crosswalk is a go.

    Ejecta may support better memory management in the future as Ashley has plans to look into this.

  • jayderyu Thanks. Hopefuly things will sort out sooner than I finish my game...

  • jayderyu

    [quote:u6jmhewm]CocoonJS and Ejecta do not support the advanced memory management of JS. However full browsers do, so Crosswalk is a go.

    I was actually seeing the same loading delay with our app between CJS and Crosswalk, so I assumed Crosswalk wasn't actually handling layout by layout memory management. Is it working for you? Right now it's the only thing holding me back from releasing an Android version of our app. Thanks!

  • jayderyu

    [quote:358b8ey6]CocoonJS and Ejecta do not support the advanced memory management of JS. However full browsers do, so Crosswalk is a go.

    I was actually seeing the same loading delay with our app between CJS and Crosswalk, so I assumed Crosswalk wasn't actually handling layout by layout memory management. Is it working for you? Right now it's the only thing holding me back from releasing an Android version of our app. Thanks!

    I can suggest you to set a (text or spritefont) to the system value renderer, if the result is canvas2d, that would explain It.

    (WebGL gives 3 things in C2 games: Faster rendering speed, Effects, and Layout by Layout if Memory management is supported, if your app falls back to canvas2d, then that is the cause I think)

    PS: I suggest that since I've seen complains about effects not working too in crosswalks

  • Thank you for the suggestion Aphrodite. This unfortunately happens before it even gets to our loader layout so my assumption is it's the wrapper. I'll try though! Thanks.

  • Just to follow up on this, I verified it's using the WebGL renderer. I tried moving assets around to different layouts, and even created a brand new one just for them. I'm not sure what the issue is or how to collect information that can be helpful. Guess I'll just stay tuned as Crosswalk is updated. Also, I tried the new Crosswalk 5 beta build and that one won't get past the loader layout. I'm sure that's just a simple bug that will get worked out soon enough. Wish I understood what the 10ish second black screen was about though!

  • Does loading image files works in node-webkit? ( WIll it remove the old image from memory too? )

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