Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to really dispose sprites from memory?

arev

Sponsor

Here's the problem - I'm making a sort of a player that displays multiple images as frames of animation. These images are at 800x600 resolution and there's hundreds of them. Animations are divided in groups. Some groups have 140 frames, others have 300. Now, around the sixth animation I get an error "Failed to create bitmap", and the RAM usage at that time is above 1,5GB. I've tried disposeing the sprite object (and it's bitmap too) and then reinitializing before starting next set of frames, but it really has no effect on memory usage. Any ideas on what to do with it would be great. Really :>

Thanks.

Edit: Ok, Some partial solution to this is loading the pictures with Bitmap.new() instead of using the RPG::Cache. This however causes some flickering at times, as the pictures aren't no longer... well... cached :] But at least it doesn't crash the whole thing. I'll keep trying but I'm also open for any ideas.

Edit2: Problem solved. RPG::Cache.clear works like magic :)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top