VRAM of Objects Created from Other Layouts

This forum is currently in read-only mode.
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I keep a bunch of my objects stored in a "storage" layout, such as bullets, then create them when they're needed (e.g. bullets are fired) in each layout. I wondered though, how do these get stored in VRAM? They aren't objects in the currently loaded layout, so how is it working?

  • In the exe I think things are just dumped and grabbed when needed.

  • Thanks, but that does not help. I know how VRAM and RAM work with Layouts (more than what you just said), but my question still stands. How it handles creating objects from other layouts is what I want to know.

  • If you have construct set to 'per layout' then it dumps all the textures from the previous layout and loads the textures for all the objects in the next one. If you create an object from another layout and its textures aren't already loaded, construct then loads the textures for the created object and will have to wait until they are loaded to do anything else. As such you might want to create one of any objects that might show up in the layout at the start of the layout, when everything else is loading as well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Would it clear from VRAM as soon as all instances of the bullet are gone? Oh, hmm. I could manually load the storage layout and keep it loaded couldn't I?

  • Would it clear from VRAM as soon as all instances of the bullet are gone? Oh, hmm. I could manually load the storage layout and keep it loaded couldn't I?

    From my testing, it seems that textures are removed from VRAM as soon as all instances of the object using it are gone.

  • > Would it clear from VRAM as soon as all instances of the bullet are gone? Oh, hmm. I could manually load the storage layout and keep it loaded couldn't I?

    >

    From my testing, it seems that textures are removed from VRAM as soon as all instances of the object using it are gone.

    I just tested it myself too just to clarify if that also applies to objects that are part of the layout and it doesn't. Good to know. This stuff should really be written down somewhere...

  • So basically create all your objects per layout from another parrallel layout to keep VRAM clean. If it's still like this in C2 I'd request ability to move objects to different layouts at runtime. Although because of this I'll just use a special layout with all the objects I will be deleting at runtime.

  • >

    > > Would it clear from VRAM as soon as all instances of the bullet are gone? Oh, hmm. I could manually load the storage layout and keep it loaded couldn't I?

    > >

    > From my testing, it seems that textures are removed from VRAM as soon as all instances of the object using it are gone.

    >

    I just tested it myself too just to clarify if that also applies to objects that are part of the layout and it doesn't. Good to know. This stuff should really be written down somewhere...

    You can unload objects that have no instances left from VRAM - just run Unload textures for the layout you are currently at. It'll clear all the deleted objects from VRAM while leaving everything else intact.

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