ST314's Recent Forum Activity

  • 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

  • Might as well turn those animations into video files.

    Wow! It is really great idea!) I definitely need to try this method) even if it does not work, thank you!

  • 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

  • Ashley I would be infinitely grateful if in the next update there will be function of unloading unnecessary animations

  • I don't think highjacking a function will get you where you want. Normal unloading is done layout by layout.

    Also, you would have some issues with using the uid like that. Those ids get recycled.

    UID is not problem. Because we can pick certain sprite and then:

    "this.runtime.DestroyInstance(this.runtime.objectsByUid["&Sprite.uid&"]);"[/code:2adnzed0]
    Ashley is right, after minimizing the code, I can not call the functions that I need. I will try to create a plug-in or behavior that will do this.
  • We already have a destroy action.

    You know that, right?

    Yes I know. I chose this function to facilitate the issue. It was important for me to understand how to use the "execute JavaSript" to call a function from the c2runtime.js

  • This isn't a good idea. Minifying the script changes all the names so will break any cases you make runtime calls by executing JS.

    Well, could you give me advice on how to unload unnecessary animations from memory. I now create a fairly large space simulator, accordingly I have lots of large animations (gas planets and stars), and they take up a lot of RAM, although they do not use everything at the same time. I already did a selective download of animations, but now I need to do their unloading

    P.S thank you so much for such a cool engine

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have you really thought this through?

    Yes, I am. I spend a lot of time reading source code of C2. I need it because I want make action that unload unnecessary animations from memory. So I started from picking certain sprite. To make question easier to understand I chose "destroy" function.

    I hope that I understood the question correctly, because English isn't my native language)

    ?????)

  • I solved this!!!!!!

    "this.runtime.DestroyInstance(this.runtime.objectsByUid[2]);"[/code:1vr2063s]
    
    instead "2" you need to write object's UID that you want to destroy)
  • Hello) I find this function in the code of fade behavior:

    this.runtime.DestroyInstance(this.inst);[/code:3n247k40]
    Question: what I need to write instead "this", to delete sprite using Browser -> execute JavaScript
  • Hi!) I moved sprite's animations into project files. And on start of layout i load them to the sprite

    And I can repeat this several times, but i don't need to save it in cache, so how can I disable caching?

    P.S if I made grammar mistakes i'm sorry, English isn't my native language)

  • Some planets from asset

ST314's avatar

ST314

Member since 25 Sep, 2017

None one is following ST314 yet!

Connect with ST314

Trophy Case

  • 7-Year Club
  • Email Verified

Progress

8/44
How to earn trophies