Not loading entire game in one go possible?

Discussion and feedback on Construct 2

Post » Mon Apr 07, 2014 5:42 am

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?
B
8
S
2
Posts: 163
Reputation: 1,115

Post » Mon Apr 07, 2014 7:45 am

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.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Mon Apr 07, 2014 10:09 am

Same question here. @DUTOIT I think Ldk was reffering to normal gameplay, not testing or previewing in debugger.
B
40
S
14
G
6
Posts: 152
Reputation: 5,517

Post » Mon Apr 07, 2014 12:12 pm

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.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Apr 07, 2014 12:26 pm

@rozpustelnik
Oh, so you want to load objects (images on a per level basis?)
Use external image files
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.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Mon Apr 07, 2014 12:39 pm

@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...
B
40
S
14
G
6
Posts: 152
Reputation: 5,517

Post » Mon Apr 07, 2014 1:30 pm

@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.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Mon Apr 07, 2014 1:41 pm

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

Cheers
B
8
S
2
Posts: 163
Reputation: 1,115

Post » Mon Apr 07, 2014 2:17 pm

@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.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Mon Apr 07, 2014 2:41 pm

@jayderyu Thanks. Hopefuly things will sort out sooner than I finish my game...
B
40
S
14
G
6
Posts: 152
Reputation: 5,517

Next

Return to Construct 2 General

Who is online

Users browsing this forum: kazdalugur and 12 guests