[gameprogrammer] Re: memory management in a game with LOTS of art

  • From: Eugene Marcotte <mrpicalo@xxxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sun, 04 Jul 2004 13:47:58 -0400

I don't know if it's very feasible in his case(or even what you're
looking for), but making one image with all the artwork and putting them
in one file(or files if you split them into groups or something) and
loading it to a global variable of some sort then just blitting
selections out of the stored surface of all the artwork. 

This saved me alot of memory because each object doesn't need it's own
surface for artwork, it's all shared with all the objects(plus it makes
doing animations easy as adding a number to the id if you design it
properly)....

One trick I used is if there are images of different areas (32x32, 16x16
etc) put the images of the same size in their own files so you'd have
artwork16x16.png with all 16x16 artwork and then load that and make
blits from it.

Not sure if this method would work for him but you weren't very specific
as to what he was trying already... I dunno..

See ya,
Eugene

On Sun, 2004-07-04 at 02:40, Alan Wolfe wrote:
> Hello all,
> A friend of mine is working on making a 2d tiled online RPG using SDL and 
> OpenGL.
> 
> He has increasingly more art/mem usage as he adds stuff in (obviously) and 
> was working on a solution to somehow prioritize the art of what stays in RAM 
> and maybe storing the low priority stuff in files or something?
> 
> I dont think he really has a clue and myself, I've never dealt with this 
> issue before.
> 
> Anyone out there know how to deal with this issue, of what to do when you 
> start to aproach too much art to load all into RAM at one time?
> 
> Thanks a bunch!
> 
> Alan
> 
> 
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> 


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: