load layouts as needed rather than loading all

0 favourites
  • 6 posts
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • Hi there,

    I'm working on a port of a game from HTML5 to iOS using cocoonjs.. but i'm seeing a problem (with the help of my xcode developer partner) that the entire game is trying to load at the start.

    What is happening is the app is loading and then after being open for a fe seconds crashes / closes out.. we've done a lot of things like remove all audio.. that didn't help..

    the graphics are relatively high quality 1920x1080, but nothing outrageous.

    I have a client that needs us to port this project to iOS and it's simply not working. my partner and I spent all day yesterday hacking around with XDK CocoonJS and he event found some other wrappers out there that we tried to mess around with.

    it's terribly frustrating to have come into this project using C2 with the expectation that making an iOS port was possible, but it seems that its anything but..

    event my simplest project ported over to cocoon and xdk with no sound! part12studios.com/temp/TT1 how can something this small / simple not have sound?

    are there unspoken rules to getting audio to work on iOS with C2 via CocoonJS that I'm unaware of?

    The best thing we could come up with to perhaps prevent the crashing was to only load scenes as needed rather than packing everything into it.

    my project has over 190 pngs and about 130 media files (all audio)

    so maybe spreading the files out over scenes as needed would prevent the power-loading of a bunch of files into an iOS device..

  • Unfortunatly CocoonJS seems to lack memory managemnet. So C2 just loads everything. Might want to see if Ejecta has better opportunity.

  • ok that's good to know.. our graphics if turned into sprite sheets would look something like this dropbox.com/s/xk3v5wz6rox51pe/unnamed.png but of course its not, its 190 individual graphics (animations being an exception)

  • but what about not using Cocoon? Can I tell a straight HTML5 game to not load the next scene till it's needed? bottom line is that our project is probably using too much memory for iOS.

    I'm trying to figure out what I can do to salvage the project here and work within the confines of Cocoon or XDK.

    I was planning to go back and downsize all the art to a lower resolution to help, but i feel like its a lot of work on the possibility that the problem will still happen..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The other day ALLMarkMade posted a link to a YouTube video that made several references to similar issues that you are having regarding lowering the overall project size from 30meg to 5megs. In the video, the speaker had to lower the project size and one way he suggested was to use JPG files to lower each image's file size. He said it saved him 10megs just by going from PNG to JPG files. Only use PNG if you absolutly need alpha transparency. However, it was pointed out that the video is about a year old, so I am not sure if the PNG vs JPG savings still applies. I need to do more investigating myself for the same reasons you are struggling with your project. I remember a blog by Ashley or Tom posted on the topic of PNG files and how they are being handle in C2 with an update they implemented. It maybe that the PNG to JPG file size difference has already been dealt with. I just have not had the time to do the research yet. Maybe someone in the know could speak to this. Anyway, the video speaks a lot about porting a projects to native apps, and you may find some helpful information from it.

    The link to the post which reference the YouTube video is:


  • Do you have a lot of layers? I have noticed that layers are extremely intensive on the frame rate. I had a little project that effectively did nothing - no On Ticks, No x seconds. Just sat there waiting for input. It had about 15 layers of images. Reducing it down to 1 layer sent my FPS from 35 to 60.

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