Does Family load all its Children into Memory even if ...?

0 favourites
  • 8 posts
From the Asset Store
Add emotion, innocence, joy and cuteness to your video game with these 15 songs and 9 SFX
  • Does Family loads all its member into memory even if one is not explicitly added to the Layout?

    Before I report it as a bug can someone try and confirm this?

    I have created a Family called "Levels" where I add each of my Level sprite (eg: Level1 to Levl5), each Level sprite is a collection of "Tiles" that are saved in as animation (speed set to 0)

    I only use one Level sprite in each Layout. I use the Family "Levels" in a common Event where I handle the scrolling, Collision detection and everything related to a Level.

    My question is, when running a particular Layout that contains only one member of the Family, does Family load all its Children sprites into the Memory?

    I am currently noticing that even though sprite is not added to the layout, when I call for example "Spawn Level 2" in Level1 Layout(which has only sprites from Level1) the un-added sprite object is getting created!

    Sorry if I sound confusing, I can explain more if required.

    Ashley Can you help here please?

  • The source images from your project are loaded into memory at start up.

    > The images go in to RAM and also in to VRAM (graphics card memory) if the rendering is hardware accelerated, which it usually is these days.

    >

    > They get decompressed to the same size as the image saved as a 32-bit bitmap, so yes, a 1000x1000 pixel image will always take about 4mb of memory alone. This isn't much when both your computer and graphics card have gigabytes of memory, but bear in mind 4mb is still a lot for a single image on mobile.

    >

    > The various compressed formats just package the data in to a smaller filesize. Compressed images cannot be drawn though, so it's normal to decompress the images in to memory whenever they are loaded.

    >

    > We have plans for a feature to load textures layout by layout (like Classic can) somewhere on the todo list, to save memory with very large projects.

    >

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • lennaert how old is that post? as C2 now loads layout by layout. so only images Sprites that are used are loaded. therefor them being in a family shouldn't matter unless created at some point

  • lennaert how old is that post? as C2 now loads layout by layout. so only images Sprites that are used are loaded. therefor them being in a family shouldn't matter unless created at some point

    I just read Collodiums post, seems it was implemented already

  • I think that this has been implemented for a while now; here's the info.

  • > lennaert how old is that post? as C2 now loads layout by layout. so only images Sprites that are used are loaded. therefor them being in a family shouldn't matter unless created at some point

    >

    Did they already implement loading by layout ? I thought that was not yet realized and that every project resource image is loaded into memory at start up.

    As far as I know, all images are loaded at start up, and only images in the viewport are rendered. I think you are mixing these 2 up.

    No! Only images added to Layout are loaded into memory. Else no current C2 games would run on Mobile

    Thats why I am surprised when a Sprite that part of a Family but NOT part of Layout is spawned in the current Layout

  • Families are not involved in the texture loading at all. Texture loading works by individual object types instead of entire families to avoid dragging in loads of textures that aren't necessary. So if you have one "Sprite3" instance in a layout which is a member of a family, only "Sprite3" has its textures loaded.

  • Families are not involved in the texture loading at all. Texture loading works by individual object types instead of entire families to avoid dragging in loads of textures that aren't necessary. So if you have one "Sprite3" instance in a layout which is a member of a family, only "Sprite3" has its textures loaded.

    Thank you for Confirming ASHLEY. However I am experiencing some weird issues with Family. I will experiment with a separate CAPX and report back.

    Thanks for your constant help

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