How do I Avoid loading all assets at once??

0 favourites
  • 9 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • I have a fairly largely scoped project that would benefit from compartmentalizing/modularizing.

    Each module is a mini-game (about 10) and will have unique game mechanics but will share some functionality between them. They also need to be content aware (i.e. You completed this mini-game, you'll like this one) all wrapped in an interactive Construct-2 "over-world."

    Would it be possible to load each component separately as the player accesses them (i.e. see a loading screen for each component) or do the assets have to be downloaded from the start?

    The big challenge here is mobile support.

    Thanks,

    A

  • well it's probably a hack but as a C2 game can call another c2 game through the browser object, would this help? it'd be horrible if you wanted to transfer info between the games I suppose.

  • The key is the communication between the different components. It's easy to get Construct to send stuff to the browser through javascript functions but the reverse I suppose is a different story?

  • "Premature optimisation is root of evil"

    Don't worry about it, As long as it's not a problem "yet", Make your game, and rest assured that Ashley (Boss) got our backs

    I believe stuff is loaded layout-by-layout, so each minigame could be a layout, etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "Premature optimisation is root of evil" +1 for this.

    I've left more decapitated Java servlets in my wake doing this than I should care to admit, haha.

    You can load images dynamically from blank sprite objects using the "Load image from URL" action. You can dynamically load Text objects using AJAX and JSON.

    You can load assets with AJAX too using the "Request project file" or "Request URL" then request an image URL. For instance, on our website (http://50.112.151.9/home) we load the test text and images on the "About" page using JSON AJAX calls. That way it only loads each pages content when that page is visited. But you still need blank sprite containers for all of those objects.

    Like this: http://postimg.org/image/kfuv0y92z/

    The JSON file that it loads from looks like this:

    {

    "p1":["This is a paragraph of text for JSON delivery. 1","500","200","2200"],

    "p2":["This is a paragraph of text for JSON delivery. 2","500","300","2200"],

    "p3":["This is a paragraph of text for JSON delivery. 3","500","400","2200"],

    "p4":["This is a paragraph of text for JSON delivery. 4","500","500","2200"],

    "p5":["This is a paragraph of text for JSON delivery. 5","500","600","2200"],

    "p6":["This is a paragraph of text for JSON delivery. 6","500","700","2200"],

    "p7":["This is a paragraph of text for JSON delivery. 7","500","800","2200"],

    "img1":["wizard2.gif", "800", "900", "0"],

    "img2":["wizard_male.png", "800", "400", "0"],

    "img3":["", "0", "0", "0"]

    }

  • gumshoe2029 How does that work with caching? Is there any?

  • Construct 2 doesn't support part-loading projects at this time. The best thing to do is probably to export separate projects and navigate between them. They can still leave data for each other by storing stuff in WebStorage.

  • Thanks Ashley

  • gumshoe2029 How does that work with caching? Is there any?

    Sorry for the late reply. My scheme listed above just loads images upon entering a new layout, so that I do not have C2 load them all at the beginning. I use 1px x 1px placer images for placeholders, then just dynamically resize and place.

    There is no server-side caching this way, other than what the browser does anyway.

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