Huge Backgrounds != low memory

T

theRandom

Guest
Hi!

Trying make game with hudge hand-drawing backgrounds and problem is simple:
Backgrounds size 5200x2800 and its two big sprites (back and fore) that loads in memory.
Around 900mb of RAM !!! and there is nothing in the game yet :-\
You need to reduce the amount of used RAM.

Try make it tiled or load from the file - nothing.
Any tips?
 
T

The Green Dev

Guest
ill assume hudge means huge, but why does the background have to be so big?
 

Tthecreator

Your Creator!
uncompressed in memory it would be 2*5200x2800x4(r,g,b,a)=116.480.000 bytes = 116 mb.
So either i forgot something and I'm stupid, or something weird is going on.
Are there parts in the image that are opaque, or part that reoccur? if so you could divide the image up into parts and place all the parts on the right places in the room editor, using either some code or tiles on a background.
 

TheouAegis

Member
How many texture pages is the background split across?

I get over 900mb if I change the 4 in your equation to 32. Well, I get 888 mb, but once you factor in what GM itself takes up, it's over 900.

Also 2*5200*2800*4 is 111 mb, not 116. You don't divide by 1,000,000, you divide by 1,048,576.
 
S

Shihaisha

Guest
You can split that background into separate rooms and then load a required part on new room start using background_replace.
 
Top