[Request] "Unload from memory" action

Discussion and feedback on Construct 2

Post » Fri Dec 26, 2014 12:24 am

@Ashley
I asked about that in some random post, but I decided to make a "official" request, so here I am. Please :)

In other post you mentioned that objects place on a layout are automatically loaded into a memory and will stay loaded until layout is changed. Objects that are not placed on a layout but spawn/created in runtime are then loaded into a memory and when last instance of it will get destroyed object will be unloaded from memory. But then it turns out that even if you create or spawn objects they will stay loaded for entire layout, even when last instance is destroyed ;)

And this is nice and good in overall, but not everytime. Sometimes you only need to create an object to do something specific and after that you don't need it anymore. But unfortunately object loaded into a memory will stay there until next layout and of you have few that kind of object then this is simply a waste of memory. Especially on mobiles where memory is very limited.

In my previous and current project (and probably any future project that will need it too) I'm using very simple yet very powerful technique (sound a bit like some super martial arts killing moves ;P). And by the way a little tip for everyone.

It involves using a @R0J0hound Paster plugin. Basically all my backgrounds and UI's in game are made of a lot of instances of different sprites, tiled background, sprite fonts, 9-patched and whatever I need to make it all pretty. When everything is placed or spawn and set how I wanted then I paste it all into one Paster instance and delete them all.
This make's my layout nice and clean because I don't need to do anything with them anymore - in my current project objects count drop to 1 (just the Paster) from initial 276!

So object count is no more an issue. Unfortunately memory usage still is. Current background objects only are using over 100MB - this is after a lot of time spent on assets optimization and trying dozens of different things to do same thing. Adding one image that represents same content and same resolution takes only about 16MB! But doing it like this, using an image instead of all the assets, I'm loosing all randomness on level generation. And here comes the Paster. After pasting everything I get more less same memory usage as with normal image but I still have my randomness every time layout is started! And even that I still have control over Paster resolution, so I can make it a bit less pretty and save extra few MB.

So once again, pretty please for adding an "Unload" action :)
I don't want to make a hard choice between making my game pretty or playable on as many mobiles as I can :P
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Sat Dec 27, 2014 5:47 pm

I think this was asked for before. Around the time the room region thing was implemented.

I thought the answer was basically no. Value wasn't seen in it. Which is absurd. Open world and single layout games would greatly benifit among other things. But I believe the answer was along the lines of use multiple layouts.

I believe the main concern was such a feature would likely be misused. And many people would complain about objects popping in as they load etc.

Anyways, I would love to see this implemented.
B
28
S
8
G
1
Posts: 226
Reputation: 2,865

Post » Sun Dec 28, 2014 3:25 am

@Tylermon
Yep. I put in the request object unloading completing a few times. With either no replies or the one you posted above.

I agree with you. I would like it if Ashley would stop taking the quality of the game responsibility in his hands and put it the developers hands. Ashley shouldn't be concernd with popping, that should be our responsibility. If we want to allow popping because the feature benefit is worth it. Then let us.

I pointed out that games like Midnight Club and GTA have popping and players have no problems. Let me handle popping and presenting the user experience. Not lock it off in the engine.

However 2/3 years and I don't see the feature being implemented at all :(
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Sun Dec 28, 2014 3:58 am

I would love to have this feature as well. I wanted to have multiple weapons in my game each with unique animations. I have a lot of animation frames and would need to unload weapons I'm not using. Since that's not possible, I'm limited to only one weapon.
B
80
S
52
G
41
Posts: 370
Reputation: 25,830

Post » Sun Dec 28, 2014 7:16 pm

Yeah, something like an "unload from memory" sprite action, or system - "unload unused images" will be really helpful. It's annoying to restart a layout everytime when i want to destroy a heavy sprite and spawn another.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Sun Dec 28, 2014 9:58 pm

I think this is one of those features that would be useful to more experienced users, but would cause a lot of confusion for newcomers. I imagine Ashley has forseen the onslaught of 'performance issues' and 'bug reports' that would inevitably arise from improper use of such a feature.

It's also quite possible that this would require some deep changes to the engine, given that, in its current state, textures are only unloaded at the end of a layout.

Still...I would like to see this. It would make expansive, single layout games possible in C2, even on mobiles. I see the recent addition of 'Reload Layout X/Y' as a sign that Ashley has some interest in facilitating this.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sun Dec 28, 2014 10:34 pm

Kind of hard to remove part of a texture from a spritesheet isn't it?
Image ImageImage
B
169
S
50
G
174
Posts: 8,328
Reputation: 110,800

Post » Sun Dec 28, 2014 10:55 pm

newt wrote:Kind of hard to remove part of a texture from a spritesheet isn't it?


Not impossible ;)

But seriously. Sprite sheets are made by objects. Each object (well sprites only) have it's own sprite sheet(s). And it's quite logical that "unloading" the object you are simultaneously unloading it's textures. So if you have one sprite with 10 animations with 20 frames each, "Unload" will unload it completely. These are the thing
@TiAm was talking about "could cause a lot of confusion for newcomers". On the other hand loading that kind of object in the middle of the game will have exactly opposite effect. It will load entire object with all it's textures into a memory (no matter how many frames or animations that objects have).

And new users should know that already. :)
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Sun Dec 28, 2014 11:51 pm

Sounds like a useful feature, which would allow more variety to the types of games that can be made.
B
45
S
21
G
65
Posts: 1,118
Reputation: 38,227

Post » Mon Dec 29, 2014 9:32 pm

I second this, at the moment we really need to be stingy on how many animated textures we can have before gameplay stutters like a retard with parkinsons.
B
34
S
5
G
1
Posts: 78
Reputation: 3,397

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 18 guests