Downsizing resources

At present, I work on 32 bits PNG images.

The original 32 MB of PNG files, takes 110 MBs RAM, when the game runs…

Would anyone know a way to downsize this consume?

El Monday 05 November 2007 13:42:52 Miguel Pragier escribi?:

At present, I work on 32 bits PNG images.

The original 32 MB of PNG files, takes 110 MBs RAM, when the game runs…

Would anyone know a way to downsize this consume?

Load only an image when you need it, delete it as soon as you aren’t using it.

Alberto Luaces <aluaces udc.es> writes:

El Monday 05 November 2007 13:42:52 Miguel Pragier escribi?:

At present, I work on 32 bits PNG images.

The original 32 MB of PNG files, takes 110 MBs RAM, when the game runs…

Would anyone know a way to downsize this consume?

Load only an image when you need it, delete it as soon as you aren’t using it.


SDL mailing list
SDL lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Ok.

In my games I have a lot of bonus ( jackPot-like ) animations.
When I load my images just before the use, we experience a small delay.
I read something about to shrink images resolution to 24 bits. Is it possible?
Can I convert my images from 32 bits to 24 and keep the quality?
My plattaform is Windows, and the desktop is ~32 bit colors~.

El Monday 05 November 2007 17:18:04 Miguel Pragier escribi?:

Alberto Luaces <aluaces udc.es> writes:

El Monday 05 November 2007 13:42:52 Miguel Pragier escribi?:

At present, I work on 32 bits PNG images.

The original 32 MB of PNG files, takes 110 MBs RAM, when the game
runs…

Would anyone know a way to downsize this consume?

Load only an image when you need it, delete it as soon as you aren’t
using it.

Ok.

In my games I have a lot of bonus ( jackPot-like ) animations.
When I load my images just before the use, we experience a small delay.
I read something about to shrink images resolution to 24 bits. Is it
possible? Can I convert my images from 32 bits to 24 and keep the quality?
My plattaform is Windows, and the desktop is ~32 bit colors~.

You can develop some more complex strategies, as loading the image for the
first time and not freeing its memory until you are sure it would not be
needed for a long time, what one would call a “cache”. Maybe you have to
spend a little bit of memory for the possibly used graphics, but it shouldn’t
be necessary to reach that 110 megabyte size. You will have to think about
the trade off between the loading delay and the amount of RAM used and adjust
the program accordingly.

If your display is 32 bit, you win nothing converting your graphics to 24 bit,
as you (or the driver) will eventually have to convert them again to 32 bit
at blit time, so you will experience lower performance.

Use texture compression if SDL allows you to. That’s the only option other
than downscaling, reducing how much you use, or load on demand, all of which
have downsides and may not be an option depending on what you do.On 11/5/07, Alberto Luaces wrote:

El Monday 05 November 2007 17:18:04 Miguel Pragier escribi?:

Alberto Luaces <aluaces udc.es> writes:

El Monday 05 November 2007 13:42:52 Miguel Pragier escribi?:

At present, I work on 32 bits PNG images.

The original 32 MB of PNG files, takes 110 MBs RAM, when the game
runs…

Would anyone know a way to downsize this consume?

Load only an image when you need it, delete it as soon as you aren’t
using it.

Ok.

In my games I have a lot of bonus ( jackPot-like ) animations.
When I load my images just before the use, we experience a small delay.
I read something about to shrink images resolution to 24 bits. Is it
possible? Can I convert my images from 32 bits to 24 and keep the
quality?
My plattaform is Windows, and the desktop is ~32 bit colors~.

You can develop some more complex strategies, as loading the image for the
first time and not freeing its memory until you are sure it would not be
needed for a long time, what one would call a “cache”. Maybe you have to
spend a little bit of memory for the possibly used graphics, but it
shouldn’t
be necessary to reach that 110 megabyte size. You will have to think about
the trade off between the loading delay and the amount of RAM used and
adjust
the program accordingly.

If your display is 32 bit, you win nothing converting your graphics to 24
bit,
as you (or the driver) will eventually have to convert them again to 32
bit
at blit time, so you will experience lower performance.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

My opinion is that 110 MB is not at all an issue in a game but like was suggested you can load on demand and drop things you won’t use again. I assume unlimited memory and cpu power until it’s a complete game unless it runs poorly on my developement computer. After that I test it on a couple of minimum tartget spec computers and tweek from there if needed.

---- Jeremy wrote:> Use texture compression if SDL allows you to. That’s the only option other

than downscaling, reducing how much you use, or load on demand, all of which
have downsides and may not be an option depending on what you do.

On 11/5/07, Alberto Luaces wrote:

El Monday 05 November 2007 17:18:04 Miguel Pragier escribi?:

Alberto Luaces <aluaces udc.es> writes:

El Monday 05 November 2007 13:42:52 Miguel Pragier escribi?:

At present, I work on 32 bits PNG images.

The original 32 MB of PNG files, takes 110 MBs RAM, when the game
runs…

Would anyone know a way to downsize this consume?

Load only an image when you need it, delete it as soon as you aren’t
using it.

Ok.

In my games I have a lot of bonus ( jackPot-like ) animations.
When I load my images just before the use, we experience a small delay.
I read something about to shrink images resolution to 24 bits. Is it
possible? Can I convert my images from 32 bits to 24 and keep the
quality?
My plattaform is Windows, and the desktop is ~32 bit colors~.

You can develop some more complex strategies, as loading the image for the
first time and not freeing its memory until you are sure it would not be
needed for a long time, what one would call a “cache”. Maybe you have to
spend a little bit of memory for the possibly used graphics, but it
shouldn’t
be necessary to reach that 110 megabyte size. You will have to think about
the trade off between the loading delay and the amount of RAM used and
adjust
the program accordingly.

If your display is 32 bit, you win nothing converting your graphics to 24
bit,
as you (or the driver) will eventually have to convert them again to 32
bit
at blit time, so you will experience lower performance.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

are you loading with image load, as they create surfaces and every
time you do a function that outputs a surface it creates a new one. So
you may be having many surfaces your not using just lying around in
memory

check out SDL Digest, Vol 10, Issue 8 as that reduced my memory foot print loads

Trish

Hello !

are you loading with image load, as they create surfaces and every
time you do a function that outputs a surface it creates a new one. So
you may be having many surfaces your not using just lying around in
memory

check out SDL Digest, Vol 10, Issue 8 as that reduced my memory foot print loads

For people that do not read the SDL mailing list as a digest,
it is better to point to some lists.libsdl.org/… link.

CU