Memory Management

0 favourites
  • 9 posts
From the Asset Store
Manage time and money, plan the best strategy to make all the customers happy in your restaurant, a hotel, cafe, or any
  • Hi,

    I like to know if somebody knows what is best, in memory management terms, in this two situations:

    • a project with two "layouts", A and B, when you go from A to B the "sprite images" of A are discarded from memory and the "sprite images" of B are loaded.
    • a project with a single "layout" and two Layers, A and B, when you do a command the "Layer A" opacity are set to 0 and the "Layer B" opacity are set to 100, but I think than all the images stay loaded in memory.

    I need to evaluate this for continue in a mobile project.

    P.S: I will use the Safari browser of iPad to acess the app.

    Thanks

  • I believe both solutions are the same at the moment.

    Images are loaded in VRAM on loading/downloading of the game/application and decompressed there.

    All the images of all your project are loaded there at first.

    Destroying instances between a layout to another has no effect on the VRAM usage, the decompressed textures stay there.

    (source: blog article about C2's image compression)

    Ashley said he would add a feature to load up image per layout, on start of the layout at some point (no ETA on this feature though).

    When this feature will be available, than your idea of "discarding" textures to only have the current layout's textures in VRAM will be the correct way to go I believe.

    In the meantime, not much to do unless keeping the number of textures of your whole project the lowest possible to stick/match with the available VRAM on the device.

  • Thanks Kyatric,

    Your attention is always helpfull.

    By the way do you know how to measure the total VRAM I am using in a project? And what is the total amount of VRAM in iPads?

  • Those are good question I'm afraid I can't give a definite answer for.

    I don't have any smartphone/tablet.

    On my desktop computer, I do have some widget on the desktop that allows me to keep an eye on the performances of my nvidia graphic card, giving me the amount of VRAM used/available, usage percentage, etc...

    I bet there are some apps available for your device that would provie the same service hopefully, but I have no link to give you.

    Maybe other mobile-users will have an answer for you.

    For now all I could advise you would be to try to find such an app in the appstore of your device and/or google about this specific device in case you would find the specs on a blog or a review website.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On my desktop computer, I do have some widget on the desktop that allows me to keep an eye on the performances of my nvidia graphic card, giving me the amount of VRAM used/available, usage percentage, etc...

    Could you share a link?

    Edit: To the widget, not your desktop ;)

  • shinkan: I'm using the "All CPU meter", "Network Meter" and "GPU Meter" from http://addgadget.com/.

    Dual screen ftw, they all stand on top of each other ^^

  • haha, thanks Kyatric

  • Thank again Kyatric,

    I will look for yours suggestions

  • I don't know enough yet about Construct to comment on this for sure (still really new to Construct), but if I had to guess, I'd think that option 1 would be slightly better. I say this because I would *guess* that Construct does not create all objects in memory from all layouts at the start. Therefore you have fewer objects in memory at a time by splitting into separate layouts. If you have both layers in one layout, all of the objects in both layers are in memory at the same time.

    Also there would likely be a CPU advantage to option 1.

    Like I said, I don't know the inner workings of Construct yet, and the difference is likely to be small from a memory standpoint anyway, but that is what I would think...

    Also it depends on the situation of course. If it is important that there be minimal delay when "switching," layers would be the way to go.

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