VRAM of Objects Created from Other Layouts

For questions about using Classic.

Post » Sat Apr 10, 2010 5:27 pm

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?
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Sat Apr 10, 2010 9:28 pm

In the exe I think things are just dumped and grabbed when needed.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Sat Apr 10, 2010 10:35 pm

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.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Sat Apr 10, 2010 10:55 pm

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.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sat Apr 10, 2010 11:11 pm

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?
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Sat Apr 10, 2010 11:54 pm

[quote="Mr Wolf":362zqmyi]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?[/quote:362zqmyi]
From my testing, it seems that textures are removed from VRAM as soon as all instances of the object using it are gone.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sun Apr 11, 2010 1:27 am

[quote="linkman2004":zvyedbko][quote="Mr Wolf":zvyedbko]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?[/quote:zvyedbko]
From my testing, it seems that textures are removed from VRAM as soon as all instances of the object using it are gone.[/quote:zvyedbko]
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... :)
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Fri Apr 23, 2010 5:21 am

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.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Fri Apr 23, 2010 6:53 am

[quote="Mr Wolf":wa4etepe][quote="linkman2004":wa4etepe][quote="Mr Wolf":wa4etepe]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?[/quote:wa4etepe]
From my testing, it seems that textures are removed from VRAM as soon as all instances of the object using it are gone.[/quote:wa4etepe]
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... :)[/quote:wa4etepe]
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.
B
16
S
8
G
4
Posts: 136
Reputation: 3,144


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest