How do I preload a layout?

0 favourites
  • 7 posts
  • Hello guys, how are you?

    Do anyone knows a way to preload the layout or any other way I can reduce the transition time between the layouts? I tested a bunch of stuff and I can't figure out a proper way to do it .-.

    Lately I'm working on a quite dynamic game that have the same idea of the "Wario Ware" series or dumb ways to die series.

    For those who don't know this games the idea is quite simple. I've made a bunch of mini games (24 last time a checked) and each mini game have up to 3 levels of difficulty and a short period of time to be completed. Every time a mini game ends a new mini game is randomly chosen from the other 23 and then given to the player. If the player manages to complete the mini game in time, he scores and therefore the difficulty and the game speeds up so the player have less time to complete each task. If the player don't manage to beat the mini game... well he loses the game. So the whole objective is to see how many mini games you can beat before losing.

    So.. lets go to the problem itself. Since the whole point of the game is to it to get faster I decided to build all mini games on the same layout... Bad idea, in the end the layout needed more than 500mb to run and I couldn't find a mobile that could handle that, so the game crashed 100% of the devices tested.

    So i decided to put each mini game in a separated layout. Each layout now needs around 30mb only to run and the game now works even in my phone that is quite old. However it takes a few moments to do this transition between one layout and the other, and in a game where the whole point it to get faster, this few transition seconds are ruining the whole game.

    Did anyone ever anything like this?

    Thank you all for you attention ?

  • If the objects are already in the layout then they should be preloaded fine and the transition should be really fast, especially with only 30mb. Are you creating the objects in run time for the mini game? There could be lag if you are transitioning to a blank layout and creating 30mb during the actual run time. A good practice is to put everything you need for the layout in the layout view then destroy what you don't need at the start of any layout.

  • They are already in the layout. Yes

  • In my opinion 500mb is to much for a series of mini games,

    30mb of a single layout should take some time to load,

    hard to imagine mini game that weights 30mb.

    I think it is a time for optimization:

    If the weight coming from images - try using more small repetitive components rather than big ones, RE-USE, tile maps, compress images, use 9-patches instead of images, see if you have images with to many transparency, delete what you don't need, combine images that always one a top of another to a single image...

    Music/sound - compress, combine, cut...

    Code? - not likely - Use functions, re-use event-sheets...

    The eye can't catch 30mb of information in few seconds, in that short period of time the brain could tell the difference between 5mb and 30mb. And it is realy possible to make a 5mb layout full of features.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Actually the game is not yet completed. I have no sound, music or backgrounds what so ever. Only the basic animations for each mini game. In any way 5mb is a completely empty layout .-. The transition delay between a layout and another screen looks like a inevitable problem so far, and since a cannot solve it I'm trying to find ways to look around it.

    If I could just keep the previous layout or image showing or have anyway to signalize the player that the layout is loading it would be fine. The problem is the short black screen I get between the transition.

  • RayKi , wait, do you mean 30mb of source files weights or 30mg in the debugger "0 objects - 60 FPS - 0% CPU - 6.9mb images - webgl" section?

    In the first case - it is too much, in the second - it is okey.

  • 30mb in the debugger

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