Suggestion: 'On Layout Load Complete'

Discussion and feedback on Construct 2

Post » Mon Jul 08, 2013 11:16 pm

Hey there,

Lately I've been working with some layouts that have a relatively large amount of graphics. Using webGL layout loading, each layout takes about a second or so to load up. It's rather jarring to have the game freeze up completely, so I've been trying to think of a way to have some sort of loading screen. I've ran into two problems which (I think) can't be solved in the current state of C2:

1. There's no way to tell when the layout's been loaded.

2. There's no way to have a loading screen, as the runtime just goes to 0fps when loading the next layout.

Am I missing something? Or is this something C2 could use?
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Mon Jul 08, 2013 11:18 pm

I think layout-by-layout loading should fix this
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Mon Jul 08, 2013 11:22 pm

@Whiteclaws what do you mean? Layout-by-layout already exists, in fact it's the cause of the problem...
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Tue Jul 09, 2013 12:28 am

'On start of layout' is 'On layout load complete'. Events can't run while it's busy loading, so such an event would be redundant, since the first thing that happens when it's ready is it triggers 'On start of layout'.

It might be possible to mitigate the problem with asynchronous texture loading, but WebGL doesn't support it yet AFAIK, plus it might be fairly difficult to work in to the engine (currently all existing projects assume no events fire during loading, so we'd have to be careful not to break anything).

There's the good old-fashioned workaround which people came up with in the Classic days: for one tick before changing layout, quickly bring up a loading screen. Then the previous layout is displaying "loading..." while the next layout loads up.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Tue Jul 09, 2013 1:29 am

[QUOTE=Ashley]There's the good old-fashioned workaround which people came up with in the Classic days: for one tick before changing layout, quickly bring up a loading screen. Then the previous layout is displaying "loading..." while the next layout loads up.[/QUOTE]
This is what I do, works great :)
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Tue Jul 09, 2013 1:41 am

Yeah, I suppose I can do that.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Mon Jan 06, 2014 8:44 pm

I was wondering is it possible to have an animation running while the next layout is being loaded, to get an animated "loading" sprite.

Also, I'm getting a noticeable delay, especially in cocoonjs, while changing menus within a layout, because the game needs to destroy the previous menu elements and create the submenu elements.
I tried creating the loading graphic the same way as I did with the pre-layout change loading, but it failed to create the sprite before the menu change.
B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Post » Tue Jan 07, 2014 1:38 am

Totally agree with @KFC about the animation. This is one of those things that doesn't seem too important but it really is.sqiddster2014-01-07 01:38:50
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Tue Jan 07, 2014 2:38 am

I would love to be able to set a loader screen for those times when the assets are large and the layout vastly different.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018

Post » Tue Jan 07, 2014 7:44 am

An easy way around this would be to have a loading screen layout that just consists of an image (still or animated), and an event On start of layout -> Go to layout (level x). Then, instead of jumping straight into your game level from the start screen or wherever, go to the loading screen layout.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Next

Return to Construct 2 General

Who is online

Users browsing this forum: lukewasthefish, Yahoo [Bot] and 5 guests