Author Topic: Various different-sized images  (Read 3094 times)

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Various different-sized images
« on: 2009-01-23, 08:16:19 AM »
I've been noticing that I use a lot of different images of different sizes for the same tileset, but for each different size, I have to create a new graphic sheet.

I was thinking that it should be easier to make a single graphic of a specific size without needing to make a whole new graphic sheet.  And maybe combine those together into one graphic set so that they're visible all together when editing the frameset.  It makes sense to be able to define each cell of an animation at the optimum size, and there are other reasons too.

If you take a look at the graphics from Lost Garden, for example.  Look at the Indoor House graphics.  Normal tiles are 40x40 pixels.  Some are 45x40, some are 45x45, and so on, but I still want them to take up the same space as 40x40 images, and I don't want to have to use up two 40x40 cells.

What I was thinking was that each graphic set can be defined like a graphic sheet to start out with, but rather than showing the whole sheet, you could have a navigation tool to move to the next or previous cell, and be able to define cell size individually.

Or have both modes of editing, so you can make images that are 2x2 cells or whatever.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Various different-sized images
« Reply #1 on: 2009-01-24, 09:24:42 AM »
How would the graphics be arranged on the graphic sheet if they weren't all the same size?  They still should be stored in one image even if they aren't edited as one image.  I think it's a matter of optimization.  I think video hardware needs to do extra work if you switch to a different texture (graphic sheet) while drawing the scene.

In your case wouldn't it make sense to make the graphics sheet have all cells be 45x45, and only use 40x40 if the graphics only occupy 40x40?  You can still define the tile size as 40x40.  You need some buffer room around the graphics anyway, otherwise you get messy edges if you rotate them.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Various different-sized images
« Reply #2 on: 2009-01-24, 11:44:12 AM »
Except I don't rotate them, and the images are already set up in 40x40 sheets, and it wastes space.

The thought I had came from seeing the way Star Wars Galactic Battlegrounds stores its images (which uses the engine from Age Of Empires).  Each image had its own name stored in an abstract container.  I don't know if the data was stored as one image sheet or what.  It might have just been an optimization technique that looked at all the images and found the best way to store them all together on one image.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Various different-sized images
« Reply #3 on: 2009-01-25, 09:42:27 AM »
Well, I think this would be quite large change (almost on the scale of upgrading from DirectX to OpenGL) and I think the benefit would not be as significant.  I need some time to use the program instead of always changing it :).
If you only have the three sizes, you just need three graphic sheets, right?  (Or one graphic sheet with the extra space -- 5x45 pixels isn't much.)

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Various different-sized images
« Reply #4 on: 2009-01-25, 08:33:18 PM »
But there are more than just those sizes.  And it makes for an awful lot of graphic sheets when every set uses so many different sheets.  Maybe a way to group them together at least.
Edward Dassmesser

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Various different-sized images
« Reply #5 on: 2009-01-26, 06:30:54 AM »
And what about the idea of putting more sizes on one graphic sheet by leaving some unused space?  How much space would be wasted?  I think it would be reasonable if less than ~30% went unused.