Sprite Manipulation

Community Forums/General Help/Sprite Manipulation

blackwater(Posted 2012) [#1]
Hi all. I'm a novice when it comes to making graphics and such but I would love some expert feedback on my current situation.

I made some objects in Sketchup for an isometric game and used the isometric view in Sketchup, exported them as 2d images. In their exported format, they are a roughly 2 to 1 ratio, for example, 1000 width and 500 height.

I remember reading a while ago that all that "white" space adds up in terms of memory. When I bring that image into my level editor as is it lines up to my isometric grid perfectly.

Ok, so when I crop the image to eliminate that excess space, I take that same image and paste it into a 512x512 image. When I bring it into my game as is it's all crooked and doesn't line up to my isometric grid.

When I alter that image in the game, I can get it to line up to the grid. So a 512x512 image, I'll double the height and now it lines up just fine.

My question is which way is better? Should I leave the image as is and import into my game? Or should I delete that white space and change the width / height ratio of the image in the game? Are there any pros and cons of each method?

Thanks to anyone for sharing their knowledge and enlightening me! :)


matibee(Posted 2012) [#2]
I'm not quite sure I understood :)

By 'white space' do you mean empty pixels?

I wrote some blitzmax code a while ago to take a load of images and convert them into tile sheets, looking for duplicate or empty tiles as it went. You'd have to manage getting them back into your tile editor tho, which might be quite a pain, depending on how you've got it set up.

This is what I'm doing now...

Drawing every object (walls, doors, random objects etc etc) as its own png file regardless of the waste of tiles there might be around it.

Using the excellent Tiled ( http://www.mapeditor.org/ ) to load those images in and construct my levels.

This is very simple and very straightforward. It works a treat.

But later **as an optimisation step** to reduce the wasted tiles and dead space, I'm going to use my old code to generate tile sheets whilst reading the original tile locations from the Tiled level and replacing them with the new indices into the new sheets.


blackwater(Posted 2012) [#3]
I understand what I'm trying to say might be difficult to understand without some visuals so let me ask another question on those same lines.

Generally speaking, what is the accepted practice of white space, aka empty pixels, surrounding a sprite? Should they be eliminated to reduce memory when loaded or is it so small that it doesn't matter much? I'm not talking about packing them into sheets, just single sprite sheets. Thanks.