Loading/Unloading images at runtime

For questions about using Classic.

Post » Sat Jun 06, 2009 12:09 pm

So, say I want to load and unload images for sprites during runtime, for example for a big exploration game, to avoid wasting buttloads of VRAM and also to avoid long loading times. Is this possible at all? Will it update collissions and shit too?
B
2
S
2
G
4
Posts: 110
Reputation: 1,670

Post » Sat Jun 06, 2009 2:42 pm

it's possible with versions after 98.9, but i don't know if it's fully functional yet.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat Jun 06, 2009 5:04 pm

You generally can only load and free textures for entire layouts at a time, but if you use the action to unload textures from the current layout, it will free all textures except the ones currently in use by existing objects. That might work for you. But then you should be aware that creating an object that doesn't exist will have to load the texture for that object, which could cause a brief pause.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,574

Post » Sat Jun 06, 2009 11:21 pm

Ah, damn. I was kind of hoping to have this vast scrolling landscape, which is why it would be useful.
B
2
S
2
G
4
Posts: 110
Reputation: 1,670

Post » Sun Jun 07, 2009 9:32 am

How vast are we talking? I'd think it'd be best to keep the landscapes in memory and clear out anything else, if one layout really is going to be a problem for VRAM.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Jun 07, 2009 9:48 am

I don't know, pretty big atleast, and I don't want to exclude people with crappy computers (like I used to have).
B
2
S
2
G
4
Posts: 110
Reputation: 1,670

Post » Sun Jun 07, 2009 1:48 pm

Sounds like you want to do something which requires a lot of VRAM on computers with not much VRAM.

I think you're stuck :P
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,574

Post » Sun Jun 07, 2009 1:57 pm

Camouflage the texture loading/saving as a checkpoint. When player reaches a checkpoint, dim the screen and do something to distract the player while you sneakily swap textures around.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sun Jun 07, 2009 3:30 pm

That's a great idea - you might even be able to completely disguise a switch to another layout by having two screens identically laid out, and the pause while textures are loaded could be covered up by Mipey's idea!
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,574

Post » Sun Jun 07, 2009 4:32 pm

I'll throw a rock...

remember SWIV on the amiga? vertical shooter tank and heli reminiscent of the arcade silkworm, but vertical instead of horizontal.

So, that game, by sales curve, was a masterpiece of code as it would play the game from beginning to the end with simultaneous loading of titles for background and sprites and bob. Although it was said to load gfx and palletes simultaneously, it was done briefly during some places where no enemy sprites were there and a common background with general simple titles was displayed.

Like the idea above, it was a brief pause of a second and it was during a level.
At the end of a level with it's guardian, it would load again while the guardian was exploding.

It was really clever into disguising the load,
a loooot diferent from shadow of the beast 2 and 3 where everything except music would freeze for some 30 seconds...

Anyway, just a set of ideas, hope it inspires.
B
2
G
3
Posts: 4
Reputation: 858

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests