What is the best size for tiles?
Printed From: Pixel Joint
Category: The Lounge
Forum Name: Diversions
Forum Discription: Get to know your fellow pixel freaks. Chat about anything to do with video games, comic books, anime, movies, television, books, music, sports or any other off topic bs you can think of.
URL: https://pixeljoint.com/forum/forum_posts.asp?TID=14170
Printed Date: 12 September 2025 at 11:11pm
Topic: What is the best size for tiles?
Posted By: Erik Leppen
Subject: What is the best size for tiles?
Date 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?
|
Replies:
Posted By: shampoop
Date 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.
|
|