Diversions
 Pixel Joint Forum : The Lounge : Diversions
Message Icon Topic: What is the best size for tiles? Post Reply Post New Topic
Author Message
Erik Leppen
Seaman
Seaman


Joined: 22 January 2011
Online Status: Offline
Posts: 9
Quote Erik Leppen Replybullet Topic: What is the best size for tiles?
    Posted: 09 April 2012 at 10:13am
(Not sure where to ask this, but here seems safe to me ;))

I have created several 2D computer games in the past featuring pixel art tilesets (mostly side view games). However I have used several dfiferent tile sizes, so while collecting all my pixel work I end up with incompatible tilesets, because the sizes don't match. I'd like to settle on a definitive size once and for all, but what is the best choice for their size?

For me the choice is between the following two:
20 x 20, because it is divisible by 1, 2, 4 and 5, and it fits easily within multiples of 100, and it fits in 640 x 480.
24 x 24, because it is divisible by 1, 2, 3, 4, 6 and 8.
The "historic default" of 16 x 16 does not do it for me because it has too few divisors (only 1, 2, 4, 8, 16).

What would you choose? Or would you pick another size? And if so, why?
IP IP Logged
shampoop
Commander
Commander
Avatar

Joined: 12 January 2015
Online Status: Offline
Posts: 202
Quote shampoop Replybullet Posted: 09 April 2012 at 12:29pm
The nice thing about 16 x 16 tiles, or any other dimension that is base 2 (8x8, 16x16, 32x32, 64x64), is bit operations plays nicely with them.

Examples:

How many pixels are in a 10x10 tiles?
10^2 = 10 * 10 = 100 (notice the multiplcation needed)

How many pixels are in 2x2, 4x4, 8x8, 16x16, 32x32 tiles....
2x2   = 2 << 1 = 4
4x4   = 4 << 2 = 16
8x8   = 8 << 3 = 64
16x16 = 16 << 4 = 256
32x32 = 32 << 5 = 1024

Not impressed?

What is the center pixel of a 10 x 10 tile?
(10 / 2, 10 / 2) yuck!

What is the center pixel of a 16 x 16 tile?
(16 >> 1, 16 >> 1) yeah baby!
How about 32x32?
Same, (32 >> 1, 32 >> 1)

These calulations add up when dealing with thousands of tiles at 60 frames per second. Although computers are so fast these days, I wouldn't worry too much on tile dimension vs speed of calculation and focus on what looks good 2 you.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

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