Ignore sprite animations during preview?

0 favourites
  • 12 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • I have a lot of sprites with heavy animations in my game. These all work well when exporting, but they make it harder to preview the game -- "preparing images" can take several minutes, and sometimes Chrome (what I use for the C3 editor) runs out of memory. The game, along with the C3 editor, takes 5-7 GB of memory during preview.

    However, I usually don't need most of these sprites/animations during preview, so it would be great to be able to disable/ignore certain sprites during preview mode. I can imagine a feature where the developer can select sprites or even specific sprite animations in the editor, and specify if they should be ignored during preview mode so spritesheets for those animations aren't created in memory. Does this sound like a realistic new feature, and/or is there a way to accomplish through existing features? Happy to submit a new feature request if this is feasible.

    Thanks

    Tagged:

  • Bumping...

    Ashley, any thoughts on if this is a reasonable feature request, or if there's a way to accomplish this with existing features?

    Thanks

  • At the beginning destroy all the sprites with which you have the animations

  • It sounds like you are using an exceptionally large amount of images. See the manual guide on memory usage - if you're doing something very inefficient you can quite often easily reduce the memory usage by 50-75%.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • At the beginning destroy all the sprites with which you have the animations

    It sounds like you are using an exceptionally large amount of images. See the manual guide on memory usage - if you're doing something very inefficient you can quite often easily reduce the memory usage by 50-75%.

    Thanks, but the issue isn't with animations on a specific layout. I'm familiar with the guide you're referring to, ASHLEY. I'm also familiar with the approach of destroying the animations after they've been created on a layout, and even freeing up the memory afterwards if necessary. I use those techniques quite a bit in my game. But my question is about something different...

    When using preview mode, all sprite animations in the game are converted to spritesheets, regardless of whether the actual sprites are used in layouts in the game. There doesn't seem to be a way to exclude any sprites from this spritesheet process. And since I have so many sprite animations, this spritesheet process takes a lot of time and consumes a lot (3-5 gb) of memory during preview mode.

    My question is -- is it realistic to add a feature that can exclude sprites from the spritesheet process FOR PREVIEW MODE ONLY. As I mentioned in the OP, I usually don't need most of thesprites/animations during preview. I can imagine a feature where the developer can select sprites or even specific sprite animations in the editor, and specify if they should be ignored during preview mode so spritesheets for those animations aren't created in memory.

    Hope this makes sense but happy to clarify more if need be.

    Thanks

  • When you preview, only spritesheets changed since the last preview need to be regenerated. So if you preview, close, then preview again, the next preview should be very fast as it essentially skips the preparing images phase. So it should already be skipping the vast majority of images, and given that, the setting you propose would probably have little effect. It is also designed to limit how many spritesheets it processes in parallel, specifically in order to limit the peak memory usage and avoid out-of-memory errors, while also working in parallel making use of multi-core CPUs in order to process as quickly as possible. So I have to wonder why this is a problem for you - are you constantly changing large amounts of images in between every preview? Are you dealing with lots of extremely high resolution images or something?

  • I think pandabear7413 means the first preview after loading the project. I also have to work with large projects with lots of images, and the first time I click preview, it takes 1-2 minutes to re-generate spritesheets. If I have to load a different project version - that's another 2 minutes of waiting to preview it. Accidentally closed the editor - another 2 minutes. These minutes add up to many hours over the course of development..

  • It also happens to me with a project, even if I have to enter a layout with only one sprite, it makes no difference, the first time I open the preview it takes much longer; Since the project will get bigger and bigger, but in reality it will often happen to work on layouts still under construction with few sprites, it wouldn't be bad to be able to load only a few things

  • If Chrome is dying when you preview the game then that's a sign you may have gone too far, 7gb of images really ?

  • I think pandabear7413 means the first preview after loading the project. I also have to work with large projects with lots of images, and the first time I click preview, it takes 1-2 minutes to re-generate spritesheets. If I have to load a different project version - that's another 2 minutes of waiting to preview it. Accidentally closed the editor - another 2 minutes. These minutes add up to many hours over the course of development..

    This. It's just on my first preview after loading the project. As Ashley said, subsequent previews are very fast unless I change the animations. dop2000, would the feature I'm suggesting help you as well? Not sure if you large sprites like me, or 1000's of small sprites...

    If Chrome is dying when you preview the game then that's a sign you may have gone too far, 7gb of images really ?

    I currently have 1.2 GB of images in my images folder. How much memory is actually consumed by Chrome varies -- it usually spikes up to 3-5gb total on the first preview, but that number comes down as Chrome stays open longer. Sometimes Chrome will crash due to running out of memory, sometimes not. Seems like crashes happen more regularly when a new Chrome version is released.

    I have large animations because I use these sprite objects as videos of sorts during the game, and I have about 50 or so such sprites ranging from 100 to 400 mb each. Suffice it to say, this approach of using sprites has worked well in my game and I'm not looking to change it.

    My idea of ignoring specific sprites during preview mode seems like an efficient solution here. Ashley, can you comment on if that's a realistic (and not too difficult) feature that can be added? Happy to submit a request if so.

    Thanks

  • What image size are those big animations?

    Ofcourse it's up to you to design how you feels best, but just a quick warning:

    Think about Video player software - They don't preload an entire video into RAM, they buffer as the video plays.

    Dont forget: Image sizes when stored as files, they're compressed, but to display them ingame, they're uncompressed.

    Assuming the size of the images are 1920x1080, which is around 8MB of VRAM, and you have 50 frames, then that would be almost half a GB of VRAM.

    That's only 1 sprite, and will cause issues for players that have an integrated chipset, like many laptops have.

    If you have many unique sprites at same size and frame count, and they exist all at once and are not cleared from memory, then around 15 sprites would max out the VRAM of a GTX 2060,and around 31 to max out a GTX 3060. That's just these sprites, may be many other images in your game.

    Would be good to playtest this on some mid-tier computers, make sure it works there.

    None of this matters if you are targeting high-end only, or it's just a personal project lol

  • I think the number of images matters as much as their size. I have a project with about 15K very small images. Their combined size is less than 50MB. And it still takes about a minute to render spreadsheets on a mid-range laptop.

    My solution was to upgrade my PC..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)