Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Graphics (sorry, my skill does not lie in the making of  (Read 5747 times)

Savok

  • Bay Watcher
    • View Profile
Graphics (sorry, my skill does not lie in the making of
« on: August 16, 2007, 09:28:00 pm »

While this topic probably has been talked about before at length, I've just joined and I'm bad at search.

Why must object tilesets have sizes in multiples of four? I have a 9x9 tileset that I'd like to have a certain font style for that would work very poorly with creatures.

Logged
So sayeth the Wiki Loremaster!

Core Xii

  • Bay Watcher
    • View Profile
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #1 on: August 16, 2007, 09:59:00 pm »

Who said they have to be in multiples of four?
Logged
Reality is for people who lack imagination

Eagle of Fire

  • Bay Watcher
  • Friendly Fire
    • View Profile
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #2 on: August 16, 2007, 10:04:00 pm »

That's what is said on the wiki anyways...

quote:
Note: Due to the way the game loads graphic files, all .bmp file dimensions should be in multiples of 4. Graphical errors may result if this is not the case.
Logged
I am on a hot streak... literally.

Fieari

  • Bay Watcher
    • View Profile
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #3 on: August 16, 2007, 10:17:00 pm »

I don't know exactly why, though I suspect it has to do with the scaling code.  At any rate, you can still make 9x9 tiles by increasing the size of each tile till you get a multiple of four... in this case, 36x36 for each tile.  The game will shrink it for you, and it'll look 9x9 to you, so long as you set the correct window size in the init file.
Logged

Zaratustra

  • Bay Watcher
    • View Profile
    • http://zarat.us/
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #4 on: August 16, 2007, 10:24:00 pm »

OpenGL limitations, I believe.

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #5 on: August 16, 2007, 10:34:00 pm »

quote:
Originally posted by Savok:
<STRONG>Why must object tilesets have sizes in multiples of four?</STRONG>

It's because the game wants them stored in bitmap files.  Microsoft bitmap format (*.bmp, magic number 4D42) is not well-documented.  One of the quirks is that the horizontal width of an image needs to be a multiple of four, or some of the programs that use them break in strange ways.

Since the format used for tilesets has 16 characters horizontally, the tileset image width will always be a multiple of four.

The limitation is not on the individual tiles in the set, as far as I can determine, so I do not think you have to scale up to 36x36 tiles.

Really, I think you don't need to worry about it at all.

0x517A5D

Logged

utunnels

  • Bay Watcher
  • Axedwarf
    • View Profile
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #6 on: August 16, 2007, 10:35:00 pm »

Maybe a texture must be in a size of 'power of 2' in some video cards.

[ August 16, 2007: Message edited by: utunnels ]

Logged
The troglodyte head shakes The Troglodyte around by the head, tearing apart the head's muscle!

Risen Asteshdakas, Ghostly Recruit has risen and is haunting the fortress!

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #7 on: August 17, 2007, 01:29:00 pm »

quote:
Originally posted by utunnels:
<STRONG>Maybe a texture must be in a size of 'power of 2' in some video cards.</STRONG>

Yes, I remember something about that for cards that are now several generations old.  But as far as I can tell, textures are not in use at all.  Nor are shaders.  Nor polygons, even.

All that's going on is that a character-size block is "blit"-transfered from the tileset, colored, and "blit" transfered again to the proper location in the window.  Pixel shaders might be used to do this, but I believe it more likely that it's done manually by the program.

If this is correct, texture limitations shouldn't matter.

0x517A5D

Logged

Savok

  • Bay Watcher
    • View Profile
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #8 on: August 17, 2007, 03:42:00 pm »

Ok, thanks for the help.

Attempting to make a 9x9 object tileset...

Logged
So sayeth the Wiki Loremaster!

Shades

  • Bay Watcher
    • View Profile
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #9 on: August 17, 2007, 04:57:00 pm »

It depends if Toady has dealt with the issue in the code or not, basically opengl textures must be sized in a power of two (2,4,8,16,32 etc) however I don't know how he loads the textures so it may just be that the whole image file has to be that way and not the individual tiles, or it may be that it's being resized correctly internally and doesn't matter.

:)

Logged
Its like playing god with sentient legos. - They Got Leader
[Dwarf Fortress] plays like a dizzyingly complex hybrid of Dungeon Keeper and The Sims, if all your little people were manic-depressive alcoholics. - tv tropes
You don't use science to show that you're right, you use science to become right. - xkcd

Savok

  • Bay Watcher
    • View Profile
Re: Graphics (sorry, my skill does not lie in the making of
« Reply #10 on: August 17, 2007, 08:11:00 pm »

I tried making 36x36 tiles, and they resized to 9x9.

Problem solved.

Logged
So sayeth the Wiki Loremaster!