How do inactive "assets" layout affect performance?

0 favourites
  • 2 posts
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • As previously mentioned, it's best to create objects in an inaccessible layout so that their instances are pre-created at runtime. However, in terms of performance, is it okay to have many instances for design purposes (see pic; equipment objects & texts), or should I destroy excess instances and retain only one? Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Instances on an inactive layout are not pre-created and can't be destroyed.

    When in runtime you need to create an instance of an object, C3 engine will search all layouts for this object. And, once found, will use it as a template. If the object exists on multiple layouts, the first found will be used.

    So my guess is that there is zero performance impact.

    There is another thing to consider though. When you create an object from an inactive layout, there may be a small lag while its images are loaded. (especially if it's a large sprite with lots of animations). Placing an object on the current layout and immediately destroying it allows to pre-load the textures into memory. So the next time you create an instance of it, it's created without a lag. However, you can use "System Preload images" actions to achieve the same result.

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