How do I load all assets once at start of game?

Get help using Construct 2

Post » Mon Jan 23, 2017 10:49 am

Here: viewtopic.php?t=186575
Ashley wrote: Sometimes loading a lot of content takes a while!


My game have 8 languages and big problems with speed of loading them on IOS.
I'm sure it is impossible to make, but still a chance I'm wrong:
сan I load all webfonts into all text objects of all layouts once during the launch of the application or after language changing? Avoiding repetition loading.
Same with sprites.
B
16
S
6
G
1
Posts: 109
Reputation: 1,952

Post » Mon Jan 23, 2017 6:46 pm

Can't you lazy load (just load them at the point you first need them) rather than trying to read everything on startup? For example loading 8 languages is especially wasteful if the user is only going to use 1!
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Mon Jan 23, 2017 6:48 pm

Why not make each language have its own layout, then have the player choose the language they want at the beginning of the game.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Mon Jan 23, 2017 8:24 pm

@Burvey thats still clunky. All string data for all languages should ideally be stored in data files. Then use lookup ids in your code. Swapping a language is as easy as changing a value that points to a language block of data or loading in the required data file.
Image
B
29
S
9
G
3
Posts: 170
Reputation: 3,297

Post » Mon Jan 23, 2017 8:46 pm

@gameglaux you are correct, and the only reason I mentioned it is because apparently they have language specific sprites as well, not just text.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Mon Jan 23, 2017 8:53 pm

@Burvey ah yes. I stand corrected. Localised images... a whole world of hurt - especially if their are lots of them :)
Image
B
29
S
9
G
3
Posts: 170
Reputation: 3,297

Post » Tue Jan 24, 2017 1:05 pm

Ashley wrote:Can't you lazy load (just load them at the point you first need them) rather than trying to read everything on startup?

I explained that it occurs very slowly. The file with the text "new game" or "continue" is loaded throught AJAX so slow that it is visible.

Ashley wrote:For example loading 8 languages is especially wasteful if the user is only going to use 1!

Of course I do not use all 8 languages simultaneously. At one moment one language is active.
But while loading each layout each time in each text object need to load webfonts. Regardless of the language was changed or not. I am about it.
B
16
S
6
G
1
Posts: 109
Reputation: 1,952

Post » Tue Jan 24, 2017 1:08 pm

Burvey wrote:Why not make each language have its own layout, then have the player choose the language they want at the beginning of the game.

I thought about it, but then I will need to manage the 7x8 layouts
B
16
S
6
G
1
Posts: 109
Reputation: 1,952


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, ketramtu18, XMatrix, Yahoo [Bot] and 9 guests