How do I optimize loading time for project with many sprites

Get help using Construct 2

Post » Wed Jul 15, 2015 7:00 am

Hello
We have a matching game with around 30 matching pieces (each with its own shape and color and size ) X 12 boards = ~ 500 sprites
offline project loading time is expectedly slow on mobile . is there a way to optimize loading time with so many objects ? any other method that i could use ?

Thanks
Alon
B
8
S
2
Posts: 130
Reputation: 970

Post » Wed Jul 15, 2015 6:04 pm

It depends on the way the pieces are created. If they were already set in place before starting, they will be all loaded at once. What usually works for me on mobile is leaving the layout as empty as possible and then generating things as it goes. To do so, I create a (or many) default layouts in which the only event is "go to next layout" with a wait of 0.1 and all their content are the different entities (pe 1 layout with 10 pieces, next with 10 pieces etc) so when the "game" layout is loaded, all the entities can be created from events without any problem (again, it´s my method, there will be many others that will be better but this one works for me).

Hope this helps.
B
9
S
3
Posts: 150
Reputation: 1,264

Post » Wed Jul 15, 2015 6:40 pm

so you set an x and y for them on creation for the event sheet ? I thought that project load time is affected by the number of files in the project as a whole.

I do use 12 layout each with its own pieces
B
8
S
2
Posts: 130
Reputation: 970

Post » Thu Jul 16, 2015 9:08 am

I don´t really know what makes the issue, I´m just telling you what works for me on mobile. This might be close to what you are doing. I´m currently playing around with array procedural cave generation, testing how it behaves on mobile. As I said, I use a "spawn room" to load the assets in steps, so it does not collapse. (sorry for the placeholder art hehe)

Image

Then I create a grid of walls (very similar to pieces in a match game), which gets carved and set with enemies, items etc

Image

You could do the same with a simple line of code and a simple "spawner" sprite like
spawn "tile" on "spawner", move spawner right tile.width pixels. If spawner is in border move downwards tile.width pixels and move to the initial X position. Repeat grid.width*grid.height/tile.width times only every 0.1 seconds, so it does not collapse.

This way, you could leave the layout empty and let the code do the work slowly, so the device can take it.

Without a .capx this is all pure speculation, I don´t know in what situation your game is.

Hope this helps
B
9
S
3
Posts: 150
Reputation: 1,264

Post » Thu Jul 16, 2015 9:21 am

gotcha, thanks for the help!
B
8
S
2
Posts: 130
Reputation: 970


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests