Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Memory usage / filesize

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
sotrain515




Joined: 17 May 2010
Posts: 39
Location: Connecticut

PostPosted: Sun Jul 28, 2013 10:07 am    Post subject: Memory usage / filesize Reply with quote

I have a question about backdrop vs. rects when it comes to memory usage.

What I'm wondering is should I always use slice collections of rects as opposed to backdrops when possible? For example, if I had a checkerboard background that I wanted to use, I could either import one as a backdrop graphic OR spend some time and create one using a bunch of rects in a slice collection and then load that up. Is it a waste of my time to do that or am I saving space?
Back to top
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Sun Jul 28, 2013 12:20 pm    Post subject: Re: Memory usage / filesize Reply with quote

sotrain515 wrote:
I have a question about backdrop vs. rects when it comes to memory usage.

What I'm wondering is should I always use slice collections of rects as opposed to backdrops when possible? For example, if I had a checkerboard background that I wanted to use, I could either import one as a backdrop graphic OR spend some time and create one using a bunch of rects in a slice collection and then load that up. Is it a waste of my time to do that or am I saving space?


Backdrops are 320x200 256 color uncompressed bitmaps. That means that each backdrop takes up 64 kilobytes of space (64000 bytes)

It is a little more difficult to estimate the size of a slice, but I went through the source and just added up the sizes of the members of the data structures, and got about 208 bytes for a slice, plus 28 more bytes for rectangle-specific data on a rectangle slice. Together that is a total of That is probably a little low because I am sure there is some overhead I am not counting, so Just to be on the safe side I am going to round up to 300 bytes.

So if my estimations are close, you would have to have more than 200 rectangle slices in your checkerboard before the slice collection was larger than the equivalent backdrop. If your checkerboard was made out of 16x16 squares, that would require 130 rectangle slices, so the slice collection would be slightly smaller, but not small enough that the savings is really important.

So the short answer is, don't worry about it. They are both in the same ballpark. If backdrops are easiest to make, then use backdrops. If slice collections are easiest to make, use slice collections.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sotrain515




Joined: 17 May 2010
Posts: 39
Location: Connecticut

PostPosted: Sun Jul 28, 2013 1:33 pm    Post subject: Reply with quote

Okay, thank you.
Back to top
View user's profile Send private message Send e-mail
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Tue Jul 30, 2013 12:42 am    Post subject: Reply with quote

Were you asking about RPG file size or RAM usage?

A simple image like a chequerboard pattern will compress to nearly nothing when the .rpg file is zipped. That goes for any image with large monochrome areas or similar repetition.

You would have to create hundreds of thousands of slices at once before the memory usage becomes a concern (but the game will start slow down way before that).

Either way unless you're trying to fit your whole game into 300KB you shouldn't be worrying about it.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group