ST314's Forum Posts

  • 15 posts
  • 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

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My Twitter: twitter.com/ST314_Assets

  • Animated 10 Gas Giants + Rings — Now for sale in the Scirra Store!

    scirra.com/store/2d-game-sprites/animated-10-gas-giants-rings-3905

    *10 animations of gas planets

    *150 frames for animation

    *10-12 frames per second

    *png format with transparent

    *animated rotation

    *animated storms !!!!! (*-*)

    *resolution 192*192 (If you are not going to stretch to the whole screen, then that's enough)

    *Great BONUS (7 rings)

    *A great choice for space games)

    I hope with this asset your Sci-Fi game become more wonderful then ever)

    Good luck)

    Save your time, buy this asset!

    Use this topic to leave comments, ask questions and talk about Animated 10 Gas Giants + Rings

  • Hello) I'm Timofey from Kiev, I'm 16 years old and I love Constuct 2! Do you know that in Ukraine and especially in Russia a lot of people know about Construct?) You can find screenshots from my mega super game at vk.com/stgcompany

  • 15 posts