Image Optimisation & RAM Usage
battleduck
Member Posts: 105
Hi guys,
I just watched TShirtBooths video on Art optimisation
where he explains about the 8x8 rule, and how when producing graphics, we should aim to use image sizes 8x8, 16x16,256x256 etc or variations thereof. TSB then explains that an image 30x66 would utilise 32x128 worth of RAM.
My question therefore is does this just apply to images imported into GS or to individual actors?
I'm working on an iPad puzzle game where for example I have a "Wall" actor with an image 64x256px. This actor would therefore use 64x256 worth of RAM, but if I then use multiple instances of this actor which are resized to construct a level, would GS / iPad use 64x256 worth of RAM for every instance of the "Wall" actor, or would an instance resized to say 64x96 use 64x128 RAM, and an instance resized to 64x64 use 64x64 worth of RAM, rather than the full 64x256 for each?
I hope I'm getting my point across, and would greatly appreciate an answer before I go any further with designing the many levels in mind for my game.
Thanks, for all the helpful videos & forum threads.
Battleduck
I just watched TShirtBooths video on Art optimisation
where he explains about the 8x8 rule, and how when producing graphics, we should aim to use image sizes 8x8, 16x16,256x256 etc or variations thereof. TSB then explains that an image 30x66 would utilise 32x128 worth of RAM.
My question therefore is does this just apply to images imported into GS or to individual actors?
I'm working on an iPad puzzle game where for example I have a "Wall" actor with an image 64x256px. This actor would therefore use 64x256 worth of RAM, but if I then use multiple instances of this actor which are resized to construct a level, would GS / iPad use 64x256 worth of RAM for every instance of the "Wall" actor, or would an instance resized to say 64x96 use 64x128 RAM, and an instance resized to 64x64 use 64x64 worth of RAM, rather than the full 64x256 for each?
I hope I'm getting my point across, and would greatly appreciate an answer before I go any further with designing the many levels in mind for my game.
Thanks, for all the helpful videos & forum threads.
Battleduck
Comments
Maybe i need to clarify slightly exactly what i'm asking.
What i'd like to know is, in terms of game performance and RAM utilisation, would I be better off with having a "Wall" actor with a single large 256x64px image, and just resizing the multiple instances of the actor to construct my levels, or have multiple prototypes of say 64x64, 128x64, 256x64 etc, each with their own imported image of the correct size?
Battleduck.
Ace
so just so I'm 100% straight with this Ace:
horrible pixelated images aside i can see a potential benefit to your example of a 64x64 image, using 64x64 of ram even on a 5000x5000 actor,
but then in reverse, does having 512x512 image used by 2 actors one sized 512x512, and the second 64x64 use 512x512 + 64x64 of ram or 512x512 *2 worth of ram? thus using more than it really needs to.
thanks again
Ace
Ace
Ace
This gives me so many ides
Edit - Ace: "A lot of different instances does bog your game down a little, but not because of the images, it is treating each instance of the same actor as a different actor.
Ace"
Dang.
I have a crate actor which has a lot of rules for various different scenarios in it, but not all the scenarios crop up in all levels,
would i be better off unlocking the instances in each level and deleting the rules that aren't needed for that level so the scene is not unnecessarily loading the extra rules? or would just turning off the rules do anything to help out?
Ace
GS working with Vector art, so images resize in accordance.
Ace
Custom fonts without the crazy code would be nice... Adding that to the wish list!
Ace
But I could be wrong.
Ace
I want to be one of the GS Gods.
Fantastic idea mate, me calls that a Pluggin!
basically working from generic actors …
In designPhase, drag image into the actorInstance; set the actorAttributes correctly
In actorBehavior Editor: 1st element: changeAttribute: [exp]self.image To: imageName/#
when everything works great in that scene: drag the transparent.png to replace the pix in the actorInstance …
this does not affect other attributes such as W,H; X,Y; color, etc.
IMO by doing this, at the start of scene, the device loads 69 bytes of image/actor sequentially.
the individual actors load their real images simultaneously.
even more efficient programming: create an attribute in the prototypeActor … either myName (text) or my# (index)
then 1st element in behaviorEditor: changeAttribute: [exp]self.image To: [exp]self.myName or self.my#
this will be correctly processed in each instance.
vector images would use less RAM and be fantastic for scaling … can hardly wait!
alas, think GS will start with bitmap fonts for custom fonts … when/if ever we get them.
MH