How to destroy object using Browser -> execute JavaScript

Get help using Construct 2

Post » Wed Oct 18, 2017 6:10 pm

@Ashley I would be infinitely grateful if in the next update there will be function of unloading unnecessary animations :)
Last edited by ST314 on Wed Oct 18, 2017 8:23 pm, edited 1 time in total.
B
12
S
3
G
4
Posts: 14
Reputation: 2,272

Post » Wed Oct 18, 2017 7:08 pm

You could use the SDK to write a plugin to do this, and not break minification. It'd also integrate more nicely with events.

I'm a bit skeptical of unloading objects - in many cases it won't reduce the peak memory usage, so won't help avoid out-of-memory crashes. What are you doing that requires this?
Scirra Founder
B
414
S
245
G
92
Posts: 25,201
Reputation: 200,343

Post » Wed Oct 18, 2017 8:55 pm

Ashley wrote:You could use the SDK to write a plugin to do this, and not break minification. It'd also integrate more nicely with events.

I'm a bit skeptical of unloading objects - in many cases it won't reduce the peak memory usage, so won't help avoid out-of-memory crashes. What are you doing that requires this?


@Ashley if I understand the meaning of your question correctly. I already wrote about this, I'm doing a space simulator. Because of that, the generated stars and gas giants did not look very cost-effective, I had to do their animation. For example, one animation of a gas planet has 150 frames, each frame has a 192 * 192 resolution. After simple calculations we learn that one animation will occupy 22 Mb (although it seems to me that it takes up more memory). At the moment I have 10 such animations, to the output of the game I'm going to increase this value 2-3 times. At the same time, no more than 6 animations are displayed, so others just take up memory. Initially, I was going to do an object for each animation and then unite them into a family, but it's very inconvenient. But I figured out how to download animations from project files. And now I'm thinking about how to unload them from memory
B
12
S
3
G
4
Posts: 14
Reputation: 2,272

Post » Wed Oct 18, 2017 9:53 pm

@ST314 I use this plugin https://www.scirra.com/store/construct2 ... emory-3812

It works like a charm and I can unload a ton of stuff that I don't need anymore when they are destroyed and saves a lot of image memory in my game. You can unload whatever you want with one single action. It is not free but I use it in all my projects so it is totally worth it.
B
63
S
26
G
16
Posts: 816
Reputation: 14,573

Post » Wed Oct 18, 2017 10:05 pm

Might as well turn those animations into video files.
Image ImageImage
B
178
S
50
G
206
Posts: 8,686
Reputation: 127,715

Post » Wed Oct 18, 2017 10:48 pm

newt wrote:Might as well turn those animations into video files.

Wow! :o It is really great idea!) I definitely need to try this method) even if it does not work, thank you!
B
12
S
3
G
4
Posts: 14
Reputation: 2,272

Post » Wed Oct 18, 2017 11:11 pm

Anonnymitet wrote:@ST314 I use this plugin https://www.scirra.com/store/construct2 ... emory-3812

It works like a charm and I can unload a ton of stuff that I don't need anymore when they are destroyed and saves a lot of image memory in my game. You can unload whatever you want with one single action. It is not free but I use it in all my projects so it is totally worth it.


Thank you! But I know about this plugin. I have personal problems with payment (it's not a matter of price, it's about money transfer). Moreover, finding a solution to this problem gives me great experience, and if I find a solution to this problem I can put this plugin on forums or for an adequate price (Scirra created function to unload textures (Plugin/Sprite/runtime.js :202 typeProto.unloadTextures = function ()) and I need only to call this function correctly)
P.S I don't want to conflict with author of this plugin, I'm sure that he is an excellent programmer and a man, but $20 for such a simple plug-in is a lot
B
12
S
3
G
4
Posts: 14
Reputation: 2,272

Post » Thu Oct 19, 2017 2:18 pm

I've recently created this idea regarding Memory Management which might be relevant.

It's also addressing the issue of the currently not customizable layout-to-layout loading process that is causing a lot of trouble for the more advanced types of games, which unfortunately even the recommended 3rd party unloading plugin currently can't deal with.
ImageImageImage
B
81
S
30
G
78
Posts: 752
Reputation: 46,393

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests