Optimization - multiple layouts vs one layout, assets layout

0 favourites
  • 4 posts
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • Hello,

    I was thinking of using an assets layout.

    My game is currently - according to Construct 2 - using about 40 MB of memory. That's for the one layout I have.

    Is that a lot? My previous projects had much less. I am currently using one single background sprite which holds different images for different levels. It also moves infinitely from left to right. Is it better to have seperate sprites for this? I'm using sprite because tileable background doesn't support frames and I would get like a ton of different backgrounds on one screen.

    Now I find it really, really convenient to use one 'level' layout, one 'menu' layout and so on to limit the number of layouts.

    What's better, use multiple layouts? Then I would have to use an assets layout for convenience. I tried placing them all on a seperate layout but for some reason I can't bloody figure out sometimes it wouldn't pin or spawn them on the level layout!

    What are good ways to reduce memory size and best practises for layout use? Multiple layouts for different levels? Or one, but load them from an assets layout? But why aren't they always loaded?

    Thanks!

    • R
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try and keep it below 100mb. Best practice is to load in smaller images. Another is to use the tilemap stuff but seems like you have already dismissed using that. I don't know why you would want to limit the number of layouts, this doesn't really do anything. If using a single layout is better for your project then that's fine but it won't affect performance. A layout doesn't load until you go to it. The memory being used is for the current layout.

  • A layout doesn't load until you go to it. The memory being used is for the current layout.

    Hey, thanks for your reply.

    So if I didn't put all the assets on one layout it would affect performance correct? In a positive way.

    Multiple layouts would reduce memory usage no? Backgrounds for example. All unique pieces. Instead of having them in one sprite, divide them and use tiled backgrounds each unique one on a seperate layout?

    If you say memory is used for each current layout, the above would make sense.

    I'll go and see where what causes the big usage. I think it's the background sprite indeed.

    Regards

    • R
  • I think the estimated memory usage is based on the biggest layout. If you have a layout full of assets then its probably based on that, but this won't be used or loaded in the game so performance should be fine and the memory usage is going to be much lower. You're using it as a store for assets yes? I sometimes do that because you need an instance somewhere to set the initial values. If you have just the one layout at the moment with the background image then the memory usage will be based on that but it seems quite high for just one sprite.

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