A question for experienced developers in C2/C3...

  • What?

    Doesn't the Construct 2 manual say that construct loads everything before you can even start the game? Meaning no matter how many layouts you have they will all be loaded by the time you can play the first layout.

    And from there how long can it take to load things into memory. I've never experienced any jerkiness when switching layouts

  • What?

    Doesn't the Construct 2 manual say that construct loads everything before you can even start the game? Meaning no matter how many layouts you have they will all be loaded by the time you can play the first layout.

    And from there how long can it take to load things into memory. I've never experienced any jerkiness when switching layouts

    From the manual:

    "Construct 2 only loads the images for the current layout. This avoids loading the entire project in memory which would be slow and consume a great deal of memory. When starting a layout, all images for the objects placed in the Layout View are pre-loaded. This includes all frames in all animations of any Sprite objects. (In other words, Sprites are either fully loaded in to memory, or not at all - they are never part-loaded.) When the layout ends, all images that are loaded but not used on the next layout are released from memory."

    My guess is that you haven't done any asset heavy projects yet but for us who do stutter and long loading times between layouts is a big big issue. But as I said easily solved now with the possiblity to preload exactly what you want.

    And you don't have to put all assets on one layout as newt said. You can load exactly what you want however you want.

  • You might not want all objects that are in a layout at the beginning of the layout, so an optimization for that would be nice.

    Adding events just to take care of that seems redundant, and prone to cause errors. Try duplicating a layout, and event sheet, and removing an object without removing associated events for example.

  • I'm not saying the plugin is but or whatever... Plugins are made to make things faster and easier indeed.

    All I meant is that I'm not the one to spend money on something you can do yourself. Easy way or hard way.

    Well the only thing you can't do with C2 is "preload" an asset that's not in the the current layout, and get some confirmation that it is loaded.

    Well, you can preload . Just create an object and delete it right away (you even have some kind of confirmation that it's been loaded).

    That object will stay loaded in memory until the Layout ends, making next layout load faster or be unloaded from memory with rest of the unused objects.

    The idea would be to know exactly what objects are on next layout and simply create and destroy them. Preferably in some kind of sequence and time period to not make current game choke.

    That's how I think that plugin work, but I bet it's nicely designed with nicer optimization and more user friendly.

    if you make a plugin that will let me unload any object from current layout at any time at runtime then I'm ready to pay 20$ for it or even more

  • All I meant is that I'm not the one to spend money on something you can do yourself. Easy way or hard way.

    I assure you that you are not able to replicate MM_Preloader features with C2 events. I myself made an event based preloader module (before I made this plugin) and it was ~100 events which were covering just around 50% of MM_Preloader's possibilities.

    if you make a plugin that will let me unload any object from current layout at any time at runtime then I'm ready to pay 20$ for it or even more

    By "unload any object " you mean literally any object or sprites or audio? I've already created unload audio features in my experimental AudioPlus plugin, which shortly after were implemented into official Audio plugin. Unloading objects which are not image and sound related doesn't make much sense as they are very small. So I assume that you mean Sprites mainly and releasing images from the memory?

    Fair enough - Added onto my TODO list. Will let you know when it's out.

    Anonnymitet & BadMario you guys are both right and not. Let me explain.

    C2 indeed loads all the project assets at the very beginning as BadMario says but it has nothing to do with the between-layout lags and the fact that you BadMario haven't noticed it, means that you've simply never worked on big enough project as Anonnymitet says (or you have some crazy monster fast PC).

    The assets that C2 loads at the very beginning are compressed images, yet at start of each layout C2 grabs particular compressed images and decompress them into bitmaps, and that's the process that causes the lag. I wrote an article which mentions this as well, so you may want to have a read: Game loading time optimization

  • I do believe the price tag for that plugin wasn't just set to get rich fast, but rather for the proper content of the plugin:)

    as of the object unloading, I'll just give you the link, will be faster that way.

    https://www.scirra.com/forum/request-quot-unload-from-memory-quot-action_t121551

    wow, just realize that post is 3 years old...

    Like always Ashley first misunderstood the question (like most people who post there) and then totally ignored it, but there are few good posts on later pages made by people who actually knows what they doing heh

  • I do believe the price tag for that plugin wasn't just set to get rich fast, but rather for the proper content of the plugin:)

    as of the object unloading, I'll just give you the link, will be faster that way.

    https://www.scirra.com/forum/request-quot-unload-from-memory-quot-action_t121551

    wow, just realize that post is 3 years old...

    Like always Ashley first misunderstood the question (like most people who post there) and then totally ignored it, but there are few good posts on later pages made by people who actually knows what they doing heh

    Alright I understand. I wouldn't say that Ashley missunderstood the question, he just don't see the valid use-case. In the example you gave, unloading unused objects wasn't necessary cause they could lay down in the memory idly and wait for the end of layout without any harm to the device or the project. Therefore Ashley's reply.

    BUT. Such unloading feature would be useful if for instance the memory limit would bee 150MB and you have to load 200MB for instance. Then first you load 100MB and turn to 16MB with Paster, then release unused 100MB and then load the remaining 100MB. This would allow you to load 200MB onto device with 150MB limit for instance.

    So yes I do see the usability and I will prepare such plugin soon. I'm finishing the SyncStorage plugin at the moment and then will take a look at this one. Will keep you updated.

  • Are we talking about just webgl, or that, and canvas?

  • Are we talking about just webgl, or that, and canvas?

    I know that WebGL allows you to release the memory on request. Still in canvas you can drop the reference and so the data without any pointers will be cleaned by GC.

    Up to that C2 handles objects instances in a specific way with so-called "deathRow", etc. so I can't just wipe out the texture from the memory cause this will cause some issues probably. It must be done "gently" and the right way.

    That's just a theory for now. I haven't investigated anything yet.

  • I'd hold off until the new C3 runtime, and sdk comes out.

  • I'd hold off until the new C3 runtime, and sdk comes out.

    There's new engine expected for c3?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd hold off until the new C3 runtime, and sdk comes out.

    This may mean to hold off even for some years as all we know about it is that it is in plans.

    If new runtime will be backward compatible then there will be no problem. If not, then all third party plugins will have to be rebuilt anyway and I'll deliver updates to mine ASAP.

    Either way I don't think it's wise to wait for an update about which we know absolutely nothing except that it probably will be released some day.

  • Ashley's already stated the new runtime will be just webgl.

  • Unloader is almost ready. I move with further discussion to the proper thread

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